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

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





_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

Reply via email to