This forum uses cookies
This forum makes use of cookies to store your login information if you are registered, and your last visit if you are not. Cookies are small text documents stored on your computer; the cookies set by this forum can only be used on this website and pose no security risk. Cookies on this forum also track the specific topics you have read and when you last read them. Please confirm whether you accept or reject these cookies being set.

A cookie will be stored in your browser regardless of choice to prevent you being asked this question again. You will be able to change your cookie settings at any time using the link in the footer.

Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Python3 play video
#1
Hello , 

With raspberry pi I used to play video throw python scripts with omxplayer. As omxplayer is not working in Tinker Board I have tried VLC but I am not able to use GPU at Vlc.

My question is there is a easy way to play video throw python scripts with gpu. 

Or just with a player working with command line. The default video player at TinkerOS can be used throw command line? I can't find any doc.

Thanks
Reply
#2
(01-23-2020, 03:50 PM)soleyj Wrote: Hello , 

With raspberry pi I used to play video throw python scripts with omxplayer. As omxplayer is not working in Tinker Board I have tried VLC but I am not able to use GPU at Vlc.

My question is there is a easy way to play video throw python scripts with gpu. 

Or just with a player working with command line. The default video player at TinkerOS can be used throw command line? I can't find any doc.

Thanks

HI,

VLC is a good player, but sometimes it fails when you need hardware acceleration. That is why I prefer smplayer (which uses mpv as its engine), though I use VLC, too.

You install it like usual: sudo apt-get install smplayer.

In the terminal you can try 'mpv path_to_video.mp4' and compare it to 'vlc path_to_video.mp4'.

Using Python3 you can try:
import subprocess
...
p=subprocess.Popen([r"smplayer", path_to_video.mp4], stdout=subprocess.PIPE)
p.wait
Instead of path_to_video.mp4 in the example you can of course also use lots of other codecs, like .mp3, .webm etc.

Be careful not to overheat yout Tinker. I'm using an aluminium case that has a fan and I hardly reach more than about 60 °C.

Hope this helps.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)