这个命令当然会起作用:
avconv -i input.mpg -c:v libx264 -s 852x480 -c:a libfaac output.mp4
但这会将 mpg 编码为具有以下音频设置的文件:
{
"index": 1,
"codec_name": "mp2",
"codec_long_name": "MP2 (MPEG audio layer 2)",
"codec_type": "audio",
"codec_time_base": "1/48000",
"codec_tag_string": "mp4a",
"codec_tag": "0x6134706d",
"sample_fmt": "s16",
"sample_rate": "48000",
"channels": 2,
"bits_per_sample": 0,
"r_frame_rate": "0/0",
"avg_frame_rate": "0/0",
"time_base": "1/48000",
"start_time": "0.000000",
"duration": "60.000000",
"nb_frames": "2500",
"tags": {
"language": "und",
"handler_name": ""
}
}
这就是我需要的:
Resolution: 480p
Ratio: 1.78
Audio: 2 channel AAC
Video Bitrates: 600 / 800 / 1200 / 2000
Audio Bitrates: 96
Codec: H.264 - High
我试过了:
avconv -i input.mpg -c:v libx264 -s 852x480 -c:a libfaac output.mp4
但我得到错误:
Unknown encoder 'libfaac'
即使在我这样安装 libfaac-dev 之后:
sudo apt-get install libfaac-dev