-
Notifications
You must be signed in to change notification settings - Fork 332
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
White flash at the end of playback with some videos #658
Comments
Have you tried the debian package mentioned at # 508? Be sure to have a SD backup before installing it. |
Ah, I missed the link when I first read the comments in # 508. I managed to install the Debian package, but I had to create the following symlinks before the program would run: (apparently these were renamed at some point after your package creation)
I can confirm that the flash does not occur anymore. That's great, but now omxplayer is missing almost 2 years of commits (inc. ffmpeg dependency updates, alsa/dbus stuff etc). Moreover, I'm using omxplayer in a way that requires some source tweaking and I cannot get your source package to compile. To be more specific, I've implemented something similar to #538 (start-paused parameter) to minimize omxplayer video loading times by running two processes (one playing, another one pre-loading in the background and then waiting to be started via d-bus when the first one exits). I did make sure my tweaks are not the cause of the white flashes though (all tests run with original non-modified source). Is there a way to get your flash-fix changes to work with the latest sources? |
Your symbolic links are indeed necessary for Stretch whereas at the time I made the modifications (&PR) Jessie was around. The modifications are in my loop branch which I updated once as mentioned in one of the aforementioned issues. The specifc modifications can be found here. Just take the four files and do a manual compare-and-merge action. |
I merged your changes locally to the latest master version and got rid of the flash problem, but the changes introduced a new problem -- the playback can no longer be resumed if the video is paused either via keyboard or dbus. A 'p' keypress does nothing and a dbus command just times out without response. Any ideas on how to fix that? Thanks for your help. |
Ah, I noticed the pause/resume error does not happen with all videos, I'm experiencing it with the video linked in my first post. I noticed the output of
Nothing about the 16:9 aspect ratio. I'm wondering if this could be related to ffmpeg. I'll try recompiling omxplayer (inc. your changes) with the latest ffmpeg. |
No difference with ffmpeg (4.1.git [d96ae9d]), only the handler_name -field in Any thoughts on what's going on here with the pause/resume failing with some files? |
I removed the |
After some hours of testing, it seems like now omxplayer randomly doesn't always finish up in time. Apparently there are more issues to tackle with the flash fix... |
Apparently :-) Can you give more details about "it seems like now omxplayer randomly doesn't always finish up in time"? What exactly do you see (or not see)? Logging showing the issue? |
When the LockDecoder() and UnLockDecoder() lines that your fix adds are removed from the AddPacket functions in OMXPlayerAudio.cpp and OMXPlayerVideo.cpp, the resume-after-pause -problem disappears. However, when I do hours of consecutive runs of omxplayer compiled with your fix without those lines, sometimes the same video freezes on the last frame and omxplayer never exits. This seems to happen randomly, sometimes after a couple of consecutive runs, sometimes only after 15 minutes (16 sec video). When the freeze happens, the omxplayer.bin process stays alive way past the 16 second video duration with no frame changes on screen, producing log lines like this:
...and it continues forever (even though it is a 16 second video)...
..until I hit ctrl+C
Between the time when the last frame freezes and until I hit ctrl+C, the dbus interface keeps answering playback status queries normally (saying it's still playing) and only "DEBUG: Normal..." entries appear in the logfile, no COMXVideo::SubmitEOS nor OMXPlayerVideo::Decode. This random problem of omxplayer displaying the last frame and running forever does not seem to happen, if I compile omxplayer without removing the LockDecoder()/UnLockDecoder() AddPacket -lines from your fix. However, then we're back to the problem of not being able to resume after pause with some videos. Here's what happens when I run omxplayer [7f3faf6] manually merged with your fix (without my LockDecoder/UnLockDecoder removals) and pause after a few secs: ...
After this, nothing else is written in the log and nothing happens when I try to resume the playback with the keyboard or via a dbus command. I just get a timeout error: 'Error org.freedesktop.DBus.Error.NoReply: Did not receive a reply. Possible causes include: the remote application did not send a reply, the message bus security policy blocked the reply, the reply timeout expired, or the network connection was broken.' The paused frame stays on screen and the omxplayer.bin process stays alive doing apparently nothing. I have to kill it to clear the screen and make omxplayer exit. So, anyone got any ideas on what to try next? Just to reiterate: I'm trying to get the latest omxplayer version to play videos without the white flash at the end of playback that occurs with some video files (example link in first post). While jehutting's flash fix from May 2016 gets rid of the flash problem, it seems to have some incompatibilities with the latest omxplayer sources, causing resume after pause to fail with some videos. |
Thanks @zeepa for such a detailed report 👍 I had a look at the When you pause the playing, the So, don't add the About the sometimes the same video freezes on the last frame and omxplayer never exits.: |
Hmmm... without the
as a result of the Maybe the line |
Ok, thanks for taking the time to investigate. I forgot to mention that the testing was done with ffmpeg 3.3.9 (the Makefile.ffmpeg in the latest omxplayer includes '-b release/3.3' as git parameters when cloning ffmpeg). I tried ffmpeg 4.1 just once to see if the resume-after-pause -problem would go away before I noticed it was related to the LockDecoder/UnLockDecoder -issue. |
Oh boy... the Lock/Unlock add within the LockDecoder/UnlockDecoder wasn't a success either. Got troubles with seeking commands. So I tried something different, which seems to be OK (be aware that I thought that the last time too :-)). Revert the previous mods, and try with the attached patches. |
Ok, I'm gonna give it a go. While waiting for your update, I actually tried just adding Lock/Unlock around the I haven't done any seek-testing though, and moreover, my understanding of the omxplayer code is not solid enough to even figure out what the Lock & Unlock functions actually do, so I'm grateful for your patches! I just started a new test using them. Btw, did you drop the hdmi_eos/analog_eos changes in your original OMXAudio.cpp modification on purpose or should I still include them? My test is currently running without the OMXAudio.cpp mods. |
The OMXAudio.cpp mods is in my understanding of openmax better as the renderer should signal that the audio stream is fully played, and not the decoder that it has received/processed the EOS. |
Hmm, can you rephrase that? I'm afraid I don't understand the beginning of your answer 😃 Do you recommend including the original OMXAudio.cpp mods in addition to your latest two patches when compiling the latest omxplayer? After two hours of consecutive omxplayer runs with your latest patches, I've had no problems. So far so good! |
Yes, you should include the OMXAudio.cpp modifications just to be sure that OMXPlayer terminates after the audio stream has been outputted completely. As you are playing a video only file, so without audio/sound, it doesn't matter for now. |
Ok, thanks for clarifying. Some files I play have audio as well, so I'll keep the OMXAudio.cpp mod. |
After running tests for over 48h with various video and audio files, I'm happy to report that @jehutting 's OMXPlayerVideo/Audio patches (posted above) and the OMXAudio.cpp mods from May 2016 seem to fix all issues discussed. Testing done with the latest omxplayer as of Nov 9th 2018 [a70e9b4] (inc. ffmpeg 3.3.9) and the latest firmware updated with rpi-update [4.14.79]. |
@jehutting can you submit a PR with the minimal changes that you believe fixes this issue? |
As I described in #455 : The modifications presented there caused the pause/resume problem as zeepa described above. The new mods solve the flashing issue differently which seems to work well. Thanks @zeepa for testing it out! Update: |
Hi,
I noticed variations of the same problem have been reported before, many of them closed issues (#250 / #455 / #508).
However, even with the latest omxplayer (compiled from source [latest commit 7f3faf6] or apt-get install'ed from the RPI Stretch repo [20170330~134343-2]), I get a short <1sec white flash at the end of playback with a few video files. I've tried updating all packages/kernel/firmware (as of Nov 4/2018) with apt-get and I can confirm the flash occurs on Raspberry Pi B, 2B and 3B.
Here's an example of a video that produces the white flash at the end (~60MB):
https://drive.google.com/file/d/1UGz6FWUn8YZvubf0kcgVXghrLK7yWgn0/view?usp=sharing
If I --loop the file, the flash happens only once right before the video is played for the second time.
If I force deinterlacing using the --deinterlace parameter, the flash does not occur — but the video files are not interlaced, so forcing deinterlacing is redundant. Omxplayer logs of the same video file played with and without --deinterlace show COMXVideo::SubmitEOS happening slightly earlier when deinterlacing is used (and the flash does not happen).
I also noticed the flash does not happen if I set the --video_fifo value very high (e.g. 80 when the file itself is 60MB).
I'm not really fluent in c++, but if there's anything I can do (besides coding) to assist in solving the problem, let me know.
Thanks to all the devs for an otherwise sweet piece of software!
NOTE: I'm using the HDMI output and I've tested two different LG displays. Here's my config.txt:
The text was updated successfully, but these errors were encountered: