2013-08-22 1 views
0

Я новичок в gstreamer. Я хочу передавать только аудио/видео на порт rtp. Я попытался следующие команды для потоковой передачи только видео из Mpeg файла:Как передавать только аудио/видео из файла mpeg с помощью gstreamer?

$ gst-launch-1.0 -v rtpbin name=rtpbin filesrc location=KRSNA.mpg ! decodebin ! 'video/mpeg' ! rtpmpvpay ! udpsink host=127.0.0.1 port=9078 

Ниже приводится многословным для команды:

Setting pipeline to PAUSED ... 
Pipeline is PREROLLING ... 
/GstPipeline:pipeline0/GstDecodeBin:decodebin0/GstTypeFindElement:typefind.GstPad:src: caps = video/mpeg, systemstream=(boolean)true, mpegversion=(int)1 
/GstPipeline:pipeline0/GstDecodeBin:decodebin0/GstTypeFindElement:typefind.GstPad:src: caps = video/mpeg, systemstream=(boolean)true, mpegversion=(int)1 
/GstPipeline:pipeline0/GstDecodeBin:decodebin0/GstMpegPSDemux:mpegpsdemux0.GstPad:sink: caps = video/mpeg, systemstream=(boolean)true, mpegversion=(int)1 
/GstPipeline:pipeline0/GstDecodeBin:decodebin0/GstMultiQueue:multiqueue0.GstPad:sink_0: caps = video/mpeg, mpegversion=(int)1, systemstream=(boolean)false 
/GstPipeline:pipeline0/GstDecodeBin:decodebin0/GstMultiQueue:multiqueue0.GstPad:sink_0: caps = video/mpeg, mpegversion=(int)1, systemstream=(boolean)false 
/GstPipeline:pipeline0/GstDecodeBin:decodebin0/GstMpegvParse:mpegvparse0.GstPad:sink: caps = video/mpeg, mpegversion=(int)1, systemstream=(boolean)false 
/GstPipeline:pipeline0/GstDecodeBin:decodebin0/GstMultiQueue:multiqueue0.GstPad:sink_1: caps = audio/mpeg, mpegversion=(int)1 
/GstPipeline:pipeline0/GstDecodeBin:decodebin0/GstMultiQueue:multiqueue0.GstPad:sink_1: caps = audio/mpeg, mpegversion=(int)1 
/GstPipeline:pipeline0/GstDecodeBin:decodebin0/GstMultiQueue:multiqueue0.GstPad:sink_1: caps = audio/mpeg, mpegversion=(int)1 
/GstPipeline:pipeline0/GstDecodeBin:decodebin0/GstMpegAudioParse:mpegaudioparse0.GstPad:src: caps = audio/mpeg, mpegversion=(int)1, mpegaudioversion=(int)1, layer=(int)2, rate=(int)48000, channels=(int)2, parsed=(boolean)true 
/GstPipeline:pipeline0/GstDecodeBin:decodebin0/GstMpg123AudioDec:mpg123audiodec0.GstPad:sink: caps = audio/mpeg, mpegversion=(int)1, mpegaudioversion=(int)1, layer=(int)2, rate=(int)48000, channels=(int)2, parsed=(boolean)true 
/GstPipeline:pipeline0/GstDecodeBin:decodebin0/GstMpegvParse:mpegvparse0.GstPad:src: caps = video/mpeg, mpegversion=(int)1, systemstream=(boolean)false, parsed=(boolean)true, width=(int)720, height=(int)576, framerate=(fraction)25/1, pixel-aspect-ratio=(fraction)16/15, codec_data=(buffer)000001b32d0240830c352398 
/GstPipeline:pipeline0/GstDecodeBin:decodebin0/avdec_mpeg2video:avdec_mpeg2video0.GstPad:sink: caps = video/mpeg, mpegversion=(int)1, systemstream=(boolean)false, parsed=(boolean)true, width=(int)720, height=(int)576, framerate=(fraction)25/1, pixel-aspect-ratio=(fraction)16/15, codec_data=(buffer)000001b32d0240830c352398 
Redistribute latency... 
/GstPipeline:pipeline0/GstDecodeBin:decodebin0/GstMpg123AudioDec:mpg123audiodec0.GstPad:src: caps = audio/x-raw, format=(string)S16LE, layout=(string)interleaved, rate=(int)48000, channels=(int)2, channel-mask=(bitmask)0x0000000000000003 
/GstPipeline:pipeline0/GstDecodeBin:decodebin0/avdec_mpeg2video:avdec_mpeg2video0.GstPad:src: caps = video/x-raw, format=(string)I420, width=(int)720, height=(int)576, pixel-aspect-ratio=(fraction)16/15, interlace-mode=(string)progressive, colorimetry=(string)bt601, framerate=(fraction)25/1 
/GstPipeline:pipeline0/GstDecodeBin:decodebin0/GstMultiQueue:multiqueue0: max-size-buffers = 5 
/GstPipeline:pipeline0/GstDecodeBin:decodebin0/GstMultiQueue:multiqueue0: max-size-time = 0 
/GstPipeline:pipeline0/GstDecodeBin:decodebin0/GstMultiQueue:multiqueue0: max-size-bytes = 2097152 
/GstPipeline:pipeline0/GstDecodeBin:decodebin0/GstMultiQueue:multiqueue0: max-size-buffers = 5 
/GstPipeline:pipeline0/GstDecodeBin:decodebin0/GstMultiQueue:multiqueue0: max-size-time = 0 
/GstPipeline:pipeline0/GstDecodeBin:decodebin0/GstMultiQueue:multiqueue0: max-size-bytes = 2097152 
/GstPipeline:pipeline0/GstCapsFilter:capsfilter1: caps = video/mpeg 
/GstPipeline:pipeline0/GstCapsFilter:capsfilter2: caps = video/mpeg 
/GstPipeline:pipeline0/GstDecodeBin:decodebin0/GstMpg123AudioDec:mpg123audiodec0.GstPad:src: caps = audio/x-raw, format=(string)S16LE, layout=(string)interleaved, rate=(int)48000, channels=(int)2, channel-mask=(bitmask)0x0000000000000003 
/GstPipeline:pipeline0/GstDecodeBin:decodebin0.GstDecodePad:src_1: caps = audio/x-raw, format=(string)S16LE, layout=(string)interleaved, rate=(int)48000, channels=(int)2, channel-mask=(bitmask)0x0000000000000003 
/GstPipeline:pipeline0/GstDecodeBin:decodebin0.GstDecodePad:src_1.GstProxyPad:proxypad8: caps = audio/x-raw, format=(string)S16LE, layout=(string)interleaved, rate=(int)48000, channels=(int)2, channel-mask=(bitmask)0x0000000000000003 
/GstPipeline:pipeline0/GstDecodeBin:decodebin0/avdec_mpeg2video:avdec_mpeg2video0.GstPad:src: caps = video/x-raw, format=(string)I420, width=(int)720, height=(int)576, pixel-aspect-ratio=(fraction)16/15, interlace-mode=(string)progressive, colorimetry=(string)bt601, framerate=(fraction)25/1 
/GstPipeline:pipeline0/GstDecodeBin:decodebin0.GstDecodePad:src_0: caps = video/x-raw, format=(string)I420, width=(int)720, height=(int)576, pixel-aspect-ratio=(fraction)16/15, interlace-mode=(string)progressive, colorimetry=(string)bt601, framerate=(fraction)25/1 
/GstPipeline:pipeline0/GstDecodeBin:decodebin0.GstDecodePad:src_0.GstProxyPad:proxypad9: caps = video/x-raw, format=(string)I420, width=(int)720, height=(int)576, pixel-aspect-ratio=(fraction)16/15, interlace-mode=(string)progressive, colorimetry=(string)bt601, framerate=(fraction)25/1 
ERROR: from element /GstPipeline:pipeline0/GstDecodeBin:decodebin0/GstMpegPSDemux:mpegpsdemux0: Internal data stream error. 
Additional debug info: 
gstmpegdemux.c(2871): gst_flups_demux_loop(): /GstPipeline:pipeline0/GstDecodeBin:decodebin0/GstMpegPSDemux:mpegpsdemux0: 
stream stopped, reason not-linked 
ERROR: pipeline doesn't want to preroll. 
Setting pipeline to NULL ... 
Freeing pipeline ... 

Как только поток аудио/видео с Mpeg файла с помощью GStreamer?

Любые помогают/указатели appriciated ...

ответ

0

Пожалуйста, попробуйте не использовать decodebin. Используйте совместимый элемент demuxer, а затем используйте необходимые элементы синтаксического анализатора и декодера.

Если вы хотите запустить элементарный (только видео/только аудио) из формата контейнера, используйте требуемые элементы (видеоэлементы для видеопотоков/аудиоэлементов для аудиопотока).

gst-launch-0.10 filesrc location=sample.mkv ! matroskademux ! h264parse ! ffdec_h264 ! ffmpegcolorspace ! autovideosink 

Вышеприведенное заявление, например, даст видеовыход, игнорирующий звук, и то же самое может быть достигнуто для аудио.

Надеется, что это помогает, также посмотреть here

0
gst-launch-0.10 filesrc location=c:/test.mpg ! mpegpsdemux ! mpegvideoparse ! mpeg2dec ! rtpvrawpay ! udpsink port=9078 

Этого трубопровод работает для меня, хотя я должен был заменить mpegpsdemux для tsdemux, так как я был только бывшим установлено.

Смежные вопросы