[Ffmpeg-devel] Decoding images (jpeg) from an url

Joshua Varner jlvarner
Thu Sep 29 17:22:30 CEST 2005


On 9/21/05, Michel Bardiaux <mbardiaux at mediaxim.be> wrote:
> Stefan Lucke wrote:
> > On Dienstag, 20. September 2005 10:43, Michel Bardiaux wrote:
> >
> >>Stefan Lucke wrote:
> >>
> >>>On Montag, 19. September 2005 15:00, Michel Bardiaux wrote:
> >>>
> >>>
> >>>>Stefan Lucke wrote:
> >
> >
> >>>>>FfmpegIO: url(http://w.x.y.z:9001/disk/photo/O2385(1536x1024,0).jpg) is NOT playable (nil) (rc = -6)
> >>>>>
> >>>>>It works fine for mp3 urls and with stuttering audio and video for vdr files.
> >>>>>FfmpegIO: url(http://w.x.y.z:9001/disk/music/O562.mp3) is playable 0x87a51c0 (rc = 0)
> >>>>>FfmpegIO: url(http://w.x.y.z:9001/disk/video/O4712.vdr) is playable 0x8720de0 (rc = 0)
> >>>>>
> >>>>>Would be nice if some could give me a hint how to proceed.
> >>>>>
> >>>>>
> >>>>
> >>>>Since we cat access the URLs in question, and anyway the program as
> >>>>published is incomplete, I can only suggest you look in the source the
> >>>>reasons why av_open_input_file can return -6.
> >>>>
> >>>
> >>>
> >>>I think its the same as I get when calling ffmpeg:
> >>>stefan at jarada:~> ffmpeg -i 'http://w.x.y.z:9001/disk/photo/O2385(1536x1024,0).jpg' x.yuv
> >>>ffmpeg version CVS, build 3276800, Copyright (c) 2000-2004 Fabrice Bellard
> >>>  configuration:  --enable-shared --enable-pp --enable-shared-pp --enable-gpl --enable-a52
> >>>  built on Sep 17 2005 13:23:03, gcc: 3.3.1 (SuSE Linux)
> >>>http://w.x.y.z:9001/disk/photo/O2385(1536x1024,0).jpg: Unknown format
> >>
> >>Good idea. Now we know your software is probably not to blame.
> >>
> >>
> >>>(real ip adresses replaced).
> >>>
> >>
> >>What happens if you try with some JPEG on the web at some URL anyone can
> >>access? (I could try that myself but you wisely asked for *hints*...)
> >
> >
> > stefan at jarada:~> ffmpeg -i 'http://softdevice.berlios.de/vdr-1.3.7-vidix-radeon-alpha-screenshot-small.jpg' x.yuv
> > ffmpeg version CVS, build 3276800, Copyright (c) 2000-2004 Fabrice Bellard
> >   configuration:  --enable-shared --enable-pp --enable-shared-pp --enable-gpl --enable-a52
> >   built on Sep 17 2005 13:23:03, gcc: 3.3.1 (SuSE Linux)
> > http://softdevice.berlios.de/vdr-1.3.7-vidix-radeon-alpha-screenshot-small.jpg: Unknown format
> >
> > stefan at jarada:~> ffmpeg -i 'http://softdevice.berlios.de/vdr-1.3.7-xv-screenshot-small.png' x.yuv
> > ffmpeg version CVS, build 3276800, Copyright (c) 2000-2004 Fabrice Bellard
> >   configuration:  --enable-shared --enable-pp --enable-shared-pp --enable-gpl --enable-a52
> >   built on Sep 17 2005 13:23:03, gcc: 3.3.1 (SuSE Linux)
> > http://softdevice.berlios.de/vdr-1.3.7-xv-screenshot-small.png: Unknown format
> >
> > As that shows the same return code for different picture formats, I'll
> > guess there is something wrong in my expectation that av_open_input_file()
> > could be used as a generic approach for guessing required codec for a given
> > input source.
> >
> AAMOF you get the same 'Unknown format' with a plain .jpg file:
>
> ffmpeg -i s000.jpg
> ffmpeg version CVS, build 3276800, Copyright (c) 2000-2004 Fabrice Bellard
>    configuration:  --enable-mp3lame --disable-strip --enable-amr_nb
> --enable-a52 --enable-gpl --enable-amr_wb --disable-shared
>    built on Sep 21 2005 09:53:05, gcc: 2.95.4 20011002 (Debian prerelease)
> s000.jpg: Unknown format
>
> Seems the part of libavformat that should grok the format from the
> extension is completely broken now. Even b0rken :-) Even worse:
>
> ffmpeg -img jpeg -i s000.jpg
> ffmpeg version CVS, build 3276800, Copyright (c) 2000-2004 Fabrice Bellard
>    configuration:  --enable-mp3lame --disable-strip --enable-amr_nb
> --enable-a52 --enable-gpl --enable-amr_wb --disable-shared
>    built on Sep 21 2005 09:53:05, gcc: 2.95.4 20011002 (Debian prerelease)
> Unknown image format: 'jpeg'
>
> And no wonder: in libavformat/allformats.c, a lot of image formats are
> under 'if 0'. This does not look good.
>
> At this point, there is no reason to trust the doc more than the source,
> so I need help from all the people who have recently contributed to the
> handling of single-images: give me rules or examples of commands that
> *should* work, and should be added to regression.sh (which does not seem
> to test jpeg decoding, which is probably why this was not detected)
>

About 8 months ago I wrote a wrapper library for ffmpeg, and it could
originally detect the image type for .jpg. When img2 became the
default, this stopped working and I had to specify img2 to get this to
work. Add -f img2 (That may be wrong, I just changed jobs, so I don't
have access to the code anymore), to the ffmpeg command line and
it should work. In the program if you specify the format as img2 (again
no access to the code so I don't remember how I did that) it works fine
on single images.

Josh





More information about the ffmpeg-devel mailing list