两个视频之间的 FFMPEG 选项差异
FFMPEG options differences between two videos
所以我正在使用 png 制作视频。多亏了 ffmpeg
,制作视频并没有太难,但是我制作的大部分视频正向播放时效果很好,向后播放时非常不稳定。
使用名为 MPEG Streamclip plus Handbrake 的程序,我成功地将我的视频转换为前后播放效果都很好的视频。但现在我不知道如何将正确的选项传递给 ffmpeg
以复制此视频。
使用 ffprobe
我有一些好视频和坏视频的输出。我缺少哪些选项?
视频质量差:
$ ffprobe tea_ffmpeg.mov
ffprobe version 3.0 Copyright (c) 2007-2016 the FFmpeg developers
built with Apple LLVM version 7.0.2 (clang-700.1.81)
configuration: --prefix=/usr/local/Cellar/ffmpeg/3.0 --enable-shared --enable-pthreads --enable-gpl --enable-version3 --enable-hardcoded-tables --enable-avresample --cc=clang --host-cflags= --host-ldflags= --enable-opencl --enable-libx264 --enable-libmp3lame --enable-libxvid --enable-vda
libavutil 55. 17.103 / 55. 17.103
libavcodec 57. 24.102 / 57. 24.102
libavformat 57. 25.100 / 57. 25.100
libavdevice 57. 0.101 / 57. 0.101
libavfilter 6. 31.100 / 6. 31.100
libavresample 3. 0. 0 / 3. 0. 0
libswscale 4. 0.100 / 4. 0.100
libswresample 2. 0.101 / 2. 0.101
libpostproc 54. 0.100 / 54. 0.100
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'tea_ffmpeg.mov':
Metadata:
major_brand : qt
minor_version : 512
compatible_brands: qt
encoder : Lavf57.25.100
Duration: 00:00:08.04, start: 0.000000, bitrate: 1140 kb/s
Stream #0:0(eng): Video: h264 (High) (avc1 / 0x31637661), yuv420p, 676x450 [SAR 675:676 DAR 3:2], 1138 kb/s, 25 fps, 25 tbr, 12800 tbn, 50 tbc (default)
Metadata:
handler_name : DataHandler
encoder : Lavc57.24.102 libx264
好视频:
$ ffprobe test.mov
ffprobe version 3.0 Copyright (c) 2007-2016 the FFmpeg developers
built with Apple LLVM version 7.0.2 (clang-700.1.81)
configuration: --prefix=/usr/local/Cellar/ffmpeg/3.0 --enable-shared --enable-pthreads --enable-gpl --enable-version3 --enable-hardcoded-tables --enable-avresample --cc=clang --host-cflags= --host-ldflags= --enable-opencl --enable-libx264 --enable-libmp3lame --enable-libxvid --enable-vda
libavutil 55. 17.103 / 55. 17.103
libavcodec 57. 24.102 / 57. 24.102
libavformat 57. 25.100 / 57. 25.100
libavdevice 57. 0.101 / 57. 0.101
libavfilter 6. 31.100 / 6. 31.100
libavresample 3. 0. 0 / 3. 0. 0
libswscale 4. 0.100 / 4. 0.100
libswresample 2. 0.101 / 2. 0.101
libpostproc 54. 0.100 / 54. 0.100
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'test.mov':
Metadata:
major_brand : qt
minor_version : 537199360
compatible_brands: qt
creation_time : 2016-03-09 15:16:37
Duration: 00:00:08.04, start: 0.000000, bitrate: 2650 kb/s
Stream #0:0(eng): Video: h264 (Main) (avc1 / 0x31637661), yuv420p(tv, smpte170m/smpte170m/bt709), 674x450, 2646 kb/s, 25 fps, 25 tbr, 25k tbn, 50k tbc (default)
Metadata:
creation_time : 2016-03-09 15:16:47
handler_name : Apple Alias Data Handler
encoder : H.264
到目前为止的 FFMPEG 命令:
ffmpeg -y -i 'pngs/tea-%03d.png' -vf scale=674:-2 -vcodec libx264 -pix_fmt yuv420p -r 25 tea_ffmpeg.mov
我知道 mov vs mp4 应该只是一个容器规范,但 mov 是我开始工作的第一个。我非常乐意使用 mp4。
突出的主要是个人资料。所以,
ffmpeg -y -i 'pngs/tea-%03d.png' -vf scale=674:-2 -vcodec libx264 -profile:v main -pix_fmt yuv420p -r 25 tea_ffmpeg.mov
为了更安全,您可以使用基线配置文件和较小的 GOP 大小(以文件大小为代价)
ffmpeg -y -i 'pngs/tea-%03d.png' -vf scale=674:-2 -vcodec libx264 -profile:v baseline -g 12 -pix_fmt yuv420p -r 25 tea_ffmpeg.mov
所以我正在使用 png 制作视频。多亏了 ffmpeg
,制作视频并没有太难,但是我制作的大部分视频正向播放时效果很好,向后播放时非常不稳定。
使用名为 MPEG Streamclip plus Handbrake 的程序,我成功地将我的视频转换为前后播放效果都很好的视频。但现在我不知道如何将正确的选项传递给 ffmpeg
以复制此视频。
使用 ffprobe
我有一些好视频和坏视频的输出。我缺少哪些选项?
视频质量差:
$ ffprobe tea_ffmpeg.mov
ffprobe version 3.0 Copyright (c) 2007-2016 the FFmpeg developers
built with Apple LLVM version 7.0.2 (clang-700.1.81)
configuration: --prefix=/usr/local/Cellar/ffmpeg/3.0 --enable-shared --enable-pthreads --enable-gpl --enable-version3 --enable-hardcoded-tables --enable-avresample --cc=clang --host-cflags= --host-ldflags= --enable-opencl --enable-libx264 --enable-libmp3lame --enable-libxvid --enable-vda
libavutil 55. 17.103 / 55. 17.103
libavcodec 57. 24.102 / 57. 24.102
libavformat 57. 25.100 / 57. 25.100
libavdevice 57. 0.101 / 57. 0.101
libavfilter 6. 31.100 / 6. 31.100
libavresample 3. 0. 0 / 3. 0. 0
libswscale 4. 0.100 / 4. 0.100
libswresample 2. 0.101 / 2. 0.101
libpostproc 54. 0.100 / 54. 0.100
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'tea_ffmpeg.mov':
Metadata:
major_brand : qt
minor_version : 512
compatible_brands: qt
encoder : Lavf57.25.100
Duration: 00:00:08.04, start: 0.000000, bitrate: 1140 kb/s
Stream #0:0(eng): Video: h264 (High) (avc1 / 0x31637661), yuv420p, 676x450 [SAR 675:676 DAR 3:2], 1138 kb/s, 25 fps, 25 tbr, 12800 tbn, 50 tbc (default)
Metadata:
handler_name : DataHandler
encoder : Lavc57.24.102 libx264
好视频:
$ ffprobe test.mov
ffprobe version 3.0 Copyright (c) 2007-2016 the FFmpeg developers
built with Apple LLVM version 7.0.2 (clang-700.1.81)
configuration: --prefix=/usr/local/Cellar/ffmpeg/3.0 --enable-shared --enable-pthreads --enable-gpl --enable-version3 --enable-hardcoded-tables --enable-avresample --cc=clang --host-cflags= --host-ldflags= --enable-opencl --enable-libx264 --enable-libmp3lame --enable-libxvid --enable-vda
libavutil 55. 17.103 / 55. 17.103
libavcodec 57. 24.102 / 57. 24.102
libavformat 57. 25.100 / 57. 25.100
libavdevice 57. 0.101 / 57. 0.101
libavfilter 6. 31.100 / 6. 31.100
libavresample 3. 0. 0 / 3. 0. 0
libswscale 4. 0.100 / 4. 0.100
libswresample 2. 0.101 / 2. 0.101
libpostproc 54. 0.100 / 54. 0.100
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'test.mov':
Metadata:
major_brand : qt
minor_version : 537199360
compatible_brands: qt
creation_time : 2016-03-09 15:16:37
Duration: 00:00:08.04, start: 0.000000, bitrate: 2650 kb/s
Stream #0:0(eng): Video: h264 (Main) (avc1 / 0x31637661), yuv420p(tv, smpte170m/smpte170m/bt709), 674x450, 2646 kb/s, 25 fps, 25 tbr, 25k tbn, 50k tbc (default)
Metadata:
creation_time : 2016-03-09 15:16:47
handler_name : Apple Alias Data Handler
encoder : H.264
到目前为止的 FFMPEG 命令:
ffmpeg -y -i 'pngs/tea-%03d.png' -vf scale=674:-2 -vcodec libx264 -pix_fmt yuv420p -r 25 tea_ffmpeg.mov
我知道 mov vs mp4 应该只是一个容器规范,但 mov 是我开始工作的第一个。我非常乐意使用 mp4。
突出的主要是个人资料。所以,
ffmpeg -y -i 'pngs/tea-%03d.png' -vf scale=674:-2 -vcodec libx264 -profile:v main -pix_fmt yuv420p -r 25 tea_ffmpeg.mov
为了更安全,您可以使用基线配置文件和较小的 GOP 大小(以文件大小为代价)
ffmpeg -y -i 'pngs/tea-%03d.png' -vf scale=674:-2 -vcodec libx264 -profile:v baseline -g 12 -pix_fmt yuv420p -r 25 tea_ffmpeg.mov