Как передавать только аудио/видео из файла mpeg с помощью gstreamer?

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

    $ 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?

Любая помощь/указатели оценены...


person amar    schedule 22.08.2013    source источник


Ответы (2)


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

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

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

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

Надеюсь, это поможет, также смотрите здесь

person user2618142    schedule 22.08.2013

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

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

person rubndsouza    schedule 22.08.2013