ffmpeg 关于 fps、q 和隔行扫描

ffmpeg 关于 fps、q 和隔行扫描

我的命令没有声音:

ffmpeg -f dshow -rtbufsize 2147.48M -video_size 640x480 -i video="Roxio Video Capture USB" -c:v libx264 -pix_fmt yuv422p -preset ultrafast -bufsize 3968k -crf 0  R:/TestMaisonCorse611.mkv -vsync 1
My video file is not very well (good colors but some screen jumps)
My log :
ffmpeg version 2021-01-09-git-2e2891383e-full_build-www.gyan.dev Copyright (c) 2000-2021 the FFmpeg developers
  built with gcc 10.2.0 (Rev6, Built by MSYS2 project)
  configuration: --enable-gpl --enable-version3 --enable-static --disable-w32threads --disable-autodetect --enable-fontconfig --enable-iconv --enable-gnutls --enable-libxml2 --enable-gmp --enable-lzma --enable-libsnappy --enable-zlib --enable-libsrt --enable-libssh --enable-libzmq --enable-avisynth --enable-libbluray --enable-libcaca --enable-sdl2 --enable-libdav1d --enable-libzvbi --enable-librav1e --enable-libsvtav1 --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxvid --enable-libaom --enable-libopenjpeg --enable-libvpx --enable-libass --enable-frei0r --enable-libfreetype --enable-libfribidi --enable-libvidstab --enable-libvmaf --enable-libzimg --enable-amf --enable-cuda-llvm --enable-cuvid --enable-ffnvcodec --enable-nvdec --enable-nvenc --enable-d3d11va --enable-dxva2 --enable-libmfx --enable-libglslang --enable-vulkan --enable-opencl --enable-libcdio --enable-libgme --enable-libmodplug --enable-libopenmpt --enable-libopencore-amrwb --enable-libmp3lame --enable-libshine --enable-libtheora --enable-libtwolame --enable-libvo-amrwbenc --enable-libilbc --enable-libgsm --enable-libopencore-amrnb --enable-libopus --enable-libspeex --enable-libvorbis --enable-ladspa --enable-libbs2b --enable-libflite --enable-libmysofa --enable-librubberband --enable-libsoxr --enable-chromaprint
  libavutil      56. 63.100 / 56. 63.100
  libavcodec     58.115.102 / 58.115.102
  libavformat    58. 65.101 / 58. 65.101
  libavdevice    58. 11.103 / 58. 11.103
  libavfilter     7. 95.100 /  7. 95.100
  libswscale      5.  8.100 /  5.  8.100
  libswresample   3.  8.100 /  3.  8.100
  libpostproc    55.  8.100 / 55.  8.100
Input #0, dshow, from 'video=Roxio Video Capture USB':
  Duration: N/A, start: 427685.295000, bitrate: N/A
    Stream #0:0: Video: rawvideo (YUY2 / 0x32595559), yuyv422, 640x480, 29.97 fps, 29.97 tbr, 10000k tbn, 10000k tbc
File 'R:/TestMaisonCorse611.mkv' already exists. Overwrite? [y/N] y
Stream mapping:
  Stream #0:0 -> #0:0 (rawvideo (native) -> h264 (libx264))
Press [q] to stop, [?] for help
[libx264 @ 000001ece0605200] VBV is incompatible with constant QP, ignored.
[libx264 @ 000001ece0605200] using cpu capabilities: MMX2 SSE2Fast SSSE3 SSE4.2 AVX BMI1 SlowPshufb
[libx264 @ 000001ece0605200] profile High 4:4:4 Predictive, level 3.0, 4:2:2, 8-bit
[libx264 @ 000001ece0605200] 264 - core 161 r3033 0d754ec - H.264/MPEG-4 AVC codec - Copyleft 2003-2020 - http://www.videolan.org/x264.html - options: cabac=0 ref=1 deblock=0:0:0 analyse=0:0 me=dia subme=0 psy=0 mixed_ref=0 me_range=16 chroma_me=1 trellis=0 8x8dct=0 cqm=0 deadzone=21,11 fast_pskip=0 chroma_qp_offset=0 threads=3 lookahead_threads=1 sliced_threads=0 nr=0 decimate=1 interlaced=0 bluray_compat=0 constrained_intra=0 bframes=0 weightp=0 keyint=250 keyint_min=25 scenecut=0 intra_refresh=0 rc=cqp mbtree=0 qp=0
Output #0, matroska, to 'R:/TestMaisonCorse611.mkv':
  Metadata:
    encoder         : Lavf58.65.101
    Stream #0:0: Video: h264 (H264 / 0x34363248), yuv422p(tv, progressive), 640x480, q=2-31, 29.97 fps, 1k tbn
    Metadata:
      encoder         : Lavc58.115.102 libx264
    Side data:
      cpb: bitrate max/min/avg: 0/0/0 buffer size: 3968000 vbv_delay: N/A
frame= 1520 fps= 35 q=-1.0 Lsize=  242367kB time=00:00:50.68 bitrate=39172.8kbits/s dup=357 drop=0 speed=1.16x
video:242354kB audio:0kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 0.005275%
[libx264 @ 000001ece0605200] frame I:7     Avg QP: 0.00  size:213838
[libx264 @ 000001ece0605200] frame P:1513  Avg QP: 0.00  size:163036
[libx264 @ 000001ece0605200] mb I  I16..4: 100.0%  0.0%  0.0%
[libx264 @ 000001ece0605200] mb P  I16..4: 61.0%  0.0%  0.0%  P16..4: 16.5%  0.0%  0.0%  0.0%  0.0%    skip:22.4%
[libx264 @ 000001ece0605200] coded y,uvDC,uvAC intra: 95.1% 95.1% 95.1% inter: 42.4% 42.4% 42.4%
[libx264 @ 000001ece0605200] i16 v,h,dc,p: 11% 88%  0%  0%
[libx264 @ 000001ece0605200] i8c dc,h,v,p:  5% 94%  0%  0%
[libx264 @ 000001ece0605200] kb/s:39145.62

我的问题:

  1. 我认为 29.97 fps 是默认值。对吗?
  2. 实际的 fps 值是 35。正确吗?
  3. 他们两个的价值观不同,这是一个问题吗?
  4. 如何强制隔行选项?
  5. q介于 2-31 之间,但默认值为 -1。这是个问题吗?

答案1

  1. 这是捕获设备设置的值。

  2. 不,那是处理速度,而不是媒体帧速率。

  3. 未检测到输入为隔行扫描。请检查您的捕获设备配置。设置后,添加-flags +ildct为输出选项。

  4. q代表通用量化器设置,但 libx264 编码器不使用它。

相关内容