The problem is that I used tsparse. After demuxing the stream it is no longer a TS file and one therefor has to use mpegvideoparse or similar parser elements.
Playing mpeg2ts with Gstreamer-1.0 on Raspberry Pi
-
01-07-2022 - |
Question
Good day fellow programmers,
I am trying to play a .ts file with gstreamer straight on a RPi.
Gstreamer-1.0 as well as gst-omx have been successfully installed and this example pipeline runs like a charm:
gst-launch-1.0 -v filesrc location=h264_720p_hp_5.1_6mbps_ac3_planet.mp4 ! qtdemux ! h264parse ! omxh264dec ! autovideosink
It actually even works using gst-launch-1.0 playbin uri=file:/root/h264_720p_hp_5.1_6mbps_ac3_planet.mp4
However if I try to use playbin to play a .ts file it actually does run it but only with a very poor frame rate which makes this approach unusable.
If I try to build a custom pipeline similar to one shown above I am stuck with "tsparse" apparently being incompatible with "omxmpeg2videodec".
This is what I run:
gst-launch-1.0 -v filesrc location=parkrun1920_12mbps.ts ! tsdemux ! tsparse ! omxmpeg2videodec ! autovideosink
Which outputs this error:
erroneous pipeline: could not link mpegtsparse2-0 to omxmpeg2videodec-omxmpeg2videodec0
Does anyone has an idea how I could get gstreamer to fluently play mpeg2-ts files?
My goal is to play http unicast mpeg2-ts streams provided by mumudvb on the same RPi.
Thanks for your help, it would be greatly appreciated!
Edit: omxplayer plays the .ts file perfectly smooth so I don't think my problem has got anything to do with the hardware or the file.
Solution
OTHER TIPS
I am using like this to play ts in Ubuntu. gst-launch-1.0 souphttpsrc location=http://xxx.xxx.x.xx/location/test.ts ! tsdemux name=d d.video_0324 ! queue ! h264parse ! avdec_h264 ! videoconvert ! videoscale ! ximagesink.
FYI, if playbin is working, you can generate xdot grapfile by setting GST_DEBUG_DUMP_DOT_DIR var. Then analyse the xdot and find the solution.