gstreamer playback of MPEG-TS files

I am attempting to playback an MPEG-TS file using the command:

nvidia@tegra-ubuntu:~/scripts/works/mpeg2$ gst-launch-1.0 filesrc location=/home/nvidia/HD_H264_06011_TS_ASYN_V1_001.mpeg ! tsdemux name=demux demux. ! mpegvideoparse ! omxmpeg2videodec ! nvoverlaysink -e
Setting pipeline to PAUSED …
Inside NvxLiteH264DecoderLowLatencyInitNvxLiteH264DecoderLowLatencyInit set DPB and MjstreamingInside NvxLiteH265DecoderLowLatencyInitNvxLiteH265DecoderLowLatencyInit set DPB and MjstreamingPipeline is PREROLLING …
WARNING: from element /GstPipeline:pipeline0/GstTSDemux:demux: Delayed linking failed.
Additional debug info:
./grammar.y(506): gst_parse_no_more_pads (): /GstPipeline:pipeline0/GstTSDemux:demux:
failed delayed linking some pad of GstTSDemux named demux to some pad of GstMpegvParse named mpegvparse0
ERROR: from element /GstPipeline:pipeline0/GstTSDemux:demux: Internal data stream error.
Additional debug info:
mpegtsbase.c(1388): mpegts_base_loop (): /GstPipeline:pipeline0/GstTSDemux:demux:
stream stopped, reason not-linked
ERROR: pipeline doesn’t want to preroll.
Setting pipeline to NULL …
Freeing pipeline …
nvidia@tegra-ubuntu:~/scripts/works/mpeg2$

most of the examples show mpeg2tsdemux as the plugin, but it doesn’t show in gst-inspect-1.0.

Thanks for any pointers.
K-

nvidia@tegra-ubuntu:~/scripts/works/mpeg2$ mediainfo ~/HD_H264_06011_TS_ASYN_V1_001.mpeg
General
ID : 1 (0x1)
Complete name : /home/nvidia/HD_H264_06011_TS_ASYN_V1_001.mpeg
Format : MPEG-TS
File size : 38.9 MiB
Duration : 49s 877ms
Overall bit rate mode : Constant
Overall bit rate : 6 538 Kbps

Video
ID : 481 (0x1E1)
Menu ID : 1 (0x1)
Format : AVC
Format/Info : Advanced Video Codec
Format profile : Main@L4
Format settings, CABAC : Yes
Format settings, ReFrames : 3 frames
Codec ID : 27
Duration : 46s 400ms
Bit rate mode : Variable
Bit rate : 6 215 Kbps
Maximum bit rate : 6 029 Kbps
Width : 1 280 pixels
Height : 720 pixels
Display aspect ratio : 16:10
Frame rate : 60.000 fps
Color space : YUV
Chroma subsampling : 4:2:0
Bit depth : 8 bits
Scan type : Progressive
Bits/(Pixel*Frame) : 0.112
Stream size : 34.4 MiB (88%)

Menu
ID : 480 (0x1E0)
Menu ID : 1 (0x1)
Duration : 49s 877ms
List : 481 (0x1E1) (AVC) / 497 (0x1F1) (KLV)

nvidia@tegra-ubuntu:~/scripts/works/mpeg2$

some corresponding threads found:
[url]https://devtalk.nvidia.com/default/topic/1012401/jetson-tx2/capturing-raw-video-using-gstreamer/post/5163717/#5163717[/url]
https://devtalk.nvidia.com/default/topic/1004977/jetson-tx2/vlc-not-working-on-l4t-r27-0-1-/
do you have the gst-bad-ugly set?

Please try
gst-launch-1.0 filesrc location= ! decodebin ! nvoverlaysink

Hi @kunice

Based on your mediainfo output, the video stream looks like H264 rather than MPEG2.

Video
ID : 481 (0x1E1)
Menu ID : 1 (0x1)
Format : <b>AVC</b>
Format/Info : Advanced Video Codec

Modifying you pipeline to decode H264:
gst-launch-1.0 filesrc location=/home/nvidia/HD_H264_06011_TS_ASYN_V1_001.mpeg ! tsdemux name=demux demux. ! h264parse ! omxh264dec ! nvoverlaysink -e

1 Like

Thanks that worked.