Opened 12 years ago

Closed 12 years ago

#610 closed defect (fixed)

ffserver bug

Reported by: burek Owned by: Michael Niedermayer
Priority: normal Component: ffmpeg
Version: git-master Keywords:
Cc: Blocked By:
Blocking: Reproduced by developer: no
Analyzed by developer: no

Description

Command:

ffmpeg -y -re \
        -f video4linux2 -r 30 -s qvga -i /dev/v4l/by-id/usb-046d_0809_03A981AD-video-index0 \
        -f alsa -ar 44100 -ac 1 -i default:CARD=U0x46d0x809 \
        http://localhost:8090/feed1.ffm

ffserver.conf

Port 8090
BindAddress 0.0.0.0
MaxHTTPConnections 6
MaxClients 3
MaxBandwidth 10000
CustomLog /etc/ffserver.log
NoDaemon

<Feed feed1.ffm>
	File /tmp/feed1.ffm
	FileMaxSize 10M
	ACL allow 127.0.0.1
</Feed>

<Stream 79-1.flv>
	Feed feed1.ffm
	Format flv

	VideoCodec libx264
	VideoFrameRate 25
	VideoBitRate 512
	VideoSize qvga
	#AVOptionVideo flags +global_header
	#VideoGopSize 12
	#AVPresetVideo fast
	#AVProfileVideo high
	#AVOptionVideo flags +global_header
	#VideoGopSize 15
	StartSendOnKey

	AudioCodec aac
	AudioChannels 1
	AudioBitRate 128
	AudioSampleRate 44100
	#AVOptionAudio flags +global_header
</Stream>

<Stream stat.html>
	Format status
	ACL allow localhost
</Stream>

Output:

ffmpeg version N-34408-gb3f4ff2, Copyright (c) 2000-2011 the FFmpeg developers
  built on Nov  3 2011 21:32:47 with gcc 4.6.1
  configuration: --enable-static --enable-shared --enable-gpl --enable-nonfree --enable-postproc --enable-libx264 --enable-libaacplus
  libavutil    51. 23. 0 / 51. 23. 0
  libavcodec   53. 27. 0 / 53. 27. 0
  libavformat  53. 18. 0 / 53. 18. 0
  libavdevice  53.  4. 0 / 53.  4. 0
  libavfilter   2. 45. 3 /  2. 45. 3
  libswscale    2.  1. 0 /  2.  1. 0
  libpostproc  51.  2. 0 / 51.  2. 0
[video4linux2,v4l2 @ 0x11da980] Estimating duration from bitrate, this may be inaccurate
Input #0, video4linux2,v4l2, from '/dev/v4l/by-id/usb-046d_0809_03A981AD-video-index0':
  Duration: N/A, start: 15075.495101, bitrate: 36864 kb/s
    Stream #0:0: Video: rawvideo (YUY2 / 0x32595559), yuyv422, 320x240, 36864 kb/s, 30 tbr, 1000k tbn, 30 tbc
[alsa @ 0x11db9c0] Estimating duration from bitrate, this may be inaccurate
Input #1, alsa, from 'default:CARD=U0x46d0x809':
  Duration: N/A, start: 1320356381.207796, bitrate: N/A
    Stream #1:0: Audio: pcm_s16le, 44100 Hz, 1 channels, s16, 705 kb/s
[buffer @ 0x11d6520] w:320 h:240 pixfmt:yuyv422 tb:1/1000000 sar:0/1 sws_param:
[buffersink @ 0x12239e0] auto-inserting filter 'auto-inserted scale 0' between the filter 'src' and the filter 'out'
[scale @ 0x1222480] w:320 h:240 fmt:yuyv422 -> w:320 h:240 fmt:yuv420p flags:0x4
[mp2 @ 0x11d9c20] codec type or id mismatches
Output #0, ffm, to 'http://localhost:8090/feed1.ffm':
    Stream #0:0: Audio: aac, 44100 Hz, 1 channels, s16, 128 kb/s
    Stream #0:1: Video: h264, yuv420p, 320x240, q=2-31, 512 kb/s, 1000k tbn, 30 tbc
Stream mapping:
  Stream #1.0 -> #0.0 (pcm_s16le -> mp2)
  Stream #0.0 -> #0.1 (rawvideo -> mpeg1video)
Error while opening encoder for output stream #0.0 - maybe incorrect parameters such as bit_rate, rate, width or height

What do "mp2" and "mpeg1video" have got to do with my config at all?

Change History (8)

comment:1 by Miroslav Slugeň, 12 years ago

If you use libx264 you have to define profile.

comment:2 by Miroslav Slugeň, 12 years ago

Can you test this configuration?

