[Comm] ffmpeg & ffserver. Потоковое видео

Дмитрий ddv на nevod.ru
Сб Фев 27 06:58:46 UTC 2010


Конфиг ffserver.conf
Port 8090
BindAddress 0.0.0.0
MaxHTTPConnections 2000
MaxClients 1000
MaxBandwidth 1000
CustomLog -
NoDaemon

<Feed feed.ffm>
File /tmp/feed.ffm
FileMaxSize 3M
ACL allow localhost
</Feed>


<Stream test.flv>
# Ранее объявленный фид
Feed feed.ffm
Format flv
VideoCodec flv
VideoFrameRate 30
VideoBufferSize 80000
VideoBitRate 200
# Качество видео от 1 до 31, 1 == отлично 31 == фи!
VideoQMin 1
VideoQMax 5
# Разрешение, везде должно быть одинаково!
VideoSize 352x288
PreRoll 1
# Если у вас есть микрофон, или вы транслируете видео со звуком, 
закомментируйте эту строчку
Noaudio
ACL allow localhost
</Stream>

# Флешка test.swf для просмотра трансляции
<Stream test.swf>
Feed feed.ffm
# Будет запускаться в Adobe Flash Player
Format swf
VideoCodec flv
VideoFrameRate 30
VideoBufferSize 50000
VideoBitRate 100
VideoQMin 1
VideoQMax 5
# Разрешение, везде должно быть одинаково!
VideoSize 352x288
PreRoll
# Если у вас есть микрофон, или вы транслируете видео со звуком, 
закомментируйте эту строчку
Noaudio
ACL allow localhost
</Stream>

<Stream stat.html>
ACL allow localhost
ACL allow 172.16.16.0 172.16.16.255
</Stream>

Запускаю ffserver
# ffserver -d -loglevel debug
FFserver version 0.5, Copyright (c) 2000-2010 Fabrice Bellard, et al.
   built on Feb  8 2010 07:12:00 with gcc 4.4.3 20100121 (ALT Linux 
4.4.3-alt1)
   configuration: --prefix=/usr --libdir=/usr/lib64 
