vpuenc and matroskamux produce file of zero length

cancel
Showing results for 
Search instead for 
Did you mean: 

vpuenc and matroskamux produce file of zero length

352 Views
RobbieJiang
Contributor IV

Hi all,

I'm trying to stream video in H.264 format from mx6q,

then receive  and save into a mkv file on PC.

But the length of the generated file is zero.

The sender pipeline on  mx6q machine (192.168.1.10):

gst-launch -v gstrtpbin name=rtpbin \

    tvsrc device=/dev/video1 ! 'video/x-raw-yuv,format=(fourcc)UYVY,width=720,height=576,framerate=25/1' ! mfw_ipucsc ! 'video/x-raw-yuv,format=(fourcc)I420, width=720,height=576,framerate=25/1'! vpuenc codec=avc bitrate=200 gopsize=5 ! video/x-h264,width=720,height=576 ! rtph264pay mtu=512 ! rtpbin.send_rtp_sink_0 \

    rtpbin.send_rtp_src_0 ! udpsink host=192.168.1.68 port=50000  \

    rtpbin.send_rtcp_src_0 ! udpsink host=192.168.1.68 port=50001 sync=false async=false \

    udpsrc port=50002 ! rtpbin.recv_rtcp_sink_0

I'm sure the sender pipeline works fine,

as the following pipeline can decode and display video on PC(192.168.1.68):

gst-launch -v gstrtpbin name=rtpbin  \

        udpsrc port=50000 caps="application/x-rtp, media=(string)video, clock-rate=(int)90000, encoding-name=(string)H264, sprop-parameter-sets=(string)\"Z0JAHqaAtBJkAA\\=\\=\\,aM48gAA\\=\", ssrc=(uint)3684346187, payload=(int)96, clock-base=(uint)1526856633, seqnum-base=(uint)47590" ! rtpbin.recv_rtp_sink_0 \

        rtpbin. ! rtph264depay ! ffdec_h264 ! xvimagesink \

         udpsrc port=50001 ! rtpbin.recv_rtcp_sink_0 \

    rtpbin.send_rtcp_src_0 ! udpsink host=192.168.1.10 port=50002 sync=false async=false

However, the following receiver pipeline on PC (192.168.1.68)  produce a file of 0 byte length:

gst-launch -v gstrtpbin name=rtpbin \

    udpsrc port=50000 caps='application/x-rtp, media=(string)video, clock-rate=(int)90000, encoding-name=(string)H264, sprop-parameter-sets=(string)\"Z0JAHqaAtBJkAA\\=\\=\\,aM48gAA\\=\", ssrc=(uint)3684346187, payload=(int)96, clock-base=(uint)1526856633, seqnum-base=(uint)47590' ! rtpbin.recv_rtp_sink_0 \

    rtpbin. ! rtph264depay ! h264parse ! matroskamux ! filesink location=./test.mkv \

         udpsrc port=50001 ! rtpbin.recv_rtcp_sink_0 \

         rtpbin.send_rtcp_src_0 ! udpsink port=50002 host=192.168.1.10  sync=false async=false

Unfortunately, file "test.mkv" is 0 byte when the receiver pipeline ends.

So why can not  matroskamux  produce a valid file?

From the outputs of the receiver pipeline, I noticed

/GstPipeline:pipeline0/GstRtpH264Depay:rtph264depay0.GstPad:src: caps = video/x-h264, stream-format=(string)byte-stream, alignment=(string)nal

Seems that the format of the H264 stream produced by vpuenc is not compatible with

what matroskamux requires:

"video/x-h264, stream-format=(string)avc, alignment=(string)au"

Is this the possible reason?

How to receive and save a correct H264 file at the receive side?

Thanks.

Labels (3)
0 Kudos
1 Reply

68 Views
Yuri
NXP TechSupport
NXP TechSupport

Hello,

  I hope the following helps.

streaming date playback

rtp/udp streaming data transfer


Have a great day,
Yuri

-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

0 Kudos