Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Omxplayer stops whilst playing wmv files in script #61

Closed
berryinterest opened this issue Sep 29, 2012 · 5 comments
Closed

Omxplayer stops whilst playing wmv files in script #61

berryinterest opened this issue Sep 29, 2012 · 5 comments

Comments

@berryinterest
Copy link

The problem im having is a little odd! I have omxplayer running in a loop, playing video files from a folder on the raspberry, which starts at boot which displays on tv via composite. This has been working fine for over 2 weeks now without a single problem if I play avi format but if I use wmv it stops at some random place during playback.

When I check to see if omxplayer is still running, its still shows in the process list and the tv has frozen screen until I kill the process.

I get some messages in the omxplayer log which ive attached bellow.

Im using the latest version of raspbian (2012-09-18-wheezy-raspbian) all updated.

omxplayer.log

00:00:00 T:0   DEBUG: DllBcm: Using omx system library
00:00:00 T:0   DEBUG: DllOMX: Using omx system library
00:00:00 T:0   DEBUG: DllAvFormat: Using libavformat system library
00:00:00 T:0   DEBUG: DllAvUtilBase: Using libavutil system library
00:00:00 T:0   DEBUG: DllAvCodec: Using libavcodec system library
00:00:00 T:0   DEBUG: DllAvFormat: Using libavformat system library
00:00:00 T:0   DEBUG: DllOMX: Using omx system library
00:00:00 T:0   DEBUG: COMXCoreComponent::Initialize OMX.broadcom.clock input port 80 output port 81
00:00:00 T:0   DEBUG: DllAvUtilBase: Using libavutil system library
00:00:00 T:0   DEBUG: DllAvCodec: Using libavcodec system library
00:00:00 T:0   DEBUG: DllAvFormat: Using libavformat system library
00:00:00 T:0   DEBUG: DllOMX: Using omx system library
00:00:00 T:0   DEBUG: Previous line repeats 5 times.
00:00:00 T:0   DEBUG: COMXCoreComponent::Initialize OMX.broadcom.video_decode input port 130 output port 131
00:00:00 T:0   DEBUG: DllOMX: Using omx system library
00:00:00 T:0   DEBUG: COMXCoreComponent::Initialize OMX.broadcom.video_render input port 90 output port 90
00:00:00 T:0   DEBUG: DllOMX: Using omx system library
00:00:00 T:0   DEBUG: COMXCoreComponent::Initialize OMX.broadcom.video_scheduler input port 10 output port 11
00:00:00 T:0   DEBUG: DllOMX: Using omx system library
00:00:00 T:0   DEBUG: COMXCoreComponent::Initialize OMX.broadcom.text_scheduler input port 150 output port 151
00:00:00 T:0   DEBUG: COMXCoreComponent::AllocInputBuffers component(OMX.broadcom.video_decode) - port(130), nBufferCountMin(1), nBufferCountActual(60), nBufferSize(81920), nBufferAlignmen(16)
00:00:00 T:0   DEBUG: COMXCoreComponent::AllocInputBuffers component(OMX.broadcom.text_scheduler) - port(150), nBufferCountMin(1), nBufferCountActual(100), nBufferSize(1024), nBufferAlignmen(16)
00:00:00 T:0   DEBUG: COMXCoreComponent::AllocOutputBuffers component(OMX.broadcom.text_scheduler) - port(151), nBufferCountMin(1), nBufferCountActual(1), nBufferSize(1024) nBufferAlignmen(16)
00:00:00 T:0   DEBUG: COMXVideo::Open - decoder_component(0x0x17f3f40), input_port(0x82), output_port(0x83) deinterlace 0 hdmiclocksync 0
00:00:00 T:0   DEBUG: OMXThread::Create - Thread with id 1153053792 started
@berryinterest
Copy link
Author

A quick update on this problem.

I have managed to get omxplayer looping wmv files for a longer period of time by adding -s and logging output to file.

This process works ok but after some time the process stops running and omxplayer gets stuck on what looks like the last frame of the current video being looped.

I have no idea where I need to look to fix this problem and the stats output from omxplayer does not give any indication on what has happened.

