Re: [cgkit-user] using cgkit wrappers to ffmpeg
Brought to you by:
mbaas
|
From: Jonathan P. <jon...@gm...> - 2013-01-18 18:10:54
|
On 09/01/2013 23:11, Matthias Baas wrote:
> Hi Jonathan,
>
> On 08.01.13 11:08, Jonathan Peirce wrote:
>> So... I've built libavformat, libavcodec, ffmpeg etc. and these seem to
>> be found/imported successfully by cgkit.ffmpeg but when I try to load my
>> movie file I'm getting an erroneous error message about the file not
>> being found:
>>
>> >>> from ffmpeg import findlib, avformat #I've dragged your ffmpeg to a
>> separate loc
>> >>> print os.path.isfile('jwpIntro.mov')
>> True
>> >>> ff = avformat.av_open_input_file('jwpIntro.mov')
>> Traceback (most recent call last):
>> File "/Users/jwp/Desktop/cgKit_ffmpeg.py", line 7, in <module>
>> ff = avformat.av_open_input_file('jwpIntro.mov')
>> File "/Users/jwp/code/ffmpeg/avformat.py", line 142, in
>> av_open_input_file
>> raise AVFormatError(ret)
>> ffmpeg.avformat.AVFormatError: No such file or directory
>>
>> I'm a bit stumped about how to debug this further. Any idea what would
>> cause the message?
> First of all, those ffmpeg wrappers are quite experimental at this stage
> and for the next release I have actually removed them from the docs and
> the changelog.
> The wrappers were built against a particular version of ffmpeg (I
> believe it was 0.7 which I got from MacPorts) and currently, they won't
> work with 1.0, for example.
>
> So, the first thing to check is the version of ffmpeg you have
> installed. You can actually use the bindings to query the version. Every
> module has a function such as avcodec_version() which will return the
> version as reported by the dynamic library. In ffmpeg.cppdefs you will
> find the version numbers of the ffmpeg libs that the wrappers were built
> against (LIBAVCODEC_VERSION_MAJOR|MINOR|MACRO, etc.).
> I don't actually know what the policy of the ffmpeg guys is concerning
> version numbers, but I guess once the major version number gets
> increased there is probably some API change which will break any wrappers.
>
> The wrappers probably need to be regenerated for the version you are
> using and depending on the API changes, the mediafile module (which is
> supposed to provide high-level access to audio/video files) needs to be
> updated as well.
>
> Cheers,
>
> - Matthias -
>
OK, it turns out the erroneous error message about the file not existing
was caused by me not doing av_register_all() first - just a lisleading
message in the lib. My ffmpeg is v0.8.5 and seems to work on the few
things I've tried. So your wrapping work has definitely been useful -
there are lots of half-baked or non-working ffmpeg wrappers around ;-)
And mediafile is also useful for me. Converting frames into numpy/PIL
was the next job I was going to have to do - looks like I won't have to :-)
thanks
Jon
--
Jonathan Peirce
Nottingham Visual Neuroscience
http://www.peirce.org.uk/
|