maxcurzi / tplay

A terminal ASCII media player. View images, gifs, videos, webcam, YouTube, etc.. directly in the terminal as ASCII art.
MIT License
304 stars 18 forks source link

[BUG] Gstreamer warnings, errors on attempted video playback #47

Open vilmibm opened 1 month ago

vilmibm commented 1 month ago

Describe the bug

When trying to open videos on Fedora 39 (.mkv, .mp4, and youtube) I get warnings and errors.

To Reproduce Steps to reproduce the behavior:

  1. Install library dependencies
  2. Install tplay via cargo
  3. Try to play any video

Expected behavior

A video plays or an error tells me what action I might take to fix the problem.

Screenshots

$ tplay 'https://www.youtube.com/watch?v=dQw4w9WgXcQ'
[youtube] Extracting URL: https://www.youtube.com/watch?v=dQw4w9WgXcQ
[youtube] dQw4w9WgXcQ: Downloading webpage
[youtube] dQw4w9WgXcQ: Downloading ios player API JSON
[youtube] dQw4w9WgXcQ: Downloading web creator player API JSON
[youtube] dQw4w9WgXcQ: Downloading player b0557ce3
[youtube] dQw4w9WgXcQ: Downloading m3u8 information
[info] dQw4w9WgXcQ: Downloading 1 format(s): 18
[download] Destination: -
[download] 100% of    8.68MiB in 00:00:05 at 1.54MiB/s
[ WARN:0@17.021] global cap_gstreamer.cpp:2769 handleMessage OpenCV | GStreamer warning: your GStreamer installation is missing a required plugin
[ WARN:0@17.021] global cap_gstreamer.cpp:2784 handleMessage OpenCV | GStreamer warning: Embedded video playback halted; module qtdemux0 reported: Internal data stream error.
[ WARN:0@17.022] global cap_gstreamer.cpp:1679 open OpenCV | GStreamer warning: unable to start pipeline
[ WARN:0@17.022] global cap_gstreamer.cpp:1164 isPipelinePlaying OpenCV | GStreamer warning: GStreamer: pipeline have not been created
MFX: Can't initialize session
[ERROR:0@17.033] global cap.cpp:164 open VIDEOIO(CV_IMAGES): raised OpenCV exception:

OpenCV(4.8.1) /builddir/build/BUILD/opencv-4.8.1/modules/videoio/src/cap_images.cpp:253: error: (-5:Bad argument) CAP_IMAGES: can't find starting number (in the name of file): /tmp/my_temp_file_ZLfDuQ.webm in function 'icvExtractPattern'

Error: Application("Error opening video")

Desktop (please complete the following information):

Additional context

It's entirely possible/probable that this isn't a bug at all and I just need to do some more work to get this working on Fedora; I don't mind doing that work but am stuck and could use a pointer towards what I might be missing on my system. I installed equivalent packages as those listed for Ubuntu and successfully compiled and ran tplay via cargo.

I can open image files fine.

maxcurzi commented 1 month ago

It looks like a known bug https://github.com/maxcurzi/tplay/issues/19

I noticed it when briefly testing tplay on Fedora.

However back then I could still play other videos, or the same video when I downloaded it with yt-dlp but didn't have time to look into it further

I'm not sure what's going on here and why this happens in Fedora but not other distros.

Maybe I'll make some progress on it once I update dependencies as part of other PRs

vilmibm commented 1 month ago

Knowing that you also ran into issues with Fedora is a good clue; I will poke around and report back if I figure anything out.

vilmibm commented 1 month ago

fwiw, tplay /dev/video0 works perfectly fine for me and does output the same warnings about gstreamer pipelines so those warnings are probably a red herring.

maxcurzi commented 1 month ago

The plot thickens! :) I wonder if the "MFX can't initialize session" might point at the problem.

https://github.com/luxonis/depthai/issues/461

https://stackoverflow.com/questions/63814047/openvino-movidius-cant-read-ip-camera

Unfortunately I didn't paste the full log on #19 so I don't know if I had the same message