Skip to content

Update video.c #475

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

Closed
wants to merge 1 commit into from
Closed

Update video.c #475

wants to merge 1 commit into from

Conversation

nagualcode
Copy link

Remove the timout, to avoid the application quits before the ending of some videos.
(Application used to hang before last commit, now it quits, either, the only way to watch some video files till the end is to remove timeout completely like I am suggesting now, or to incrase it, but I dont now what should be better pratice.

Remove the timout, to avoid the application quits before the ending of some videos.
(Application used to hang before last commit, now it quits, either, the only way to watch some video files till the end is to remove timeout completely like I am suggesting now, or to incrase it, but I dont now what should be better pratice.
@popcornmix
Copy link
Contributor

Can you provide a sample file that fails without this change?
How high does timeout need to be to fix the issue?
I'd be happier with a larger timeout than infinite.

@nagualcode
Copy link
Author

Hello PopcornmIX.
This is the file the problematic file for me:
https://www.dropbox.com/s/xlyaflmmij4unms/2menu.h264?dl=0

Old video.c used to hang forever with this video.
This recent commit just quits (at the exact frame it used to hang)
I have been working with a local forked version, with timeout set at 90000, without problems with many videos...
Today I had found an old thread were I was talking about this same problem, where an user suggest the -1 timeout.

So I wonder if -1 may be better choice for very long videos... I have tested videos up to 5 minutes so far...

https://www.raspberrypi.org/forums/viewtopic.php?f=38&t=79868&p=819730#p819730

Ps. Many people suggest to just use omxplayer. But Hello_video seamless transitions between a list of files is essential for a video art presentation.

Thank you!

@popcornmix
Copy link
Contributor

That timeout shouldn't be related to the duration of the video, only the amount of data queued by openmax. I think there is around 1M-2M buffered in codein (for cabac/cavlc), plus the openmax buffers (20 x 80K = 1.6M I think).
So it's the longest time it takes to decode and return ~3M of video data. I expect the codec can process around 10MB/s, so something like 300ms seems like plenty.

So, with a bit of margin for error, try with 500000. If that works for all your files, then adjust the PR and I'll be okay to accept it. Even if something goes wrong and we don't get the EOS signal, then rather than hanging forever (which the -1 will do), it will just hang for half a second.

@popcornmix
Copy link
Contributor

EDIT: ignore previous comment.
The timeout was in milliseconds rather than microseconds, so was already ten seconds. It is surprising that so much data can be buffered up, but @deborah-c has confirmed that with high resolution and very low bitrate that the amount of data buffered can take many seconds to play out.

So leave it as -1 for now. We'll deal with the issue if and when it occurs if we get videos hanging because of this.
We've talked about adding an option to video_decode component to try to limit the amount of data buffered to a sensible amount (e.g. one second), although that can be difficult to predict when the data isn't framed with timestamps.

popcornmix added a commit that referenced this pull request Apr 6, 2016
kernel: add smsc95xx packetsize module param

kernel: config: Enabled IPV6_SUBTREES
See: raspberrypi/linux#1370

kernel: reboot: Use power off rather than busy spinning when halt is requested

firmware: arm_loader: Strip comments after dtoverlay and dtparam
See: http://forum.kodi.tv/showthread.php?tid=250817&pid=2298996#pid2298996

firmware: dtoverlay: Allow aliases to be used with target-path
firmware: dtoverlay: Support disabled (__dormant__) fragments
firmware: dtoverlay: Multiple overlay instances
firmware: host_applications: Add dtmerge application
See: https://www.raspberrypi.org/forums/viewtopic.php?f=107&t=139732

firmware: clock: Make clock logging less spammy. Can be enabled by host

firmware: config: Remove unsupported config options

firmware: Fix typos in comments
See: raspberrypi/userland#299

firmware: hello_video: Remove the timout, to avoid the application quits before the ending of some videos
See: #475
popcornmix added a commit to Hexxeh/rpi-firmware that referenced this pull request Apr 6, 2016
kernel: add smsc95xx packetsize module param

kernel: config: Enabled IPV6_SUBTREES
See: raspberrypi/linux#1370

kernel: reboot: Use power off rather than busy spinning when halt is requested

firmware: arm_loader: Strip comments after dtoverlay and dtparam
See: http://forum.kodi.tv/showthread.php?tid=250817&pid=2298996#pid2298996

firmware: dtoverlay: Allow aliases to be used with target-path
firmware: dtoverlay: Support disabled (__dormant__) fragments
firmware: dtoverlay: Multiple overlay instances
firmware: host_applications: Add dtmerge application
See: https://www.raspberrypi.org/forums/viewtopic.php?f=107&t=139732

firmware: clock: Make clock logging less spammy. Can be enabled by host

firmware: config: Remove unsupported config options

firmware: Fix typos in comments
See: raspberrypi/userland#299

firmware: hello_video: Remove the timout, to avoid the application quits before the ending of some videos
See: raspberrypi/firmware#475
popcornmix added a commit to raspberrypi/userland that referenced this pull request Apr 6, 2016
@popcornmix
Copy link
Contributor

This has now been merged.

@popcornmix popcornmix closed this Apr 6, 2016
XECDesign pushed a commit to RPi-Distro/firmware that referenced this pull request May 4, 2016
kernel: add smsc95xx packetsize module param

kernel: config: Enabled IPV6_SUBTREES
See: raspberrypi/linux#1370

kernel: reboot: Use power off rather than busy spinning when halt is requested

firmware: arm_loader: Strip comments after dtoverlay and dtparam
See: http://forum.kodi.tv/showthread.php?tid=250817&pid=2298996#pid2298996

firmware: dtoverlay: Allow aliases to be used with target-path
firmware: dtoverlay: Support disabled (__dormant__) fragments
firmware: dtoverlay: Multiple overlay instances
firmware: host_applications: Add dtmerge application
See: https://www.raspberrypi.org/forums/viewtopic.php?f=107&t=139732

firmware: clock: Make clock logging less spammy. Can be enabled by host

firmware: config: Remove unsupported config options

firmware: Fix typos in comments
See: raspberrypi/userland#299

firmware: hello_video: Remove the timout, to avoid the application quits before the ending of some videos
See: raspberrypi#475
neuschaefer pushed a commit to neuschaefer/raspi-binary-firmware that referenced this pull request Feb 27, 2017
kernel: add smsc95xx packetsize module param

kernel: config: Enabled IPV6_SUBTREES
See: raspberrypi/linux#1370

kernel: reboot: Use power off rather than busy spinning when halt is requested

firmware: arm_loader: Strip comments after dtoverlay and dtparam
See: http://forum.kodi.tv/showthread.php?tid=250817&pid=2298996#pid2298996

firmware: dtoverlay: Allow aliases to be used with target-path
firmware: dtoverlay: Support disabled (__dormant__) fragments
firmware: dtoverlay: Multiple overlay instances
firmware: host_applications: Add dtmerge application
See: https://www.raspberrypi.org/forums/viewtopic.php?f=107&t=139732

firmware: clock: Make clock logging less spammy. Can be enabled by host

firmware: config: Remove unsupported config options

firmware: Fix typos in comments
See: raspberrypi/userland#299

firmware: hello_video: Remove the timout, to avoid the application quits before the ending of some videos
See: raspberrypi#475
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

Successfully merging this pull request may close these issues.

2 participants