How to convert pcap to avi file with video and audio by gstreamer?

I need to read a pcap file and convert it into a avi file with audio and video by using gstreamer.

If i try the following command, it only works for generating a video file.

Video Only

gst-launch-0.10 -m -v filesrc location=h264Audio.pcap ! pcapparse src-port=44602 !"application/x-rtp, payload=96" ! rtph264depay ! "video/x-h264, width=352, height=288, framerate=(fraction)30/1" ! ffdec_h264 ! videorate ! ffmpegcolorspace ! avimux ! filesink location=testh264.avi

Audio Only

And if i use the following command, it only works for generating a audio file.

gst-launch-0.10 -m -v filesrc location=h264Audio.pcap ! pcapparse src-port=7892 ! "application/x-rtp, payload=8" ! rtppcmadepay ! alawdec ! audioconvert ! audioresample ! avimux ! filesink location=test1audio.avi

Video + Audio

When i combine two commands as follows, i encountered an error message -- ERROR: from element /GstPipeline:pipeline0/GstFileSrc:filesrc1: Internal data flow error.

gst-launch-0.10 -m -v filesrc location=h264Audio.pcap ! pcapparse src-port=44602 !"application/x-rtp, payload=96" ! rtph264depay ! "video/x-h264, width=352, height=288, framerate=(fraction)30/1" ! ffdec_h264 ! videorate ! ffmpegcolorspace ! queue ! mux. filesrc location=h264Audio.pcap pcapparse src-port=7892 ! "application/x-rtp, payload=8" ! rtppcmadepay ! alawdec ! audioconvert ! audioresample ! queue ! avimux name=mux ! filesink location=testVideoAudio.avi

Please kindly give me some solutions or suggestions with regard to this issue. Thank you in advance. Eric


而不是第二个“filesrc!pcapparse”为第一个pcapparse指定一个名称= demux,删除src-port arg并从demux启动第二个分支。

链接地址: http://www.djcxy.com/p/7634.html

上一篇: 如何顺时针旋转图像?

下一篇: 如何通过gstreamer将pcap转换为带有视频和音频的avi文件?