OpenSceneGraph Forum Forum Index OpenSceneGraph Forum
Official forum which mirrors the existent OSG mailing lists. Messages posted here are forwarded to the mailing list and vice versa.
 
   FAQFAQ    SearchSearch    MemberlistMemberlist    RulesRules    UsergroupsUsergroups    RegisterRegister 
 Mail2Forum SettingsMail2Forum Settings  ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
   AlbumAlbum  OpenSceneGraph IRC ChatOpenSceneGraph IRC Chat   SmartFeedSmartFeed 

ffmpeg plugin halting during playback of some videos


 
Post new topic   Reply to topic    OpenSceneGraph Forum Forum Index -> Plugins [osgPlugins]
View previous topic :: View next topic  
Author Message
tlareywi
User


Joined: 12 Mar 2011
Posts: 24
Location: Seattle

PostPosted: Thu Nov 20, 2014 10:55 pm    Post subject:
ffmpeg plugin halting during playback of some videos
Reply with quote

Hi all,

We've been finding some problems with playback of a set of videos. The issue is reproducible using osgMovie but only when --audio is enabled. A particular video will freeze at the same moment on every playback instance (although different videos will freeze in different places). We haven't been able to find a pattern to the bitrates or encoding of videos that fail. All our testing has been using videos on a local drive. In all cases, the videos play fine via 'avplay', which also uses SDL as the audio sink.

I'm not familiar with the ffmpeg libs or video/audio decoding in general, but I spent some time debugging the issue. The behavior I'm seeing when the problem reproduces is the video packet buffer becomes full. It appears that as the frame processing loop is spending time trying to insert video frames into a full queue, the audio queue quickly empties and audio begins to stutter. For a reason I wasn't able to determine, this situation degrades further and video packet processing halts with the video queue still full. My intuition was that a race condition is developing so I played around with the timing of threads and locks to no avail. Eventually, I had to move onto other tasks.

The only workaround I was able to find was simply increasing both the video and audio packet queue sizes by a couple orders of magnitude. This is certainly not a robust fix though since it likely just hides the problem and pushes it to a later time in a video.

I was able to get permission to distribute one of the videos that causes the problem. The audio stuttering reliably begins around 1:05 and video halts a few seconds later (same timing on several machines). It's too large to attach but can be downloaded at http://digitaliseducation.com/random/badblast.mp4

Relevant versions used ...

OSG 3.2.1
Ubuntu 14.04
libavcodec.so.54.35.0
libSDL-1.2.so.0.11.4

Cheers,
Trystan
Back to top
View user's profile Send private message Visit poster's website
tlareywi
User


Joined: 12 Mar 2011
Posts: 24
Location: Seattle

PostPosted: Wed Nov 26, 2014 6:05 pm    Post subject:
Bug bounty
Reply with quote

As this issue effects a large number of videos and is important functionality for us, we're willing to pay someone for a fix. If interested, please contact
Only registered users can see emails on this board!
Get registred or enter the forums!
.

Thanks,
Trystan
Back to top
View user's profile Send private message Visit poster's website
tlareywi
User


Joined: 12 Mar 2011
Posts: 24
Location: Seattle

PostPosted: Wed Apr 08, 2015 9:09 pm    Post subject:
FFmpeg plugin rewrite
Reply with quote

Hi all,

We ended up with a complete rewrite of the ffmpeg plugin that we've found to provide much more stable and reliable playback compared to the bundled one on the 3.2.x line. The developer hired believed a complete rework was the most expedient path to fix the various issues we encountered.

I haven't been following the most recent posts on work on the existing plugin (looks like there has been some), but ours may be worth some review. All the code is licensed under the standard OSG license.

https://bitbucket.org/digitalis/osg-ffmpeg-plugin/overview


-Trystan
Back to top
View user's profile Send private message Visit poster's website
cbuchner1
Appreciator


Joined: 14 Mar 2012
Posts: 307

