streaming - Gstreamer. Multiple pcap to avi -
i have multiple .pcap files 01.pcap, 02.pcap,...n.pcap, includes 2 streams, audio-g.711 video-h.264. every pcap has ~1 min of streaming , need make 1 .avi. use mergecap.exe concatenate pcaps 1 big pcap.
mergecap.exe -f pcap 01.pcap 02.pcap ....n.pcap -w out.pcap
after use gstreamer make .avi file
gst-launch-1.0 filesrc location=out.pcap ! tee name=t ! pcapparse dst-ip=192.168.2.55 dst-port=5010 ^ ! application/x-rtp, media=(string)video, clock-rate=(int)90000, encoding-name=(string)h264, payload=(int)96 ^ ! rtpjitterbuffer ^ ! rtph264depay ^ ! h264parse ^ ! queue^ ! mux. t. ! pcapparse dst-ip=192.168.2.55 dst-port=4010 ^ ! application/x-rtp, media=(string)audio, clock-rate=(int)8000, encoding-name=(string)pcma, channels=(int)1, payload=(int)8 ^ ! rtpjitterbuffer ^ ! rtppcmadepay ^ ! queue ^ ! mux. avimux name=mux ! filesink location=test.avi
this pipeline works 1 pcap well.. when conatenate 2 .pcaps, it's works too. if more 2 pacaps-> rtpjitterbuffer drops every video packet
...
0:00:03.856698538 12812 08e3fd28 warn rtpjitterbuffer gstrtpjitterbuffer.c:2163:gst_rtp_jitter_buffer_chain:<rtpjitterbuffer0> packet #41238 late #57525 popped, dropping 0:00:03.861442222 12812 08e3fd28 warn rtpjitterbuffer gstrtpjitterbuffer.c:2163:gst_rtp_jitter_buffer_chain:<rtpjitterbuffer0> packet #41239 late #57525 popped, dropping 0:00:03.870865810 12812 08e3fd28 warn rtpjitterbuffer gstrtpjitterbuffer.c:2163:gst_rtp_jitter_buffer_chain:<rtpjitterbuffer0> packet #41240 late #57525 popped, dropping 0:00:03.876392403 12812 08e3fd28 warn rtpjitterbuffer gstrtpjitterbuffer.c:2163:gst_rtp_jitter_buffer_chain:<rtpjitterbuffer0> packet #41241 late #57525 popped, dropping , continues... , continues... , continues...
...
i trying :
- change latency in rtpjitterbuffer
- remove rtpjitterbuffer
- don't use tee
your suggestions why happening? remind works 2 pcap's. no matter pcaps 1 2 or 5 6 or ...
upd. tried play queues otopolsky described still did not works. put queue after tee element. same error. think that's because rtpjitterbuffer in 2 different threads uses in same variable (from main thread?)
maybe there way make audio , video synchronized pcap's rtp timestamp's?
i think on 80% problem not put queue before processing of each tee branch.. when rtpjitterbuffers in 1 thread may lock each other. best guess put queue right after pcapparse or maybe before completly sure:
gst-launch-1.0 filesrc ! tee name=t avimux name=mux ! filesink location=test.avi t. ! pcapparse ! x-rtp caps ! queue ! rtpjitterbuffer ! rtph264depay ! h264parse ! mux. t. ! pcapparse ! x-rtp caps ! queue ! rtpjitterbuffer ! rtppcmadepay ! mux. t. ! pcapparse ! x-rtp caps ! queue ! rtpjitterbuffer ! rtpwhateverelse .. ! mux.
you may play position of queue or put more queue. remember queue used not buffering purpose separate processing different threads - nicely written here - check nice picture @ beginning depicting threads.
hth - hope answer.. if not update question or ask in comment.
Comments
Post a Comment