liboggplay playback performance
I made a tweak to tinyvid.tv yesterday to transcode youtube high definition videos if the HD version is available. This results in bigger videos and therefore stresses the performance of the video implementation in Firefox.
I'm not tweaking any parameters when transcoding so it's possible that I could produce a Theora file with better playback characteristics. In particular I don't have the bandwidth to stream a file of this size. Instead I have to wait until a large portion is downloaded before playing it back. But even then playback performance is terrible.
With the file fully buffered on my dual core multi-gigabyte, multi-gigahertz laptop the sound stutters and the playback is slow. Not a great experience.
I tried playback of the ogg file with the example player from liboggplay. The playback performance is exactly the same as within Firefox. No surprise there since I use liboggplay in the implementation.
It's not a limitation with libtheora as the playback using libtheora's example player is very good. Low CPU usage, full framerate, great sound. So it looks to me like it's either a liboggplay issue, or an issue with the way I'm using liboggplay. I've raised a trac ticket with the liboggplay developers to see if they can offer any advice.
I've also raised bug 474540 in the Mozilla bugtracking system to track the fix to apply for Firefox.
Non-HD videos play fine for me, it's when they get to about 720p that things fall apart. The fact that libtheora plays these well makes me confident that we can get the performance for these files much much better.
Categories: firefox, video, theora
I'm not tweaking any parameters when transcoding so it's possible that I could produce a Theora file with better playback characteristics. In particular I don't have the bandwidth to stream a file of this size. Instead I have to wait until a large portion is downloaded before playing it back. But even then playback performance is terrible.
With the file fully buffered on my dual core multi-gigabyte, multi-gigahertz laptop the sound stutters and the playback is slow. Not a great experience.
I tried playback of the ogg file with the example player from liboggplay. The playback performance is exactly the same as within Firefox. No surprise there since I use liboggplay in the implementation.
It's not a limitation with libtheora as the playback using libtheora's example player is very good. Low CPU usage, full framerate, great sound. So it looks to me like it's either a liboggplay issue, or an issue with the way I'm using liboggplay. I've raised a trac ticket with the liboggplay developers to see if they can offer any advice.
I've also raised bug 474540 in the Mozilla bugtracking system to track the fix to apply for Firefox.
Non-HD videos play fine for me, it's when they get to about 720p that things fall apart. The fact that libtheora plays these well makes me confident that we can get the performance for these files much much better.
Categories: firefox, video, theora
Labels: mozilla

7 Comments:
Would getting a shark profile of the two situations help identify what the culprit is?
Is it just the YUV->RGB conversion that's killing you? That's (particularly if not super-optimised, and I don't think the liboggplay stuff is) really slow. For HD resolutions, it wouldn't surprise me at all to find out that it's slower than the actual theora decoding.
Generally Real Video Players that can do smooth HD playback let the video hardware do that conversion (even if they don't use the video hardware to accelerate decode).
I don't know how much liboggplay changed since the last time I was discussing it with Shane in 2007... If I remember correctly, liboggplay was supposed to decode the Video "just in time". If it's still the case, I suspect that the Theora keyframes might be taking longer to decode than the normal one, so even if it's fast enough to decode "on average", it stumbles on every keyframe. If that's the case, it could be easily fixed by buffering a few seconds of decoded data. I guess a good test would be to look at the CPU load. If it's (e.g.) YUV->RBG conversion, you should see the CPU maxed out at 100%, but it's it's keyframe-related, you should see that it's not fully used.
Sorry if this is a silly question, but is this code that's on the branch (i.e. destined for FF 3.1) or on the trunk?
caspy7, it's on both trunk and the ff 3.1 branch.
Hello, I don't know where should land this question so... I do this here.
Is it already possible to change de player widget, replace it, control if it should be visible or not ?
I converted an audio file with ffmpeg2theora tried to get it played inside firefox 3.1b2 with an audio element but this doesn't work, the video element works fine, but takes too much space in the page.
the display/visibility styles don't work.
regards, thank you for your valuable time ;)
You can use the JavaScript API to create your own controls. For example see radio new zealand's media player which they use for their Ogg Vorbis archives. It uses the audio element.
Post a Comment
<< Home