我正在对一个包含各种分辨率的视频文件夹运行 ffmpeg,并将它们缩小到 25%。但我的所有输出都在一侧有一个微小的黑色边框。
https://i.stack.imgur.com/yxbIC.png
下面是一个示例,左边是原始视频,右边是输出。缩放效果很好,虽然看起来是在交换 w/h,但文件仍然以正确的方向播放。 https://i.stack.imgur.com/Nszeg.png
这是我的参数:
ffmpeg.exe -i "$f" -filter:v "scale=iw/4:ih/4" -c:v hevc_amf -c:a copy "../${f%.*}.mp4"
我使用的是 ffmpeg 版本 git-2020-08-02-b48397e。我需要这些才能真正调整大小而不出现随机黑条。我尝试了 scale 参数的每种配置,但总是得到相同的结果。
以下是示例日志:
ffmpeg version git-2020-08-02-b48397e Copyright (c) 2000-2020 the FFmpeg developers
built with gcc 10.2.1 (GCC) 20200726
configuration: --enable-gpl --enable-version3 --enable-sdl2 --enable-fontconfig --enable-gnutls --enable-iconv --enable-libass --enable-libdav1d --enable-libbluray --enable-libfreetype --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-libopus --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libsrt --enable-libtheora --enable-libtwolame --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxml2 --enable-libzimg --enable-lzma --enable-zlib --enable-gmp --enable-libvidstab --enable-libvmaf --enable-libvorbis --enable-libvo-amrwbenc --enable-libmysofa --enable-libspeex --enable-libxvid --enable-libaom --enable-libgsm --enable-librav1e --disable-w32threads --enable-libmfx --enable-ffnvcodec --enable-cuda-llvm --enable-cuvid --enable-d3d11va --enable-nvenc --enable-nvdec --enable-dxva2 --enable-avisynth --enable-libopenmpt --enable-amf
libavutil 56. 57.100 / 56. 57.100
libavcodec 58. 99.100 / 58. 99.100
libavformat 58. 49.100 / 58. 49.100
libavdevice 58. 11.101 / 58. 11.101
libavfilter 7. 87.100 / 7. 87.100
libswscale 5. 8.100 / 5. 8.100
libswresample 3. 8.100 / 3. 8.100
libpostproc 55. 8.100 / 55. 8.100
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'BONK6556.mp4':
Metadata:
major_brand : mp42
minor_version : 1
compatible_brands: mp41mp42isom
creation_time : 2020-01-18T22:26:45.000000Z
Duration: 00:00:11.07, start: 0.000000, bitrate: 15014 kb/s
Stream #0:0(und): Video: h264 (High) (avc1 / 0x31637661), yuv420p(tv, bt709), 1920x1080, 14919 kb/s, 30 fps, 30 tbr, 600 tbn, 1200 tbc (default)
Metadata:
rotate : 90
creation_time : 2020-01-18T22:26:45.000000Z
handler_name : Core Media Video
Side data:
displaymatrix: rotation of -90.00 degrees
Stream #0:1(und): Audio: aac (LC) (mp4a / 0x6134706D), 44100 Hz, mono, fltp, 92 kb/s (default)
Metadata:
creation_time : 2020-01-18T22:26:45.000000Z
handler_name : Core Media Audio
File '../BONK6556.mp4' already exists. Overwrite? [y/N] y
Stream mapping:
Stream #0:0 -> #0:0 (h264 (native) -> hevc (hevc_amf))
Stream #0:1 -> #0:1 (copy)
Press [q] to stop, [?] for help
Output #0, mp4, to '../BONK6556.mp4':
Metadata:
major_brand : mp42
minor_version : 1
compatible_brands: mp41mp42isom
encoder : Lavf58.49.100
Stream #0:0(und): Video: hevc (hevc_amf) (hev1 / 0x31766568), yuv420p, 270x480, q=2-31, 2000 kb/s, 30 fps, 15360 tbn, 30 tbc (default)
Metadata:
encoder : Lavc58.99.100 hevc_amf
creation_time : 2020-01-18T22:26:45.000000Z
handler_name : Core Media Video
Side data:
displaymatrix: rotation of -0.00 degrees
Stream #0:1(und): Audio: aac (LC) (mp4a / 0x6134706D), 44100 Hz, mono, fltp, 92 kb/s (default)
Metadata:
creation_time : 2020-01-18T22:26:45.000000Z
handler_name : Core Media Audio
frame= 183 fps=0.0 q=-0.0 size= 1536kB time=00:00:07.57 bitrate=1661.1kbits/s speed=15.1x frame= 332 fps=0.0 q=-0.0 Lsize= 2819kB time=00:00:11.03 bitrate=2092.7kbits/s speed=13.1x
video:2685kB audio:123kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 0.373649%