zotz
Posts: 2
Joined: Sat Jan 25, 2020 8:05 pm

omxplayer called from timeout having problems

Sat Jan 25, 2020 10:17 pm

I am trying to do something like this in a loop inside a bash script:

/usr/bin/timeout ${vidtimes[$name]} /usr/bin/omxplayer -b -o hdmi $mediaa

where ${vidtimes[$name]} represents the length of the video with up to one whole second added to get to an integer

and where $mediaa is the mp4 file to be played.

I get black screens instead of the videos.

if I just do:

/usr/bin/omxplayer -b -o hdmi $mediaa

things work fine as long as omxplayer "likes" the file. If not, it can sometimes hang "forever"...

The timeout is an attempt to stop the forever hanging.

Any thoughts on fixing this? Is there something why it will not work and I just need to give this approach with timeout up? If so, can you think of another way?

all the best,

drew

jehutting
Posts: 143
Joined: Sun Feb 15, 2015 8:37 am
Location: The Netherlands

Re: omxplayer called from timeout having problems

Sat Feb 01, 2020 8:57 am

things work fine as long as omxplayer "likes" the file. If not, it can sometimes hang "forever"...
Use omxplayer option -g for getting an "omxplayer.log" file. Maybe that reveals why omxplayer doesn't like the file.
Posting your script helps too...

Return to “Troubleshooting”