[FFmpeg-devel] FFMPEG fails to convert .mov - "Cannot allocate temp picture"

Reimar Döffinger Reimar.Doeffinger
Mon Dec 29 09:36:21 CET 2008


On Mon, Dec 29, 2008 at 09:27:36AM +0100, Reimar D?ffinger wrote:
> On Sun, Dec 28, 2008 at 10:03:33PM +0000, Carl Eugen Hoyos wrote:
> > Baptiste Coudurier <baptiste.coudurier <at> gmail.com> writes:
> > 
> > > >> http://the13thfloor.org/4friends/tigani-mide2.mov
> > > >>
> > > >> No matter what I try or the target format I choose, it always fails
> > > >> with the same error:
> > > >>
> > >  >> [...]
> > >  >>
> > > >> [mov,mp4,m4a,3gp,3g2,mj2 @ 0x177a110]stream 0, error opening file
> > //tigani-mide.
> > > >> mov: Invalid argument
> > > 
> > > Your file is a reference file pointing to external file, however an 
> > > error occurs when opening external file. You should check the path and 
> > > access to '//tigani-mide.mov'.
> > 
> > I'm not totally convinced that this is a complete analysis, but I rather think
> > ffmpeg is missing something when reading this file (at least sound, but maybe
> > also video).
> 
> Indeed, the video plays just fine with this (obviously wrong) patch:

I think the issue is that the first half of the video is in this mov
file and the other half in the referenced one, and the demuxer can not
handle that case.
This patch also "fixes" it and should at least not really make any case
worse (it just falls back to using the "current" file if the external
reference can not be opened, and yes it is of course not a correct
implementation):

Index: libavformat/mov.c
===================================================================
--- libavformat/mov.c   (revision 16380)
+++ libavformat/mov.c   (working copy)
@@ -1362,9 +1362,11 @@
     mov_build_index(c, st);
 
     if (sc->dref_id-1 < sc->drefs_count && sc->drefs[sc->dref_id-1].path) {
-        if (url_fopen(&sc->pb, sc->drefs[sc->dref_id-1].path, URL_RDONLY) < 0)
+        if (url_fopen(&sc->pb, sc->drefs[sc->dref_id-1].path, URL_RDONLY) < 0) {
             av_log(c->fc, AV_LOG_ERROR, "stream %d, error opening file %s: %s\n",
                    st->index, sc->drefs[sc->dref_id-1].path, strerror(errno));
+            sc->pb = c->fc->pb;
+        }
     } else
         sc->pb = c->fc->pb;




More information about the ffmpeg-devel mailing list