[FFmpeg-devel] how to convert MJPEG stream to FLV for ffserver

Soho Soho123 soho123.2012 at gmail.com
Wed Jun 15 14:13:49 CEST 2011

Hi all,

Does anyone have idea about:
/dev/video0 is input device, codec is MJPEG, and we would like to
output .flv stream by ffserver.
in ffserver config :
<Stream test.flv>
Feed feed1.ffm
Format flv
VideoFrameRate 30
VideoSize 640x480
VideoBitRate 256
VideoBufferSize 400
VideoGopSize 3

in ffmpeg command :
ffmpeg -f video4linux2 -vcodec mjpeg -r 30 -s 640x480 -i /dev/video0

we see the output by ffmpeg:
[video4linux2 @ 0x6f4c70]Estimating duration from bitrate, this may be
Input #0, video4linux2, from '/dev/video0':
  Duration: N/A, start: 1308168391.590000, bitrate: 0 kb/s
    Stream #0.0: Video: mjpeg, yuvj422p, 640x480, 0 kb/s, 30 tbr,
1000k tbn, 30 tbc
Wed Jun 15 20:06:31 2011 - - [GET] "/feed1.ffm HTTP/1.1" 200 4149
Output #0, ffm, to 'http://localhost:8090/feed1.ffm':
    encoder         : Lavf52.64.2
    Stream #0.0: Video: flv, yuv420p, 640x480, q=2-31, 256 kb/s, 1000k
tbn, 30 tbc
Stream mapping:
  Stream #0.0 -> #0.0
Press [q] to stop encoding
the error is :
Codec for stream 0 does not use global headers but container format
requires global headers

then we can not see the image from flv media player smoothly.

Any idea?



More information about the ffmpeg-devel mailing list