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

Soho Soho123 soho123.2012 at gmail.com
Wed Jun 15 14:15:51 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
Noaudio
</Stream>

in ffmpeg command :
ffmpeg -f video4linux2 -vcodec mjpeg -r 30 -s 640x480 -i /dev/video0
http://localhost:8090/feed1.ffm
==============================================================================

we see the output by ffmpeg:
[video4linux2 @ 0x6f4c70]Estimating duration from bitrate, this may be
inaccurate
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 127.0.0.1 - - [GET] "/feed1.ffm HTTP/1.1" 200 4149
Output #0, ffm, to 'http://localhost:8090/feed1.ffm':
 Metadata:
   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?

Thanks!

Soho


More information about the ffmpeg-user mailing list