PostPosted: Thu Apr 09, 2015 8:59 am    Post subject:
ffmpeg plugin halting during playback of some videos
Reply with quote

A highly interesting contribution, for sure. Maybe it solves some of the problems I've been having with the existing FFMPEG plug-in.


Thank you for placing it under the OSG license.


Christian



2015-04-08 23:09 GMT+02:00 Trystan Larey-Williams < (
Only registered users can see emails on this board!
Get registred or enter the forums!
)>:
Quote:
Hi all,

We ended up with a complete rewrite of the ffmpeg plugin that we've found to provide much more stable and reliable playback compared to the bundled one on the 3.2.x line. The developer hired believed a complete rework was the most expedient path to fix the various issues we encountered.

I haven't been following the most recent posts on work on the existing plugin (looks like there has been some), but ours may be worth some review. All the code is licensed under the standard OSG license.

https://bitbucket.org/digitalis/osg-ffmpeg-plugin/overview


-Trystan

------------------
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=63298#63298





_______________________________________________
osg-users mailing list
(
Only registered users can see emails on this board!
Get registred or enter the forums!
)
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


------------------
Post generated by Mail2Forum
Back to top
View user's profile Send private message
webmaster
Guest





PostPosted: Thu Apr 09, 2015 1:04 pm    Post subject:
ffmpeg plugin halting during playback of some videos
Reply with quote

hi Trystan, Great work!
When i have more time, will test the new ffmpeg for osg plugin,and feed back.
zhuwan
04,09,2015
Quote:
> -----原始邮件-----
Quote:
发件人: "Trystan Larey-Williams" <>
发送时间: 2015-4-9 5:09:27
收件人:
抄送:
主题: Re: [osgPlugins] ffmpeg plugin halting during playback of some videos

Hi all,

We ended up with a complete rewrite of the ffmpeg plugin that we've found to provide much more stable and reliable playback compared to the bundled one on the 3.2.x line. The developer hired believed a complete rework was the most expedient path to fix the various issues we encountered.

I haven't been following the most recent posts on work on the existing plugin (looks like there has been some), but ours may be worth some review. All the code is licensed under the standard OSG license.

https://bitbucket.org/digitalis/osg-ffmpeg-plugin/overview


-Trystan

------------------
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=63298#63298








------------------
Post generated by Mail2Forum
Back to top
scrawl
Appreciator


Joined: 14 Dec 2014
Posts: 171

PostPosted: Thu Apr 09, 2015 9:01 pm    Post subject:
Reply with quote

Thanks for sharing your changes Trystan! Always good to have more choices with regards to video plugins. FWIW, I have another very stable FFmpeg plugin here: https://github.com/scrawl/ogre-ffmpeg-videoplayer
It's currently using Ogre for rendering rather than OSG, but should be really easy to port. I will be porting it to OSG when I'm done with porting the rest of my engine.

Cheers,
Jannik
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    OpenSceneGraph Forum Forum Index -> Plugins [osgPlugins] All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You cannot download files in this forum

Similar Topics
Topic Author Forum Replies Posted
No new posts Adding WOFF extension to freetype plugin robertosfield Submission 0 Mon Jul 17, 2017 3:48 pm View latest post
No new posts osg plugin couldn't load an osgb or i... first_gle General 2 Sat May 27, 2017 3:52 am View latest post
No new posts PLY Plugin uwew Submission 0 Sat Apr 08, 2017 6:26 am View latest post
No new posts Guidance on zip-plugin fix SMesserschmidt General 0 Thu Feb 16, 2017 1:59 pm View latest post
No new posts PNG plugin loaded / unloaded Steal General 3 Sun Feb 05, 2017 6:30 pm View latest post


Board Security Anti Bot Question MOD - phpBB MOD against Spam Bots
Powered by phpBB © 2001, 2005 phpBB Group
Protected by Anti-Spam ACP