4、FFmpeg命令行操作9

FFmpeg命令提取音视频数据

保留封装格式    

ffmpeg -i test.mp4 -acodec copy -vn audio.mp4       

ffmpeg -i test.mp4 -vcodec copy -an video.mp4 

提取视频        

保留编码格式:ffmpeg -i test.mp4 -vcodec copy -an test_copy.h264       

强制格式:ffmpeg -i test.mp4 -vcodec libx264 -an test.h264 

提取音频         

保留编码格式:ffmpeg -i test.mp4 -acodec copy -vn test.aac       

强制格式:ffmpeg -i test.mp4 -acodec libmp3lame -vn test.mp3

ffmpeg命令提取像素格式

提取YUV

提取3秒数据,分辨率和源视频一致     

    ffmpeg -i test_1280x720.mp4 -t 3 -pix_fmt yuv420p yuv420p_orig.yuv 

提取3秒数据,分辨率转为320x240     

    ffmpeg -i test_1280x720.mp4 -t 3 -pix_fmt yuv420p -s 320x240 yuv420p_320x240.yuv 

提取RGB 

提取3秒数据,分辨率转为320x240     

    ffmpeg -i test.mp4 -t 3 -pix_fmt rgb24 -s 320x240 rgb24_320x240.rgb 

RGB和YUV之间的转换       

    ffmpeg -s 320x240 -pix_fmt yuv420

你可能感兴趣的:(音视频,c++,开发语言,ffmpeg)