转换mp3播放器支持的视频格式amv
ffmpeg -i "Beautiful.mp4" -s 160x120 -vstrict -1 -block_size 882 -ac 1 -ar 22050 "Beautiful.amv"
-s 160x120 屏幕尺寸
-vstrict -1 支持16整数倍高度
-block_size 设置音频块大小,数值具体取决于视频合并时的错误提示“Try -block_size 882”
[amv @ 0000022538de9380] Invalid audio frame size. Got 882, wanted 735
[amv @ 0000022538de9380] Invalid audio block align. Got 449, wanted 376
[amv @ 0000022538de9380] Try -block_size 882
Could not write header for output file #0 (incorrect codec parameters ?): Invalid argument
Error initializing output stream 0:1 --
-ac 1 单声道
-ar 22050 音频采样率
如果是只有画面没有音频的视频合并会提示
AMV files only support 2 streams
Could not write header for output file #0 (incorrect codec parameters ?): Invalid argument
Error initializing output stream 0:0 --
为视频添加一条独立音轨
ffmpeg -i nightsky.mp4 -f lavfi -t 1 -i anullsrc=channel_layout=stereo:sample_rate=22050 -s 160x120 -vstrict -1 -block_size 735 -ac 1 -ar 22050 nightsky.amv
如果出现
Audio sample rate not a multiple of the frame size.
Please change video frame rate. Suggested rates: 10,14,15,18,21,25,30
Could not write header for output file #0 (incorrect codec parameters ?): Invalid argument
Error initializing output stream 0:1 -
改变视频帧率
ffmpeg -i D:\test.mp4 -r 25 -s 160x120 -vstrict -1 -block_size 920 -ac 1 -ar 22050 test.amv