简体   繁体   English

ffmpeg 错误 MPEG-1/2 不支持 3/1 fps

[英]ffmpeg error MPEG-1/2 does not support 3/1 fps

Im trying to broadcast my desktop to web page via ffserver but Im getting this error我试图通过 ffserver 将我的桌面广播到 web 页面,但我收到此错误

MPEG-1/2 does not support 3/1 fps
Error initializing output stream 0:1 -- Error while opening encoder for output stream #0:1 - maybe incorrect parameters such as bit_rate, rate, width or height

Here is my cli这是我的cli

ffmpeg -probesize 1000M -framerate 30 -video_size 1680x1050 -f x11grab -i :0.0 -f alsa -i default -c:a aac -vf format=yuv420p http://localhost:8090/feed1.ffm

And here is whole log这是整个日志

ffmpeg -probesize 1000M -framerate 30 -video_size 1680x1050 -f x11grab -i :0.0 -f alsa -i default -c:a aac -vf format=yuv420p http://localhost:8090/feed1.ffm
ffmpeg version 3.4.8-0ubuntu0.2 Copyright (c) 2000-2020 the FFmpeg developers
  built with gcc 7 (Ubuntu 7.5.0-3ubuntu1~18.04)
  configuration: --prefix=/usr --extra-version=0ubuntu0.2 --toolchain=hardened --libdir=/usr/lib/x86_64-linux-gnu --incdir=/usr/include/x86_64-linux-gnu --enable-gpl --disable-stripping --enable-avresample --enable-avisynth --enable-gnutls --enable-ladspa --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libcdio --enable-libflite --enable-libfontconfig --enable-libfreetype --enable-libfribidi --enable-libgme --enable-libgsm --enable-libmp3lame --enable-libmysofa --enable-libopenjpeg --enable-libopenmpt --enable-libopus --enable-libpulse --enable-librubberband --enable-librsvg --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libssh --enable-libtheora --enable-libtwolame --enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx265 --enable-libxml2 --enable-libxvid --enable-libzmq --enable-libzvbi --enable-omx --enable-openal --enable-opengl --enable-sdl2 --enable-libdc1394 --enable-libdrm --enable-libiec61883 --enable-chromaprint --enable-frei0r --enable-libopencv --enable-libx264 --enable-shared
  libavutil      55. 78.100 / 55. 78.100
  libavcodec     57.107.100 / 57.107.100
  libavformat    57. 83.100 / 57. 83.100
  libavdevice    57. 10.100 / 57. 10.100
  libavfilter     6.107.100 /  6.107.100
  libavresample   3.  7.  0 /  3.  7.  0
  libswscale      4.  8.100 /  4.  8.100
  libswresample   2.  9.100 /  2.  9.100
  libpostproc    54.  7.100 / 54.  7.100
Input #0, x11grab, from ':0.0':
  Duration: N/A, start: 1606681865.700480, bitrate: N/A
    Stream #0:0: Video: rawvideo (BGR[0] / 0x524742), bgr0, 1680x1050, 30 fps, 1000k tbr, 1000k tbn, 1000k tbc
Guessed Channel Layout for Input Stream #1.0 : stereo
Input #1, alsa, from 'default':
  Duration: N/A, start: 1606681866.175206, bitrate: 1536 kb/s
    Stream #1:0: Audio: pcm_s16le, 48000 Hz, stereo, s16, 1536 kb/s
Stream mapping:
  Stream #1:0 -> #0:0 (pcm_s16le (native) -> mp2 (native))
  Stream #0:0 -> #0:1 (rawvideo (native) -> mpeg1video (native))
  Stream #0:0 -> #0:2 (rawvideo (native) -> vp8 (libvpx))
Press [q] to stop, [?] for help
[x11grab @ 0x55d455855a00] Thread message queue blocking; consider raising the thread_queue_size option (current value: 8)
[mpeg1video @ 0x55d455889040] bitrate tolerance 21333 too small for bitrate 64000, overriding
[mpeg1video @ 0x55d455889040] MPEG-1/2 does not support 3/1 fps
Error initializing output stream 0:1 -- Error while opening encoder for output stream #0:1 - maybe incorrect parameters such as bit_rate, rate, width or height
[alsa @ 0x55d45585ec40] Thread message queue blocking; consider raising the thread_queue_size option (current value: 8)
Conversion failed!

Contents of ffserver.conf : ffserver.conf的内容:

HTTPPort 8090
HTTPBindAddress 0.0.0.0
MaxHTTPConnections 2000
MaxClients 1000
MaxBandwidth 1000
CustomLog -

<Feed feed1.ffm>
File /tmp/feed1.ffm
FileMaxSize 1g
ACL allow 127.0.0.1
ACL allow localhost #ovaj
</Feed>

<Stream test1.mpg>
Feed feed1.ffm
Format mpeg
AudioBitRate 32
AudioChannels 1
AudioSampleRate 44100
VideoBitRate 64
VideoBufferSize 40
VideoFrameRate 3
VideoSize 160x128
VideoGopSize 12
</Stream>

<Stream feed.webm>
Format webm
Feed feed1.ffm
VideoCodec libvpx
VideoSize 320x240
VideoFrameRate 15
VideoBitRate 512
VideoBufferSize 512
NoAudio
AVOptionVideo flags +global_header
StartSendOnKey
</Stream>

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

The encoder mpeg1video does not support a fame rate of 3, but you set VideoFrameRate 3 in ffserver.conf .编码器 mpeg1video 不支持帧速率 3,但您在ffserver.conf中设置了VideoFrameRate 3 mpeg1video is the default encoder used for mpeg format unless you tell it otherwise. mpeg1video 是用于 mpeg 格式的默认编码器,除非您另有说明。

Use a supported frame rate if you want to use mpeg1video.如果要使用 mpeg1video,请使用支持的帧速率。

See ffmpeg -h encoder=mpeg1video for a list of supported frame rates.有关支持的帧速率列表,请参阅ffmpeg -h encoder=mpeg1video

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM