[Ffmpeg-devel] JPEG support in ffmpeg

Justin Ruggles jruggle
Wed Jul 5 02:09:29 CEST 2006


Chris Wilson wrote:
> Hello Herve and all,
> 
> On Sat, 1 Jul 2006, [ISO-8859-1] Herv? W. wrote:
> 
>>On 01/07/06, Chris Wilson <chris at qwirx.com> wrote:
>>
>>>> The manual page says "FFmpeg can use any supported file format and 
>>>> protocol as input". But this does not seem to be true:
>>>>
>>>> chris at rocio:/tmp/ffmpeg$ ./ffmpeg -i ~/photos/raw/img_5834.jpg foo.mpg
>>>> FFmpeg version CVS, Copyright (c) 2000-2004 Fabrice Bellard
>>>>  configuration:
>>>>  libavutil version: 49.0.0
>>>>  libavcodec version: 51.9.0
>>>>  libavformat version: 50.4.0
>>>>  built on Jun  8 2006 18:29:38, gcc: 4.0.2 20050808 (prerelease) (Ubuntu
>>>> 4.0.1-4ubuntu9)
>>>> /home/chris/photos/raw/img_5834.jpg: Unknown format
>>
>>I don't know if jpeg as input is supposed to be supported, but have
>>you tried forcing
>>it (possibly after applying your hack) with
>>-f fmt              force format
>>like:
>>-f image
>>or
>>-f image2
> 
> 
> Thanks for your suggestions, and sorry for the delay in replying. I get 
> (using a different version of ffmpeg, 0.4.8):
> 
> chris at gcc(raw)$ ffmpeg -i img_5834.jpg /tmp/foo.mpg
> img_5834.jpg: Unknown format
> chris at gcc(raw)$ ffmpeg -i img_5834.jpg -f image /tmp/foo.mpg
> img_5834.jpg: Unknown format
> chris at gcc(raw)$ ffmpeg -f image -i img_5834.jpg /tmp/foo.mpg
> img_5834.jpg: Incorrect image filename syntax.
> Use '%d' to specify the image number:
>    for img1.jpg, img2.jpg, ..., use 'img%d.jpg';
>    for img001.jpg, img002.jpg, ..., use 'img%03d.jpg'.
> chris at gcc(raw)$ ffmpeg -f image2 -i img_5834.jpg /tmp/foo.mpg
> Unknown input or output format: image2
> 
> I don't want to specify the images using '%d' syntax, because they don't 
> start at 0001, but perhaps I could rename them if it's the only way.

First of all, old versions of FFmpeg are not supported.  You seem to
have a version without the image2 input format.  I don't know if this
will work either, but as long as the files are in alphabetical order you
could try:

cat *.jpg > sequence.mjpeg
ffmpeg -i sequence.mjpeg video.mpg

This might rely on image2 as well, but it would at least solve the
"don't start at 0001" problem.

-Justin




More information about the ffmpeg-devel mailing list