I can provide the scripts I have created so someone can recreate the problem and maybe provide a fix if possible. I have two raspberry pi's which I have tested and both produce the same symptoms of locking up on the last frame and not ending.

One way to get around the problem would be the check the actual video duration against omxplayer running process time and if omxplayer runs for longer than video duration then kill omxplayer. I have no idea how to do this, but im guessing I could use ffmpeg -i to get video duration and use this in an argument to check against omxplayer process runtime... This goes beyond my level of expertise so if anyone could show me a way of doing this I would be greatly appreciated, although this wont be needed if omxplayer can be fixed.

Please let me know if you need anymore information
Thanks
Stu

@exidyboy
Copy link

Hi Stu,

I'm not a programmer but I have a strong interest in using Pi's as video players in installations and have been undertaking a lot of long term stability testing of looped video playback using various bash scripts I've found online while I learn bash scripting myself. I have had some systems looping continuously for up to 10 days.
Perhaps we can work together to gather data that will help contributors and users.
Could you post your (commented) bash script and links to your .wmv and .avi files so I can test?
It seems odd that the -s switch (pts and buffer stats) would make any difference to the system behaviour.
I'm assuming that the .wmv plays fine when not played via a bash script and plays fine via other software on other platforms?
I too have found differences in how omxplayer responds to certain (MPEG-4) files depending on whether they are played individually from the command line versus scripted in a 'playlist' and have also experienced the composite output being left in an odd state with only black burst when testing certain combinations of scripts and files. However it sounds like your video output freezes with a video frame on it ?

Cheers,

Michael

@GraspGG
Copy link

GraspGG commented Apr 2, 2014

Hi Community,

i am having a similar problem:

Omxplayer is started through a script on startup, running in a loop playing video files from a folder on the raspberry, while output is set to HDMI (-o hdmi), where a tv is connected to. Randomly it kind of stops playing during playback, usually after 1 to 1 1/2 hours when several loops already have been passed.

Looking at the processes using ssh from another place due to resolve what is happening, either script and omxplayer seem to run normally, cause omxplayer processes still keep updated (finished playback processes seem to get closed and new playback processes seem to get started like usual) but with no hdmi/tv output anymore. It looks like frozen output (kind of).

Like Stu mentioned, enabling logging (-l) within the script does delay the output freezing for somewhat around 30 minutes.

Some facts which might help to surround the causing part:
• all video files are H264/MPEG4 with AAC audio encoded
• all video files do play without problems started one by one
• the script does loop all video files several times without problems before output suddenly freezes

The playback script which is started on startup:

===== script start =====

#!/bin/bash
#Turn off cursor
setterm -cursor off
#Path to the directory containing the videos, variable
VIDEOPATH="/boot/VideoContent"
#Application playing the videos, variable
SERVICE="omxplayer"
#Playback loop, infinite
while true; do
  if ps ax | grep -v grep | grep $SERVICE > /dev/null
  then
    sleep 1;
  else
    for entry in $VIDEOPATH/*
    do
      clear
      omxplayer -o hdmi --no-osd -r -g -s --layout 2.0 $entry > /dev/null
    done
  fi
done

===== script end =====

If i only could find/catch/grab something (e.g. memory or gpu activity) to observe the output which really happens (which means no output/nothing when problem occurs), i could set a watchdog and trigger a clean reboot... that would help for now - even if it unfortunately would not remove the problem itself.

Any ideas?

Thanks in advance,
Cheers,

Olaf

@popcornmix
Copy link
Collaborator

It's worth identifying if it's just the omxplayer.bin process that has hung (i.e. you can kill it and restart it), or if it's no longer possible to run omxplayer.

Obviously keep an eye out for any errors in omxplayer.log (run with -g).
After a failure check dmesg for any errors.
Also, after killing any running omxplayers, run "sudo vcdbg reloc".
Normally that list should be quite small (it should look the same as it does after running omxplayer once and exiting). If that list gets bigger with time, and shows very little free memory when it's locked up then that would indicate a GPU memory leak.

@popcornmix
Copy link
Collaborator

Actaully, this repo is dead. Please ensure you are running latest omxplayer (http://omxplayer.sconde.net/)
and report any issues here:
https://github.com/popcornmix/omxplayer
This sounds like a duplicate of this:
popcornmix#181

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants