我一直在尝试使用 FFmpeg 实用程序将使用 DNxHD 的 avi 文件转换为 mxf 格式。我使用“FFmpeg”,参数如下:
ffmpeg -i ccvt_box.avi -vcodec dnxhd -video_size 1920x1080 -r 24 -b:v 115m ex.mxf
它给出的错误:
ffmpeg version N-43737-g76c3fff Copyright (c) 2000-2012 the FFmpeg developers
built on Aug 20 2012 18:50:42 with llvm-gcc 4.2.1 (LLVM build 2336.11.00)
configuration:
libavutil 51. 70.100 / 51. 70.100
libavcodec 54. 53.100 / 54. 53.100
libavformat 54. 25.104 / 54. 25.104
libavdevice 54. 2.100 / 54. 2.100
libavfilter 3. 11.101 / 3. 11.101
libswscale 2. 1.101 / 2. 1.101
libswresample 0. 15.100 / 0. 15.100
Input #0, avi, from 'ccvt_box.avi':
Duration: 00:00:10.00, start: 0.000000, bitrate: 691 kb/s
Stream #0:0: Video: indeo5 (IV50 / 0x30355649), yuv410p, 340x344, 10 tbr, 10 tbn, 10 tbc
Metadata:
title : bob.avi
[dnxhd @ 0x7fcd60818e00] video parameters incompatible with DNxHD
Output #0, mxf, to 'ex.mxf':
Stream #0:0: Video: dnxhd, yuv422p, 340x344, q=2-1024, 90k tbn, 24 tbc
Metadata:
title : bob.avi
Stream mapping:
Stream #0:0 -> #0:0 (indeo5 -> dnxhd)
Error while opening encoder for output stream #0:0 - maybe incorrect parameters such as bit_rate, rate, width or height
更新
➜ FFmpegTest ffmpeg -i ccvt_box.avi -c:v dnxhd -s 1920x1080 -r 25 -b:v 115M ex.mxf
ffmpeg version N-43737-g76c3fff Copyright (c) 2000-2012 the FFmpeg developers
built on Aug 20 2012 18:50:42 with llvm-gcc 4.2.1 (LLVM build 2336.11.00)
configuration:
libavutil 51. 70.100 / 51. 70.100
libavcodec 54. 53.100 / 54. 53.100
libavformat 54. 25.104 / 54. 25.104
libavdevice 54. 2.100 / 54. 2.100
libavfilter 3. 11.101 / 3. 11.101
libswscale 2. 1.101 / 2. 1.101
libswresample 0. 15.100 / 0. 15.100
Input #0, avi, from 'ccvt_box.avi':
Duration: 00:00:10.00, start: 0.000000, bitrate: 691 kb/s
Stream #0:0: Video: indeo5 (IV50 / 0x30355649), yuv410p, 340x344, 10 tbr, 10 tbn, 10 tbc
Metadata:
title : bob.avi
File 'ex.mxf' already exists. Overwrite ? [y/N] y
Output #0, mxf, to 'ex.mxf':
Metadata:
encoder : Lavf54.25.104
Stream #0:0: Video: dnxhd, yuv422p, 1920x1080, q=2-1024, 115000 kb/s, 25 tbn, 25 tbc
Metadata:
title : bob.avi
Stream mapping:
Stream #0:0 -> #0:0 (indeo5 -> dnxhd)
Press [q] to stop, [?] for help
frame= 249 fps= 59 q=1.0 Lsize= 147662kB time=00:00:09.96 bitrate=121450.5kbits/s dup=149 drop=0
video:0kB audio:0kB subtitle:0 global headers:0kB muxing overhead inf%
Output file is empty, nothing was encoded (check -ss / -t / -frames parameters if used)
➜ FFmpegTest ls -l ex.mxf
-rw-r--r-- 1 Prakash staff 151205933 Sep 5 15:26 ex.mxf
答案1
您需要使用-s
而不是-video_size
(这是某些解复用器和 V4L2 输入设备的选项),使用115M
而不是115m
,并提供有效的帧速率-r
(25 [pal]、50、30000/1001 [ntsc]、60000/1001):
ffmpeg -i ccvt_box.avi -c:v dnxhd -s 1920x1080 -r 25 -b:v 115M ex.mxf
请注意,此示例不涉及任何音频流。默认音频编码器为 pcm_s16le。
除了 FFmpeg,还有FFmbc这可能提供额外的 DNxHD 功能。
答案2
这对我有用:
ffmpeg -i in.mp4 -s 1920x1080 -r 30 -b:v 115M out.mxf
DNxHD 对我来说是不需要的并且不起作用。