Hi,
I’ve been trying to play videos on my jetson nano using gstreamer. Here’s the current situation:
I can play most videos using the command gst-play-1.0
However, using the totem video player doesn’t work as well with the same videos - much higher resource consumption when i run tegrastats
I am unable to play some 4k videos using gst-play-1.0
After a few hours of searching I was able to patch together a command to play these 4k videos with audio using gst-launch-1.0 (the ones that didn’t play with gst-play)
Here is the command: gst-launch-1.0 filesrc location=ko.mkv ! decodebin name=decoder decoder. ! queue ! videoconvert ! autovideosink decoder. ! queue ! audioconvert ! autoaudiosink
Now, this works for me, except one problem. For the life of me I can’t seem to be able to figure out how to add subtitles from a .srt file. Can someone please help me? Thanks.
PS: I would like to have gui as well of course, is there another video player other than totem that is better at this?
Thanks @DaneLLL , the above command gives the following error:
Redistribute latency…
Caught SIGSEGV #0 0x0000007f9996d038 in __GI___poll (fds=0x5576b847c0, nfds=548038750776, timeout=) at …/sysdeps/unix/sysv/linux/poll.c:41 #1 0x0000007f99a7ae08 in () at /usr/lib/aarch64-linux-gnu/libglib-2.0.so.0 #2 0x0000005576868d60 in ()
Spinning. Please run ‘gdb gst-launch-1.0 29579’ to continue debugging, Ctrl-C to quit, or Ctrl-\ to dump core.
Running the suggested ‘gdb gst-launch-1.0 29579’ gives another error - no such file or directory 29579.
Went through the other topic and tried to patch something together. I tried some basic combinations to try to get textoverlay in there somehow:
Does not work: gst-launch-1.0 textoverlay name=ov ! autovideosink filesrc location=ko.mkv ! decodebin3 ! videoconvert ! ov.video_sink
Works:gst-launch-1.0 filesrc location=ko.mkv ! decodebin3 ! videoconvert ! autovideosink
Does not work:gst-launch-1.0 textoverlay name=ov ! autovideosink filesrc location=ko.mkv ! decodebin3 ! videoconvert ! autovideosink
The last one does not give an error, just displays a black screen. The first one also gives no error, but no display either of any kind.
I think it has something to do with the sink, I get the following error when running that command with the file you provided:
Setting pipeline to PAUSED …
ERROR: Pipeline doesn’t want to pause.
ERROR: from element /GstPipeline:pipeline0/GstXvImageSink:xvimagesink0: Could not initialise Xv output
Additional debug info:
xvimagesink.c(1773): gst_xv_image_sink_open (): /GstPipeline:pipeline0/GstXvImageSink:xvimagesink0:
Could not open display (null)
Setting pipeline to NULL …
Freeing pipeline …
Changing xvimagesink to autovideosink did not help.
I am just not able to combine the two commands in a meaningful way and issue a separate file as a subtitle rather than something embedded within the video. I just don’t know enough about connecting these pipes. It is clear that each of the pieces work on their own.
@DaneLLL any additional thoughts here? I spent additional time trying to get this to work but no luck getting subtitles from an external file on a track on my setup.