Broken Theora support (libavcodec)
Hi guys,
while writing this application ( http://qpsnr.youlink.org/ ) I noticed that Theora video streams are broken with current version of libavcodec library.
I opened a bug here: https://bugs.launchpad.net/ubuntu/+s...eg/+bug/522812
Apparently I have the same issue even on fresh virtualized environments.
To reproduce the issue, do the following:
1) Download http://launchpadlibrarian.net/393584...dec_sample.cpp
2) Install sudo apt-get install g++ libavcodec-dev libavformat-dev libswscale-dev
3) Compile g++ ./avcodec_sample.cpp -o av_test -O2 -g -pthread -lavformat -lavcodec -lswscale
4) Download a reference OGV http://web.mit.edu/xiphmont/Public/t...rix-300-AQ.ogv
5) Execute ./av_test ./matrix-300-AQ.ogv
Now, you should have in your directory 10 corrupted ppm images (that should be the first 10 frames of the ogv file). If instead you run ./av_test any_other_video_type you should get the first 10 frames of the video file. It does work for all other formats but for Theora streams.
Is there anyone able/willing to confirm this?
Thanks in advance,
Regards.
Re: Broken Theora support (libavcodec)
Quote:
Originally Posted by
Emanuele_Z
5) Execute ./av_test ./matrix-300-AQ.ogv
Now, you should have in your directory 10 corrupted ppm images (that should be the first 10 frames of the ogv file).
This command should yield the same result:
Code:
ffmpeg -vframes 10 -i matrix-300-AQ.ogv frame%d.ppm
As you have seen in your bug report, people may tend to dispute the validity of your code rather than the validity of libavcodec. If you can showcase the bug with a standard tool such as ffmpeg, it will be easier to convince reviewers that the bug is in fact in the library rather than in your code.
Re: Broken Theora support (libavcodec)
Quote:
Originally Posted by
VertexPusher
This command should yield the same result:
Code:
ffmpeg -vframes 10 -i matrix-300-AQ.ogv frame%d.ppm
As you have seen in your bug report, people may tend to dispute the validity of your code rather than the validity of libavcodec. If you can showcase the bug with a standard tool such as ffmpeg, it will be easier to convince reviewers that the bug is in fact in the library rather than in your code.
I see, but the point is that my code is what is recommended by the libavcodec API, plus is short and compact. And, most of all, I'm sure that with my code I'm using libavcodec dynamically plus it works 100% with all other video streams (mpeg, mpeg2, mpeg4,wmv,flv,...).
Actually, it's very simple code, just for the purpose to show the bug.
Clearly it takes less than 5 minutes to spot any bug there.
Naturally if there's an error in API usage, please do tell me.
Cheers,
Re: Broken Theora support (libavcodec)
I'm not saying that your code is wrong. But your bug report will have more impact if you make confirmation of the bug as easy as possible.
Re: Broken Theora support (libavcodec)
UPDATE:
without recompiling the test executable, but recompiling the shared objects (libav*.so) from the latest cut of ffmpeg svn source code, it does work.
Basically, once recompiled all the libav*.so.* libraries, just put them in the path of the test executable and
export LD_LIBRARY_PATH=`pwd`
Magically the executable will now properly decode Theora video streams! :-P
If changing the libraries (again without touching the executable) makes it work, am I wrong saying that the libav*.so.* libraries used in Ubuntu are broken?
Honestly this is prof that against the default libav*.so.* theora streams can't be decoded with libavcodec.
I'll post this on the bug report as well, hopefully this time it will be taken into account.
Cheers,
Re: Broken Theora support (libavcodec)
I think the reason why Reinhard is unable to confirm the bug is because he is using libavcodec52 instead of libavcodec-extra-52 (multiverse). I already mentioned this in the other thread.
I have not tested libavcodec52, but with libavcodec-extra-52 I can easily reproduce the problem with ffmpeg on the command line.
Which libavcodec package have you installed? Maybe you should add this info to the bug report as well.
Re: Broken Theora support (libavcodec)
Hi mate,
I've been able to reproduce the issue even on vanilla 9.10 i386, on a virtual machine...
Btw I do not have the libav*-extra installed neither on my main x86-64 neither on the virtualized i386.
I have installed (on both architectures):
libavcodec-dev
Really hopefully this should bring some attention.
Re: Broken Theora support (libavcodec)
Reinhard wrote ( https://bugs.launchpad.net/ubuntu/+s...eg/+bug/522812 ):
So, as seen as that file ( http://web.mit.edu/xiphmont/Public/t...rix-300-AQ.ogv ) is not broken (according to Theora devs that file is made against the finalized Theora video stream format) libavcodec and the other ffmpeg libraries (I suppose) are broken in current Ubuntu packages.
Or better, it doesn't support the finalized Theora format...
Why are you able to playback that file with other players? Because probably those players are statically linked against an updated version of libavcodec...
As I wrote over there, when are we going to support the finalized format of Theora through libavcodec in Ubuntu?
Should the fact that Theora is the open source format should catch special attention of maintainers?
Cheers,
Re: Broken Theora support (libavcodec)
The ffmpeg ver. in karmic and lucid cannot decode video encoded with the new theora - libtheora-1.1.X (has nothing to extra or not
This has been discussed on launchpad previously for karmic and there is no intention of using a newer ffmpeg version for either karmic or lucid.
( The 0.5 vs. 0.6 arg. is a bit of a mystery, the version used now is 0.5+svn20090706, there is actually no great reason why +svnXXXXXXXX can't be moved forward - while the benefit of doing that may be minimal to gstreamer apps/plugins it would be seen in vlc, mplayer, and some other apps, both in repo and ppa versions.
What you may wish to try is to build the karmic/lucid ffmpeg source off of the newer libtheora-1.1, and see if it makes a difference, don't know here as I don't use the repo supplied ffmpeg or the shared libs, (odds are it won't
(I always replace the shared once per install with newer deb packages, ffmpeg itself is updated quite often
Re: Broken Theora support (libavcodec)
Thanks for confirmation...
This makes sense, as seen as I'm able to encode/decode with a lot of software which links to libavcodec statically or use other libraries to encode/decode video.
But what you call new theora is the finalized format/bitstream.
So actually I guess that not ffmpeg, but the underlying libraries should be updated.
Cheers,