我正在尝试将mp4
转换为mov
,但ffmpeg
在视频转换方面存在问题:
Stream #0:0 -> #0:0 (h264 (native) -> dnxhd (native))
我尝试了几种建议的配置,但没有成功:
-vcodec dnxhd -acodec pcm_s16le -pix_fmt yuv422p10 -r 24000/1001 -b:v 175M
-vcodec dnxhd -acodec pcm_s16le -pix_fmt yuv422p10 -r 25/1 -b:v 185M
-vcodec dnxhd -acodec pcm_s16le -pix_fmt yuv422p10 -r 60000/1001 -b:v 440M
-vcodec dnxhd -acodec pcm_s16le -pix_fmt yuv422p -r 24000/1001 -b:v 115M
-vcodec dnxhd -acodec pcm_s16le -pix_fmt yuv422p -r 25/1 -b:v 120M
知道怎么了吗?我如何选择";正确的";视频格式?
当摄像机旋转90°时,ffmpeg
是否可能拒绝转换视频?即输入分辨率将是CCD_ 10?
ffmpeg -i google-2020/VID-20200421-WA0000.mp4 -map_metadata 0 -vcodec dnxhd -acodec pcm_s16le -pix_fmt yuv422p10 -r 24000/1001 -b:v 175M google-2020-conv2/VID-20200421-WA0000.mov
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, mov,mp4,m4a,3gp,3g2,mj2, from 'google-2020/VID-20200421-WA0000.mp4':
Metadata:
major_brand : mp42
minor_version : 0
compatible_brands: isommp42
creation_time : 2020-04-26T12:06:16.000000Z
Duration: 00:00:12.98, start: 0.000000, bitrate: 720 kb/s
Stream #0:0(und): Video: h264 (High) (avc1 / 0x31637661), yuv420p(tv, smpte170m/bt470bg/bt709), 640x352 [SAR 1:1 DAR 20:11], 592 kb/s, 30 fps, 30 tbr, 15360 tbn, 60 tbc (default)
Metadata:
creation_time : 2020-04-26T12:06:16.000000Z
handler_name : ISO Media file produced by Google Inc. Created on: 04/26/2020.
Stream #0:1(und): Audio: aac (LC) (mp4a / 0x6134706D), 44100 Hz, stereo, fltp, 128 kb/s (default)
Metadata:
creation_time : 2020-04-26T12:06:16.000000Z
handler_name : ISO Media file produced by Google Inc. Created on: 04/26/2020.
Stream mapping:
Stream #0:0 -> #0:0 (h264 (native) -> dnxhd (native))
Stream #0:1 -> #0:1 (aac (native) -> pcm_s16le (native))
Press [q] to stop, [?] for help
[dnxhd @ 0x55b24eeae0a0] video parameters incompatible with DNxHD. Valid DNxHD profiles:
[dnxhd @ 0x55b24eeae0a0] Frame size: 1920x1080p; bitrate: 175Mbps; pixel format: yuv422p10; framerate: 24000/1001
[dnxhd @ 0x55b24eeae0a0] Frame size: 1920x1080p; bitrate: 185Mbps; pixel format: yuv422p10; framerate: 25/1
[dnxhd @ 0x55b24eeae0a0] Frame size: 1920x1080p; bitrate: 365Mbps; pixel format: yuv422p10; framerate: 50/1
[dnxhd @ 0x55b24eeae0a0] Frame size: 1920x1080p; bitrate: 440Mbps; pixel format: yuv422p10; framerate: 60000/1001
[dnxhd @ 0x55b24eeae0a0] Frame size: 1920x1080p; bitrate: 115Mbps; pixel format: yuv422p; framerate: 24000/1001
[dnxhd @ 0x55b24eeae0a0] Frame size: 1920x1080p; bitrate: 120Mbps; pixel format: yuv422p; framerate: 25/1
[dnxhd @ 0x55b24eeae0a0] Frame size: 1920x1080p; bitrate: 145Mbps; pixel format: yuv422p; framerate: 30000/1001
[dnxhd @ 0x55b24eeae0a0] Frame size: 1920x1080p; bitrate: 240Mbps; pixel format: yuv422p; framerate: 50/1
[dnxhd @ 0x55b24eeae0a0] Frame size: 1920x1080p; bitrate: 290Mbps; pixel format: yuv422p; framerate: 60000/1001
[dnxhd @ 0x55b24eeae0a0] Frame size: 1920x1080p; bitrate: 175Mbps; pixel format: yuv422p; framerate: 24000/1001
[dnxhd @ 0x55b24eeae0a0] Frame size: 1920x1080p; bitrate: 185Mbps; pixel format: yuv422p; framerate: 25/1
[dnxhd @ 0x55b24eeae0a0] Frame size: 1920x1080p; bitrate: 220Mbps; pixel format: yuv422p; framerate: 30000/1001
[dnxhd @ 0x55b24eeae0a0] Frame size: 1920x1080p; bitrate: 365Mbps; pixel format: yuv422p; framerate: 50/1
[dnxhd @ 0x55b24eeae0a0] Frame size: 1920x1080p; bitrate: 440Mbps; pixel format: yuv422p; framerate: 60000/1001
[dnxhd @ 0x55b24eeae0a0] Frame size: 1920x1080i; bitrate: 185Mbps; pixel format: yuv422p10; framerate: 25/1
[dnxhd @ 0x55b24eeae0a0] Frame size: 1920x1080i; bitrate: 220Mbps; pixel format: yuv422p10; framerate: 30000/1001
[dnxhd @ 0x55b24eeae0a0] Frame size: 1920x1080i; bitrate: 120Mbps; pixel format: yuv422p; framerate: 25/1
[dnxhd @ 0x55b24eeae0a0] Frame size: 1920x1080i; bitrate: 145Mbps; pixel format: yuv422p; framerate: 30000/1001
[dnxhd @ 0x55b24eeae0a0] Frame size: 1920x1080i; bitrate: 185Mbps; pixel format: yuv422p; framerate: 25/1
[dnxhd @ 0x55b24eeae0a0] Frame size: 1920x1080i; bitrate: 220Mbps; pixel format: yuv422p; framerate: 30000/1001
[dnxhd @ 0x55b24eeae0a0] Frame size: 1440x1080i; bitrate: 120Mbps; pixel format: yuv422p; framerate: 25/1
[dnxhd @ 0x55b24eeae0a0] Frame size: 1440x1080i; bitrate: 145Mbps; pixel format: yuv422p; framerate: 30000/1001
[dnxhd @ 0x55b24eeae0a0] Frame size: 1280x720p; bitrate: 90Mbps; pixel format: yuv422p10; framerate: 24000/1001
[dnxhd @ 0x55b24eeae0a0] Frame size: 1280x720p; bitrate: 90Mbps; pixel format: yuv422p10; framerate: 25/1
[dnxhd @ 0x55b24eeae0a0] Frame size: 1280x720p; bitrate: 180Mbps; pixel format: yuv422p10; framerate: 50/1
[dnxhd @ 0x55b24eeae0a0] Frame size: 1280x720p; bitrate: 220Mbps; pixel format: yuv422p10; framerate: 60000/1001
[dnxhd @ 0x55b24eeae0a0] Frame size: 1280x720p; bitrate: 90Mbps; pixel format: yuv422p; framerate: 24000/1001
[dnxhd @ 0x55b24eeae0a0] Frame size: 1280x720p; bitrate: 90Mbps; pixel format: yuv422p; framerate: 25/1
[dnxhd @ 0x55b24eeae0a0] Frame size: 1280x720p; bitrate: 110Mbps; pixel format: yuv422p; framerate: 30000/1001
[dnxhd @ 0x55b24eeae0a0] Frame size: 1280x720p; bitrate: 180Mbps; pixel format: yuv422p; framerate: 50/1
[dnxhd @ 0x55b24eeae0a0] Frame size: 1280x720p; bitrate: 220Mbps; pixel format: yuv422p; framerate: 60000/1001
[dnxhd @ 0x55b24eeae0a0] Frame size: 1280x720p; bitrate: 60Mbps; pixel format: yuv422p; framerate: 24000/1001
[dnxhd @ 0x55b24eeae0a0] Frame size: 1280x720p; bitrate: 60Mbps; pixel format: yuv422p; framerate: 25/1
[dnxhd @ 0x55b24eeae0a0] Frame size: 1280x720p; bitrate: 75Mbps; pixel format: yuv422p; framerate: 30000/1001
[dnxhd @ 0x55b24eeae0a0] Frame size: 1280x720p; bitrate: 120Mbps; pixel format: yuv422p; framerate: 50/1
[dnxhd @ 0x55b24eeae0a0] Frame size: 1280x720p; bitrate: 145Mbps; pixel format: yuv422p; framerate: 60000/1001
[dnxhd @ 0x55b24eeae0a0] Frame size: 1920x1080p; bitrate: 36Mbps; pixel format: yuv422p; framerate: 24000/1001
[dnxhd @ 0x55b24eeae0a0] Frame size: 1920x1080p; bitrate: 36Mbps; pixel format: yuv422p; framerate: 25/1
[dnxhd @ 0x55b24eeae0a0] Frame size: 1920x1080p; bitrate: 45Mbps; pixel format: yuv422p; framerate: 30000/1001
[dnxhd @ 0x55b24eeae0a0] Frame size: 1920x1080p; bitrate: 75Mbps; pixel format: yuv422p; framerate: 50/1
[dnxhd @ 0x55b24eeae0a0] Frame size: 1920x1080p; bitrate: 90Mbps; pixel format: yuv422p; framerate: 60000/1001
[dnxhd @ 0x55b24eeae0a0] Frame size: 1920x1080p; bitrate: 350Mbps; pixel format: yuv422p10; framerate: 24000/1001
[dnxhd @ 0x55b24eeae0a0] Frame size: 1920x1080p; bitrate: 390Mbps; pixel format: yuv422p10; framerate: 25/1
[dnxhd @ 0x55b24eeae0a0] Frame size: 1920x1080p; bitrate: 440Mbps; pixel format: yuv422p10; framerate: 30000/1001
[dnxhd @ 0x55b24eeae0a0] Frame size: 1920x1080p; bitrate: 730Mbps; pixel format: yuv422p10; framerate: 50/1
[dnxhd @ 0x55b24eeae0a0] Frame size: 1920x1080p; bitrate: 880Mbps; pixel format: yuv422p10; framerate: 60000/1001
[dnxhd @ 0x55b24eeae0a0] Frame size: 960x720p; bitrate: 42Mbps; pixel format: yuv422p; framerate: 0/0
[dnxhd @ 0x55b24eeae0a0] Frame size: 960x720p; bitrate: 60Mbps; pixel format: yuv422p; framerate: 0/0
[dnxhd @ 0x55b24eeae0a0] Frame size: 960x720p; bitrate: 75Mbps; pixel format: yuv422p; framerate: 0/0
[dnxhd @ 0x55b24eeae0a0] Frame size: 960x720p; bitrate: 115Mbps; pixel format: yuv422p; framerate: 0/0
[dnxhd @ 0x55b24eeae0a0] Frame size: 1440x1080p; bitrate: 63Mbps; pixel format: yuv422p; framerate: 0/0
[dnxhd @ 0x55b24eeae0a0] Frame size: 1440x1080p; bitrate: 84Mbps; pixel format: yuv422p; framerate: 0/0
[dnxhd @ 0x55b24eeae0a0] Frame size: 1440x1080p; bitrate: 100Mbps; pixel format: yuv422p; framerate: 0/0
[dnxhd @ 0x55b24eeae0a0] Frame size: 1440x1080p; bitrate: 110Mbps; pixel format: yuv422p; framerate: 0/0
[dnxhd @ 0x55b24eeae0a0] Frame size: 1440x1080i; bitrate: 80Mbps; pixel format: yuv422p; framerate: 0/0
[dnxhd @ 0x55b24eeae0a0] Frame size: 1440x1080i; bitrate: 90Mbps; pixel format: yuv422p; framerate: 0/0
[dnxhd @ 0x55b24eeae0a0] Frame size: 1440x1080i; bitrate: 100Mbps; pixel format: yuv422p; framerate: 0/0
[dnxhd @ 0x55b24eeae0a0] Frame size: 1440x1080i; bitrate: 110Mbps; pixel format: yuv422p; framerate: 0/0
[dnxhd @ 0x55b24ea11a60] ff_frame_thread_encoder_init failed
Error initializing output stream 0:0 -- Error while opening encoder for output stream #0:0 - maybe incorrect parameters such as bit_rate, rate, width or height
Conversion failed!
知道怎么了吗?我如何选择";正确的";视频格式?
DNxHD有特定的要求。您必须选择正确的:
- 宽x高
- 比特率
- 像素格式
- 帧速率
您的命令缺少可接受的宽度x高度。您的输入是640x352,但DNxHD需要720p或更大。请参阅问题中ffmpeg
输出中的有效DNxHD配置文件。
对于640x352的输入,我想知道DNxHD是否是正确的选择。为什么你需要DNxHD?可能是XY问题。
当摄像机旋转90°时,
ffmpeg
是否可能拒绝转换视频?即输入分辨率将是CCD_ 13?
我在您的文件信息中没有看到任何轮换元数据/侧数据。编码时ffmpeg
将自动旋转,除非您告诉它不要使用-noautorotate
。
如果它旋转到1080x1920,那么它将无效,因为它没有明确列在问题中ffmpeg
输出的有效DNxHD配置文件中。
示例
与您的输入最接近的可接受配置文件是:
Frame size: 1280x720p; bitrate: 110Mbps; pixel format: yuv422p; framerate: 30000/1001
命令:
ffmpeg -i input.mp4 -vf "fps=30000/1001,scale=1280:720:force_original_aspect_ratio=increase,crop=1280:720,setsar=1,format=yuv422p" -c:v dnxhd -b:v 110M -c:a pcm_s16le output.mov
缩放和填充过滤器示例来自使用ffmpeg
调整视频大小以适应特定大小。如果您更喜欢填充以适应(信箱/柱箱(而不是裁剪以适应,请参阅此链接以获取更多示例。
我找到了一个工作配置(不是ffmpeg
建议的配置(。更改像素格式并添加-profile:v dnxhr_444
,即DNxHR 444 - Finishing Quality (12-bit 4:4:4) (Cinema-quality delivery)
有助于
-vcodec dnxhd -pix_fmt gbrp10le -profile:v dnxhr_444 -r 30000/1001 -b:v 440M