I can't mux the h.264 stream to the file.

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

I can't mux the h.264 stream to the file.

Hecate_Eos
Hi everyone,
I have the bellow pipeline, it can work well in the command-line. But when I realize it in my program with c, it can't work. I don't know why??? It troubled me for a long time.  
                          .____________                                               |-->queue->ffdec_h264->videoscale->xvimagesink
udpsrc->queue-> |                  | ->queue -> rtph264depay -> tee->|
                         |  gstrtpbin     |                                                 |-->queue->"video/x-h264,width=(int)640,heigth=(int)480,framerate=(fraction)25/1"->queue->matraskamux->filesink location="t.mkv"
udpsrc->queue-> |____________|->queue->udpsink


gst-launch -v gstrtpbin name=rtpbin latency=400   \
    udpsrc caps="application/x-rtp, media=(string)video, clock-rate=(int)90000, encoding-name=(string)H264, ssrc=(uint)340005641, payload=(int)96, clock-base=(uint)2625017333, seqnum-base=(uint)5894" \
            port=5000 ! queue ! rtpbin.recv_rtp_sink_0  rtpbin. ! rtph264depay ! queue ! tee name=teevideo teevideo. ! queue !  ffdec_h264 ! ffmpegcolorspace ! videoscale ! xvimagesink \
    udpsrc port=5001 ! queue ! rtpbin.recv_rtcp_sink_0   \
    rtpbin.send_rtcp_src_0 ! queue ! udpsink port=5005 host="211.64.20.87" sync=true async=false \
    teevideo. ! queue ! "video/x-h264,width=(int)640,height=(int)480,framerate=(fraction)25/1" ! queue ! matroskamux name=mux mux. ! filesink location="t.mkv"

If I do not add the recording branch, just showing the video, it can work well in my program. But, if I add the recording branch, it does not work. It shows single one frame, and it stopped, it give me a static picture. At the same time, t.mkv has none of the data. I guess the problem must in the recording branch as I removed it in the program which can work well.
What's wrong in my pipeline? Or may be  is my program ?