<Stream video1.flv>
    Feed feed1.ffm
    Format flv
    AVOptionVideo flags +global_header
    AVOptionAudio flags +global_header
    AudioCodec libmp3lame
    AudioBitRate 32
    AudioChannels 1
    AudioSampleRate 11025
    VideoCodec libx264
    VideoSize 720x576
    VideoBitRate 1500K
    VideoFrameRate 25
    AVOptionVideo threads 4
    AVOptionVideo qmin 10
    AVOptionVideo qmax 51
    AVOptionVideo qdiff 4
    AVOptionVideo g 250
    AVOptionVideo keyint_min 25
    AVOptionVideo sc_threshold 40
    AVOptionVideo coder 0
    AVOptionVideo bf 0
    AVOptionVideo b_strategy 1
    AVOptionVideo refs 1
    AVOptionVideo flags +loop
    AVOptionVideo flags2 -bpyramid-wpred-dct8x8+mixed_refs+fastpskip
    AVOptionVideo i_qfactor 0.71
    AVOptionVideo qcomp 0.6
    AVOptionVideo partitions -parti8x8-partp4x4+parti4x4+partp8x8+partb8x8
    AVOptionVideo me_method hex
    AVOptionVideo me_range 16
    AVOptionVideo subq 6
    AVOptionVideo trellis 0
    AVOptionVideo wpredp 0
    VideoGopSize 50
    Preroll 4
    StartSendOnKey
</Stream>
Last edited 12 years ago by Miroslav Slugeň (previous) (diff)

comment:3 by burek, 12 years ago

Here are the results with that config:

# ffmpeg -y -re \
        -f video4linux2 -r 30 -s qvga -i /dev/v4l/by-id/usb-046d_0809_03A981AD-video-index0 \
        -f alsa -ar 44100 -ac 1 -i default:CARD=U0x46d0x809 \
        http://localhost:8090/feed1.ffm

ffmpeg version N-34408-gb3f4ff2, Copyright (c) 2000-2011 the FFmpeg developers
  built on Nov  3 2011 23:06:27 with gcc 4.6.1
  configuration: --enable-static --enable-shared --enable-gpl --enable-nonfree --enable-postproc --enable-libx264 --enable-libaacplus --enable-libmp3lame
  libavutil    51. 23. 0 / 51. 23. 0
  libavcodec   53. 27. 0 / 53. 27. 0
  libavformat  53. 18. 0 / 53. 18. 0
  libavdevice  53.  4. 0 / 53.  4. 0
  libavfilter   2. 45. 3 /  2. 45. 3
  libswscale    2.  1. 0 /  2.  1. 0
  libpostproc  51.  2. 0 / 51.  2. 0
[video4linux2,v4l2 @ 0x20ac980] Estimating duration from bitrate, this may be inaccurate
Input #0, video4linux2,v4l2, from '/dev/v4l/by-id/usb-046d_0809_03A981AD-video-index0':
  Duration: N/A, start: 161513.508117, bitrate: 36864 kb/s
    Stream #0:0: Video: rawvideo (YUY2 / 0x32595559), yuyv422, 320x240, 36864 kb/s, 30 tbr, 1000k tbn, 30 tbc
[alsa @ 0x20ad9c0] Estimating duration from bitrate, this may be inaccurate
Input #1, alsa, from 'default:CARD=U0x46d0x809':
  Duration: N/A, start: 1320502819.560819, bitrate: N/A
    Stream #1:0: Audio: pcm_s16le, 44100 Hz, 1 channels, s16, 705 kb/s
[NULL @ 0x20abc20] Requested sampling rate unsupported using closest supported (16000)
[buffer @ 0x20a8520] w:320 h:240 pixfmt:yuyv422 tb:1/1000000 sar:0/1 sws_param:
[scale @ 0x20f4120] w:320 h:240 fmt:yuyv422 -> w:720 h:576 fmt:yuv420p flags:0x4
[mp2 @ 0x20abc20] codec type or id mismatches
Output #0, ffm, to 'http://localhost:8090/feed1.ffm':
    Stream #0:0: Audio: mp3, 16000 Hz, 1 channels, s16, 32 kb/s
    Stream #0:1: Video: h264, yuv420p, 720x576, q=10-51, 1500 kb/s, 1000k tbn, 30 tbc
Stream mapping:
  Stream #1.0 -> #0.0 (pcm_s16le -> mp2)
  Stream #0.0 -> #0.1 (rawvideo -> mpeg1video)
Error while opening encoder for output stream #0.0 - maybe incorrect parameters such as bit_rate, rate, width or height

comment:4 by burek, 12 years ago

Do you need any more tests for this?
I've been trying various ffserver.conf, but it seems that ffmpeg always returns to some "default" values, being mp2 for audio and mpeg1video for video..

comment:5 by Michael Niedermayer, 12 years ago

it might work if you add -vcodec libx264 or something, this of course is not a proper solution

comment:6 by lissyx, 12 years ago

I hit the same behavior using git master branch, git describe giving n0.8-4175-g0b9a69f. Workaround suggested by michael previously works, at least I've been able to verify it with libtheora and libflv.

comment:7 by Tim Clark, 12 years ago

this mapping issue seems to be fixed now

comment:8 by Carl Eugen Hoyos, 12 years ago

Resolution: fixed
Status: newclosed

Please reopen if this is still reproducible.

Note: See TracTickets for help on using tickets.