--shlibdir=/usr/lib64 --mandir=/usr/share/man --enable-gpl 
--enable-postproc --enable-pthreads --enable-shared --enable-static 
--disable-libvorbis --enable-libfaad --disable-libfaadbin 
--disable-libfaac --enable-libxvid --enable-libx264 --enable-libmp3lame 
--enable-libgsm --enable-libdc1394 --enable-zlib --disable-mpegaudio-hp 
--enable-mmx --disable-iwmmxt --disable-memalign-hack --enable-ffserver 
--enable-ffplay --disable-gprof --disable-libdirac 
--enable-libschroedinger --enable-avfilter --disable-avisynth 
--disable-libnut --enable-libtheora --enable-version3 
--enable-libopencore-amrwb --enable-libopencore-amrnb 
--enable-hardcoded-tables --enable-runtime-cpudetect --enable-x11grab 
--enable-bzlib --disable-debug --extra-cflags='-pipe -Wall -O2 
-frename-registers -fPIC -DPIC'
All the errors with this package you should report
to ALT Linux bugzilla (https://bugzilla.altlinux.org)!
   libavutil     50. 7. 0 / 50. 7. 0
   libavcodec    52.48. 0 / 52.48. 0
   libavformat   52.47. 0 / 52.47. 0
   libavdevice   52. 2. 0 / 52. 2. 0
   libavfilter    1.17. 0 /  1.17. 0
   libswscale     0. 9. 0 /  0. 9. 0
   libpostproc   51. 2. 0 / 51. 2. 0
Sat Feb 27 11:46:06 2010 Opening file ''
Sat Feb 27 11:46:06 2010 Could not open '': -2
Sat Feb 27 11:46:06 2010 Probed with size=2048 and score=101
Sat Feb 27 11:46:06 2010 FFserver started.
Sat Feb 27 11:46:09 2010 127.0.0.1 - - New connection: GET /feed.ffm
Sat Feb 27 11:46:09 2010 Probed with size=2048 and score=101
Sat Feb 27 11:46:09 2010 127.0.0.1 - - [GET] "/feed.ffm HTTP/1.1" 200 4149
Sat Feb 27 11:46:09 2010 127.0.0.1 - - New connection: POST /feed.ffm
Sat Feb 27 11:46:09 2010 127.0.0.1 - - [POST] "/feed.ffm HTTP/1.1" 200 4096

Запускаю конвертирование видео с web-камеры
ffmpeg -r 30 -s 352x288 -f video4linux2 -i /dev/video0 
http://localhost:8090/feed.ffm
FFmpeg version 0.5, Copyright (c) 2000-2010 Fabrice Bellard, et al.
   built on Feb  8 2010 07:12:00 with gcc 4.4.3 20100121 (ALT Linux 
4.4.3-alt1)
   configuration: --prefix=/usr --libdir=/usr/lib64 
--shlibdir=/usr/lib64 --mandir=/usr/share/man --enable-gpl 
--enable-postproc --enable-pthreads --enable-shared --enable-static 
--disable-libvorbis --enable-libfaad --disable-libfaadbin 
--disable-libfaac --enable-libxvid --enable-libx264 --enable-libmp3lame 
--enable-libgsm --enable-libdc1394 --enable-zlib --disable-mpegaudio-hp 
--enable-mmx --disable-iwmmxt --disable-memalign-hack --enable-ffserver 
--enable-ffplay --disable-gprof --disable-libdirac 
--enable-libschroedinger --enable-avfilter --disable-avisynth 
--disable-libnut --enable-libtheora --enable-version3 
--enable-libopencore-amrwb --enable-libopencore-amrnb 
--enable-hardcoded-tables --enable-runtime-cpudetect --enable-x11grab 
--enable-bzlib --disable-debug --extra-cflags='-pipe -Wall -O2 
-frename-registers -fPIC -DPIC'
All the errors with this package you should report
to ALT Linux bugzilla (https://bugzilla.altlinux.org)!
   libavutil     50. 7. 0 / 50. 7. 0
   libavcodec    52.48. 0 / 52.48. 0
   libavformat   52.47. 0 / 52.47. 0
   libavdevice   52. 2. 0 / 52. 2. 0
   libavfilter    1.17. 0 /  1.17. 0
   libswscale     0. 9. 0 /  0. 9. 0
   libpostproc   51. 2. 0 / 51. 2. 0
[video4linux2 @ 0x63a3c0][3]Capabilities: 4000001
[video4linux2 @ 0x63a3c0]The V4L2 driver changed the video from 352x288 
to 320x240
[video4linux2 @ 0x63a3c0]Estimating duration from bitrate, this may be 
inaccurate
Input #0, video4linux2, from '/dev/video0':
   Duration: N/A, start: 1267253573.636925, bitrate: 36864 kb/s
     Stream #0.0: Video: rawvideo, yuyv422, 320x240, 36864 kb/s, 30 tbr, 
1000k tbn, 30 tbc
Output #0, ffm, to 'http://localhost:8090/feed.ffm':
     Stream #0.0: Video: flv, yuv420p, 352x288, q=1-5, 200 kb/s, 1000k 
tbn, 30 tbc
     Stream #0.1: Video: flv, yuv420p, 352x288, q=1-5, 100 kb/s, 1000k 
tbn, 30 tbc
Stream mapping:
   Stream #0.0 -> #0.0
   Stream #0.0 -> #0.1
Press [q] to stop encoding
[flv @ 0x6420f0]rc buffer underflow
[flv @ 0x642730]rc buffer underflow
av_interleaved_write_frame(): Error while opening file

Если же тоже самое просто в файл, то работает
# ffmpeg -r 30 -s 352x288 -f video4linux2 -i /dev/video0 /tmp/video.avi
FFmpeg version 0.5, Copyright (c) 2000-2010 Fabrice Bellard, et al.
   built on Feb  8 2010 07:12:00 with gcc 4.4.3 20100121 (ALT Linux 
4.4.3-alt1)
   configuration: --prefix=/usr --libdir=/usr/lib64 
--shlibdir=/usr/lib64 --mandir=/usr/share/man --enable-gpl 
--enable-postproc --enable-pthreads --enable-shared --enable-static 
--disable-libvorbis --enable-libfaad --disable-libfaadbin 
--disable-libfaac --enable-libxvid --enable-libx264 --enable-libmp3lame 
--enable-libgsm --enable-libdc1394 --enable-zlib --disable-mpegaudio-hp 
--enable-mmx --disable-iwmmxt --disable-memalign-hack --enable-ffserver 
--enable-ffplay --disable-gprof --disable-libdirac 
--enable-libschroedinger --enable-avfilter --disable-avisynth 
--disable-libnut --enable-libtheora --enable-version3 
--enable-libopencore-amrwb --enable-libopencore-amrnb 
--enable-hardcoded-tables --enable-runtime-cpudetect --enable-x11grab 
--enable-bzlib --disable-debug --extra-cflags='-pipe -Wall -O2 
-frename-registers -fPIC -DPIC'
All the errors with this package you should report
to ALT Linux bugzilla (https://bugzilla.altlinux.org)!
   libavutil     50. 7. 0 / 50. 7. 0
   libavcodec    52.48. 0 / 52.48. 0
   libavformat   52.47. 0 / 52.47. 0
   libavdevice   52. 2. 0 / 52. 2. 0
   libavfilter    1.17. 0 /  1.17. 0
   libswscale     0. 9. 0 /  0. 9. 0
   libpostproc   51. 2. 0 / 51. 2. 0
[video4linux2 @ 0x63a3c0][3]Capabilities: 4000001
[video4linux2 @ 0x63a3c0]The V4L2 driver changed the video from 352x288 
to 320x240
[video4linux2 @ 0x63a3c0]Estimating duration from bitrate, this may be 
inaccurate
Input #0, video4linux2, from '/dev/video0':
   Duration: N/A, start: 1267253639.349393, bitrate: 36864 kb/s
     Stream #0.0: Video: rawvideo, yuyv422, 320x240, 36864 kb/s, 30 tbr, 
1000k tbn, 30 tbc
Output #0, avi, to '/tmp/video.avi':
     Stream #0.0: Video: mpeg4, yuv420p, 320x240, q=2-31, 200 kb/s, 30 
tbn, 30 tbc
Stream mapping:
   Stream #0.0 -> #0.0
Press [q] to stop encoding
frame=  136 fps= 30 q=3.2 Lsize=     194kB time=4.53 bitrate= 350.5kbits/s
video:185kB audio:0kB global headers:0kB muxing overhead 4.747138%

Система: Sisyphus x86-64

Кто виноват: ffserver или ffmpeg?

Что ещё, кроме ffmpeg, может загнать видео в ffserver?
----------- следующая часть -----------
Было удалено вложение не в текстовом формате...
Имя     : ddv.vcf
Тип     : text/x-vcard
Размер  : 383 байтов
Описание: отсутствует
Url     : <http://lists.altlinux.org/pipermail/community/attachments/20100227/a2ca28fb/attachment.vcf>


Подробная информация о списке рассылки community