在这个页面:http://ffmpeg.org/ffmpeg.html#Main-optionsffmpeg.exe -i "2013-01-17-muxed.mp4" -vcodec copy -acodec copy "2013-01-17-muxed_FLV封装.flv"
这里提到:
也就是说-codec是要放到输入文件(有-i指定)后面的,以指定使用某种编码器或者复制流。‘-f fmt (input/output)’
Force input or output file format. The format is normally auto detected for input files and guessed from file extension for output files, so this option is not needed in most cases.
‘-c[:stream_specifier] codec (input/output,per-stream)’
‘-codec[:stream_specifier] codec (input/output,per-stream)’
Select an encoder (when used before an output file) or a decoder (when used before an input file) for one or more streams. codec is the name of a decoder/encoder or a special value copy (output only) to indicate that the stream is not to be re-encoded.
由上述内容进一步可知,文件类型(-f)也可不必指定,即省略。
“-vcodec copy -acodec copy”简化后是-codec/-c。即上述命令可简化为:
代码: 全选
ffmpeg.exe -i "2013-01-17-muxed.mp4" -c copy "2013-01-17-muxed_FLV封装.flv"
简化参数没有强调视频还是音频,所以它应该是可以封装仅含有视频流或者仅含有音频流的文件。
以下是原帖:
代码: 全选
ffmpeg.exe -vcodec copy -acodec copy -i "2013-01-17-muxed.mp4" -f flv "2013-01-17-muxed_FLV封装.flv"
刚才换了论坛置顶帖子里面的libav/ffmpeg编译版【2012/12/24】ffmpeg version N-32071-g276f43b, Copyright (c) 2000-2011 the FFmpeg developers
built on Aug 23 2011 11:01:40 with gcc 4.6.1
结果最后报了个错:
之后输入 -h看看帮助,有如下说法:Unknown decoder 'copy'
这说明我命令没错,就该可以执行。但却报错,这不科学。-vcodec codec force video codec ('copy' to copy stream)
-acodec codec force audio codec ('copy' to copy stream)
最后我把-vcodec copy -acodec copy换成-dcodec copy,这把终于可以执行了,但等了半天才运行结束,结果得到了比原来大很多的flv的文件。之前mp4改为flv封装后,执行速度很快且体积变化差异很小,几乎是不变,播放后画质变渣,这肯定是二次编码了,说明这个命令肯定也是不对的。
现在我要问的是:
1.我希望用新版的ffmpeg实现mp4到flv的封装,画质不变即不重编码,这到底能不能实现?或者说新版的命令改成啥才能用?
2.旧版的支持48k和44k的音频封装,新版的还支持48k么?