{"id":1293,"date":"2019-10-13T01:56:16","date_gmt":"2019-10-13T01:56:16","guid":{"rendered":"https:\/\/www.ipcpu.com\/?p=1293"},"modified":"2020-01-16T08:34:57","modified_gmt":"2020-01-16T08:34:57","slug":"ffmpeg-basic","status":"publish","type":"post","link":"https:\/\/c.ipcpu.com\/2019\/10\/ffmpeg-basic\/","title":{"rendered":"ffmpeg\u7684\u57fa\u672c\u6982\u8ff0\u3001\u5b89\u88c5\u3001\u5e38\u7528\u6848\u4f8b\u548c\u547d\u4ee4"},"content":{"rendered":"

ffmpeg\u7684\u5b89\u88c5\u3001\u5e38\u7528\u6848\u4f8b\u548c\u547d\u4ee4.md<\/p>\n

\u96f6\u3001\u6982\u8ff0<\/h2>\n

FFmpeg\u662f\u4e00\u6b3e\u97f3\u89c6\u9891\u7f16\u89e3\u7801\u5e93\uff0c\u662f\u591a\u5a92\u4f53\u5f00\u53d1\u8005\u7684\u5fc5\u5907\u6280\u80fd\u3002FFmepg\u63d0\u4f9b\u4e86\u591a\u79cd\u5a92\u4f53\u683c\u5f0f\u7684\u5c01\u88c5\u548c\u89e3\u5c01\u88c5\uff0c\u5305\u62ec\u97f3\u89c6\u9891\u7f16\u7801\u3001\u591a\u79cd\u534f\u8bae\u7684\u6d41\u5a92\u4f53\u3001\u591a\u79cd\u8272\u5f69\u683c\u5f0f\u8f6c\u6362\u3001\u591a\u79cd\u91c7\u6837\u7387\u8f6c\u6362\u3001\u591a\u79cd\u7801\u7387\u8f6c\u6362\u7b49\u3002<\/p>\n

\u4e00\u3001FFmepg\u7684\u57fa\u672c\u7ec4\u6210<\/h2>\n

FFmpeg\u6846\u67b6\u7684\u57fa\u672c\u7ec4\u6210\u5305\u542bAVFormat\u3001AVCodec\u3001AVFilter\u3001AVDevice\u3001AVUtil\u7b49\u6a21\u5757\u5e93\u3002
\n<\/p>\n

\uff081.1\uff09FFmpeg\u7684\u5c01\u88c5\u6a21\u5757AVFormat<\/h4>\n

AVFormat\u5b9e\u73b0\u4e86\u591a\u5a92\u4f53\u9886\u57df\u7edd\u5927\u6570\u5a92\u4f53\u5c01\u88c5\u683c\u5f0f\uff0c\u5305\u62ec\u5c01\u88c5\u548c\u89e3\u5c01\u88c5\uff0c\u5982MP4\u3001FLV\u3001KV\u3001 TS\u7b49\u6587\u4ef6\u5c01\u88c5\u683c\u5f0f\uff0cRTMP\u3001RTSP\u3001MMS\u3001HLS\u7b49\u7f51\u7edc\u534f\u8bae\u5c01\u88c5\u683c\u5f0f\u3002FFmepg\u662f\u5426\u652f\u6301\u67d0\u79cd\u5a92\u4f53\u5c01\u88c5\u683c\u5f0f\u53d6\u51b3\u4e8e\u7f16\u8bd1\u65f6\u662f\u5426\u5305\u542b\u4e86\u8be5\u683c\u5f0f\u7684\u5c01\u88c5\u5e93\u3002<\/p>\n

\uff081.2\uff09FFmpeg\u7684\u7f16\u89e3\u7801\u6a21\u5757AVCodec<\/h4>\n

AVCodec\u5305\u62ec\u5927\u591a\u6570\u5e38\u7528\u7684\u7f16\u89e3\u7801\u683c\u5f0f\uff0c\u65e2\u652f\u6301\u7f16\u7801\u4e5f\u652f\u6301\u89e3\u7801\u3002\u9664\u4e86\u652f\u6301MPEG4\u3001AAC\u3001MJPEG\u7b49\u81ea\u5e26\u7684\u5a92\u4f53\u683c\u5f0f\u4e5f\u652f\u6301H.264\uff08x264\u7f16\u7801\u5668\uff09\u3001H.265\uff08X265\u7f16\u7801\u5668\uff09\u3001MP3\uff08libMP3lame\u7f16\u7801\u5668\uff09\u3002<\/p>\n

\uff081.3\uff09FFmepg\u7684\u6ee4\u955c\u6a21\u5757AVFilter<\/h4>\n

AVFilter\u5e93\u63d0\u4f9b\u4e86\u4e00\u4e2a\u901a\u7528\u7684\u97f3\u9891\u3001\u89c6\u9891\u3001\u5b57\u5e55\u7b49\u6ee4\u955c\u5904\u7406\u6846\u67b6\u3002\u5728AVFilter\u4e2d\uff0c\u6ee4\u955c\u6846\u67b6\u53ef\u4ee5\u6709\u591a\u4e2a\u8f93\u5165\u548c\u591a\u4e2a\u8f93\u51fa\u3002<\/p>\n

\uff081.4\uff09FFmpeg\u7684\u89c6\u9891\u56fe\u50cf\u8f6c\u6362\u8ba1\u7b97\u6a21\u5757swscale<\/h4>\n

swscale\u6a21\u5757\u63d0\u4f9b\u4e86\u9ad8\u7ea7\u522b\u7684\u56fe\u50cf\u8f6c\u6362API\uff0c\u5b83\u80fd\u591f\u5bf9\u56fe\u50cf\u8fdb\u884c\u7f29\u653e\u548c\u50cf\u7d20\u683c\u5f0f\u8f6c\u6362\u3002<\/p>\n

\uff081.5\uff09FFmpeg\u7684\u97f3\u9891\u8f6c\u6362\u8ba1\u7b97\u6a21\u5757swresample<\/h4>\n

swresample\u63d0\u4f9b\u4e86\u97f3\u9891\u91cd\u91c7\u6837API\uff0c\u652f\u6301\u97f3\u9891\u91c7\u6837\u3001\u97f3\u9891\u901a\u9053\u5e03\u5c40\u3001\u5e03\u5c40\u8c03\u6574\u3002<\/p>\n

\u4e8c\u3001FFmpeg\u5b89\u88c5<\/h2>\n

FFmpeg\u53ef\u4ee5\u7f16\u8bd1\u5b89\u88c5\uff0c\u4e5f\u53ef\u4ee5\u4f7f\u7528RPM\u5305\u5b89\u88c5\uff0c\u52a0\u5165\u4f7f\u7528\u7684\u662fCentOS7 \uff0c\u9700\u8981\u5b89\u88c5RPMFusion\uff08Free\u7248\u672c\uff09\u5e93\u6765\u8fdb\u884c\u5b89\u88c5
\nhttps:\/\/rpmfusion.org\/Configuration<\/a><\/p>\n

\n
yum install https:\/\/download1.rpmfusion.org\/free\/el\/rpmfusion-free-release-7.noarch.rpm -y\r\nyum install ffmpeg -y<\/code><\/pre>\n<\/div>\n

\u4e09\u3001FFmpeg\u7684\u5de5\u4f5c\u6a21\u5f0f<\/h2>\n

<\/p>\n

\n
ffmpeg -i input.mp4 output.avi<\/code><\/pre>\n<\/div>\n

\u5982\u4e0a\u56fe\u663e\u793a\u4e86ffmpeg\u7684\u5de5\u4f5c\u6a21\u5f0f\uff0cffmpeg\u9996\u5148\u8bfb\u53d6\u8f93\u5165\u6e90\uff0c\u7136\u540e\u901a\u8fc7Demuxer\u5c06\u97f3\u89c6\u9891\u5305\u8fdb\u884c\u89e3\u5c01\u88c5\uff0c\u8fd9\u4e2a\u52a8\u4f5c\u901a\u8fc7\u8c03\u7528libavformat\u4e2d\u7684\u63a5\u53e3\u5373\u53ef\u5b9e\u73b0\uff1b\u63a5\u7740\u901a\u8fc7Decoder\u8fdb\u884c\u89e3\u7801\uff0c\u5c06\u97f3\u89c6\u9891\u901a\u8fc7Decoder\u89e3\u5305\u4e3aYUV\u6216\u8005PCM\u8fd9\u6837\u7684\u6570\u636e\uff0cDecoder\u901a\u8fc7libavcodec\u4e2d\u7684\u63a5\u53e3\u5373\u53ef\u5b9e\u73b0\uff1b\u7136\u540e\u901a\u8fc7Encoder\u5c06\u5bf9\u5e94\u7684\u6570\u636e\u8fdb\u884c\u7f16\u7801\uff0c\u7f16\u7801\u53ef\u4ee5\u901a\u8fc7libavcodec\u4e2d\u7684\u63a5\u53e3\u5b9e\u73b0\uff1b\u63a5\u4e0b\u6765\u5c06\u7f16\u7801\u540e\u7684\u97f3\u89c6\u9891\u6570\u636e\u5305\u901a\u8fc7Muxer\u8fdb\u884c\u5c01\u88c5\uff0cMuxer\u5c01\u88c5\u901a\u8fc7libavformat\u4e2d\u7684\u63a5\u53e3\u5373\u53ef\u5b9e\u73b0\uff0c\u8f93\u51fa\u6210\u4e3a\u8f93\u51fa\u6d41\u3002<\/p>\n

\u56db\u3001\u4f7f\u7528ffprobe\u547d\u4ee4\u5206\u6790\u5a92\u4f53\u6587\u4ef6<\/h2>\n

<\/p>\n

\u9996\u5148\u6211\u4eec\u770b\u5230\u4e00\u5927\u5806\u7684FFmpeg\u7f16\u8bd1\u4fe1\u606f\uff0c\u63a5\u4e0b\u6765\u662f\u6587\u4ef6\u7684MetaData\u4fe1\u606f\uff0c\u7136\u540e\u53ef\u4ee5\u770b\u5230\u6587\u4ef6\u65f6\u957f\u4e24\u5c0f\u65f619\u5206\u949f\uff0c\u6bd4\u7279\u73871333kbps\uff0c\u63a5\u4e0b\u6765\u662f\u89c6\u9891\u4fe1\u606f\u548c\u97f3\u9891\u4fe1\u606f\u3002\u6211\u4eec\u53ef\u4ee5\u770b\u5230\u89c6\u9891\u662fh264\u5206\u8fa8\u73871280x720\u7b49\u7b49\u3002<\/p>\n

\u4e94\u3001FFmpeg\u5e38\u7528\u6848\u4f8b\u548c\u547d\u4ee4<\/h2>\n

5.1 \u89c6\u9891\u8f6c\u6362<\/h4>\n

\u6bd4\u5982\u4e00\u4e2aavi\u6587\u4ef6\uff0c\u60f3\u8f6c\u4e3amp4<\/p>\n

\n
ffmpeg -i input.avi output.mp4\r\n#\u82e5mkv\u4e2d\u4f7f\u7528mp4\u683c\u5f0f\uff0c\u53ef\u4ee5\u76f4\u63a5\u62f7\u51fa\uff0c\u901f\u5ea6\u5feb\uff0c\u79d2\u7ea7\r\nffmpeg -i test.mkv -c:v copy -c:a copy test.mp4\r\n<\/code><\/pre>\n<\/div>\n

5.2 \u89c6\u9891\u5207\u5272\u622a\u53d6<\/h4>\n

\u4e0b\u9762\u7684\u547d\u4ee4\uff0c\u53ef\u4ee5\u4ece\u65f6\u95f4\u4e3a00:00:15\u5f00\u59cb\uff0c\u622a\u53d65\u79d2\u949f\u7684\u89c6\u9891\u3002<\/p>\n

\n
ffmpeg -ss 00:00:15 -t 00:00:05 -i input.mp4 -vcodec copy -acodec copy output.mp4<\/code><\/pre>\n<\/div>\n

-ss\u8868\u793a\u5f00\u59cb\u5207\u5272\u7684\u65f6\u95f4\uff0c-t\u8868\u793a\u8981\u5207\u591a\u5c11\u3002\u4e0a\u9762\u5c31\u662f\u4ece15\u79d2\u5f00\u59cb\uff0c\u52075\u79d2\u949f\u51fa\u6765\u3002<\/p>\n

5.3 \u7f29\u5c0f\u89c6\u9891\u5206\u8fa8\u7387<\/h4>\n
\n
ffmpeg -i input.mp4 -vf scale=960:540 output.mp4<\/code><\/pre>\n<\/div>\n

\u5199\u6210scale=960:-1, \u90a3\u4e5f\u662f\u53ef\u4ee5\u7684\uff0cffmpeg\u4f1a\u901a\u77e5\u7f29\u653e\u6ee4\u955c\u5728\u8f93\u51fa\u65f6\u4fdd\u6301\u539f\u59cb\u7684\u5bbd\u9ad8\u6bd4\u3002<\/p>\n

5.4 \u538b\u7f29\u89c6\u9891(\u89c6\u89c9\u4e0a\u65e0\u635f)<\/h4>\n
\n
ffmpeg -i test1.mp4 -vf scale=960:-1 -c:v libx264 -preset veryslow -crf 18 -c:a copy test1-mini.mp4\r\n\r\nffmpeg -i test1.mp4 -c:v libx264 -preset veryslow -crf 18 -c:a copy test1-mini.mp4\r\n<\/code><\/pre>\n<\/div>\n

\u8c03\u6574-crf\u53c2\u6570\u503c\uff0c18-28\u662f\u4e00\u4e2a\u5408\u7406\u7684\u8303\u56f4\u300218\u88ab\u8ba4\u4e3a\u662f\u89c6\u89c9\u65e0\u635f\u7684\uff08\u4ece\u6280\u672f\u89d2\u5ea6\u4e0a\u770b\u5f53\u7136\u8fd8\u662f\u6709\u635f\u7684\uff09\uff0c\u5b83\u7684\u8f93\u51fa\u89c6\u9891\u8d28\u91cf\u548c\u8f93\u5165\u89c6\u9891\u76f8\u5f53\uff0c\u6570\u503c\u8d8a\u5927\u89c6\u9891\u8d28\u91cf\u8d8a\u5dee\u3002<\/p>\n

5.5 (\u5267\u60c5\u8fde\u62cd)<\/h4>\n
\n
ffmpeg -i test1.mp4 -vf 'fps=1\/60,scale=540:250,tile=3x5' -f image2 -y test1-srnsht-%d.jpg\r\n\r\n#\u6bcf60\u79d2\u622a\u53d6\u4e00\u5f20\uff0c\u5355\u5f20\u56fe\u7247\u5bbd540px\u9ad8250px\uff0c\u6bcf\u5f20\u6c47\u603b\u56fe\u653e5\u884c\uff0c\u6bcf\u884c3\u5f20\u56fe\u7247\u3002<\/code><\/pre>\n<\/div>\n

\u4e0eQQ\u5f71\u97f3\u4e0d\u4e00\u6837\u7684\u662f\uff0c\u8fd9\u91cc\u7684\u56fe\u7247\u53ef\u4ee5\u6709\u597d\u591a\u5f20\uff0cQQ\u5f71\u97f3\u53ea\u4f1a\u51fa\u4e00\u5f20\uff0c\u5e76\u4e14\u4e0d\u80fd\u63a7\u5236\u622a\u53d6\u65f6\u95f4\u3002<\/p>\n

5.6 \u5c06\u89c6\u9891\u8f6c\u4e3aHLS(m3u8)<\/h4>\n
\n
ffmpeg -i sample.mp4 -c copy -bsf:v h264_mp4toannexb -hls_time 6 -hls_list_size 0 -hls_segment_filename \"output\/%04d.ts\" \"output\/video.m3u8\"<\/code><\/pre>\n<\/div>\n

hls_time\u6307\u5b9a\u6bcf\u6bb5TS\u89c6\u9891\u7684\u65f6\u957f\uff0c\u672c\u4f8b\u4e3a6\u79d2\u3002\u4f1a\u5728output\u76ee\u5f55\u751f\u6210m3u8\u7d22\u5f15\u548cts\u89c6\u9891\u6587\u4ef6\u3002<\/p>\n

\u53c2\u8003\u8d44\u6599<\/h2>\n

<\/p>\n

<\/div>\n
<\/div>\n
\n
<\/div>\n
<\/div>\n
<\/div>\n
<\/div>\n
<\/div>\n<\/div>\n
\n
<\/div>\n
<\/div>\n
<\/div>\n
<\/div>\n
<\/div>\n<\/div>\n

<\/wiz_tmp_tag><\/p>\n

\u8f6c\u8f7d\u8bf7\u6ce8\u660e\uff1aIPCPU-\u7f51\u7edc\u4e4b\u8def<\/a> » ffmpeg\u7684\u57fa\u672c\u6982\u8ff0\u3001\u5b89\u88c5\u3001\u5e38\u7528\u6848\u4f8b\u548c\u547d\u4ee4<\/a><\/p>","protected":false},"excerpt":{"rendered":"

ffmpeg\u7684\u5b89\u88c5\u3001\u5e38\u7528\u6848\u4f8b\u548c\u547d\u4ee4.md \u96f6\u3001\u6982\u8ff0 FFmpeg\u662f\u4e00\u6b3e\u97f3\u89c6\u9891\u7f16\u89e3\u7801\u5e93\uff0c\u662f\u591a\u5a92\u4f53\u5f00\u53d1\u8005\u7684\u5fc5\u5907\u6280\u80fd\u3002FFmepg\u63d0\u4f9b\u4e86\u591a\u79cd\u5a92\u4f53\u683c\u5f0f\u7684\u5c01\u88c5\u548c\u89e3\u5c01\u88c5\uff0c\u5305\u62ec\u97f3\u89c6\u9891\u7f16\u7801\u3001\u591a\u79cd\u534f\u8bae\u7684\u6d41\u5a92\u4f53\u3001\u591a\u79cd\u8272\u5f69\u683c\u5f0f\u8f6c\u6362\u3001\u591a\u79cd\u91c7\u6837\u7387\u8f6c\u6362\u3001\u591a\u79cd\u7801\u7387\u8f6c\u6362\u7b49\u3002 \u4e00\u3001FFmepg\u7684\u57fa\u672c\u7ec4\u6210 FFmpeg\u6846\u67b6\u7684\u57fa\u672c\u7ec4\u6210\u5305\u542bAVFormat\u3001AVCodec\u3001AVFilter\u3001AVDevice\u3001AVUtil\u7b49\u6a21\u5757\u5e93\u3002 \uff081.1\uff09FFmpeg\u7684\u5c01\u88c5\u6a21\u5757AVFormat AVFormat\u5b9e\u73b0\u4e86\u591a\u5a92\u4f53\u9886\u57df\u7edd\u5927\u6570\u5a92\u4f53\u5c01\u88c5\u683c\u5f0f\uff0c\u5305\u62ec\u5c01\u88c5\u548c\u89e3\u5c01\u88c5\uff0c\u5982MP4\u3001FLV\u3001KV\u3001 TS\u7b49\u6587\u4ef6\u5c01\u88c5\u683c\u5f0f\uff0cRTMP\u3001RTSP\u3001MMS\u3001HLS\u7b49\u7f51\u7edc\u534f\u8bae\u5c01\u88c5\u683c\u5f0f\u3002FFmepg\u662f\u5426\u652f\u6301\u67d0\u79cd\u5a92\u4f53\u5c01\u88c5\u683c\u5f0f\u53d6\u51b3\u4e8e\u7f16\u8bd1\u65f6\u662f\u5426\u5305\u542b\u4e86\u8be5\u683c\u5f0f\u7684\u5c01\u88c5\u5e93\u3002 \uff081.2\uff09FFmpeg\u7684\u7f16\u89e3\u7801\u6a21\u5757AVCodec AVCodec\u5305\u62ec\u5927\u591a\u6570\u5e38\u7528\u7684\u7f16\u89e3\u7801\u683c\u5f0f\uff0c\u65e2\u652f\u6301\u7f16\u7801\u4e5f\u652f\u6301\u89e3\u7801\u3002\u9664\u4e86\u652f\u6301MPEG4\u3001AAC\u3001MJPEG\u7b49\u81ea\u5e26\u7684\u5a92\u4f53\u683c\u5f0f\u4e5f\u652f\u6301H.264\uff08x264\u7f16\u7801\u5668\uff09\u3001H.265\uff08X265\u7f16\u7801\u5668\uff09\u3001MP3\uff08libMP3lame\u7f16\u7801\u5668\uff09\u3002 \uff081.3\uff09FFmepg\u7684\u6ee4\u955c\u6a21\u5757AVFilter AVFilter\u5e93\u63d0\u4f9b\u4e86\u4e00\u4e2a\u901a\u7528\u7684\u97f3\u9891\u3001\u89c6\u9891\u3001\u5b57\u5e55\u7b49\u6ee4\u955c\u5904\u7406\u6846\u67b6\u3002\u5728AVFilter\u4e2d\uff0c\u6ee4\u955c\u6846\u67b6\u53ef\u4ee5\u6709\u591a\u4e2a\u8f93\u5165\u548c\u591a\u4e2a\u8f93\u51fa\u3002 \uff081.4\uff09FFmpeg\u7684\u89c6\u9891\u56fe\u50cf\u8f6c\u6362\u8ba1\u7b97\u6a21\u5757swscale swscale\u6a21\u5757\u63d0\u4f9b\u4e86\u9ad8\u7ea7\u522b\u7684\u56fe\u50cf\u8f6c\u6362API\uff0c\u5b83\u80fd\u591f\u5bf9\u56fe\u50cf\u8fdb\u884c\u7f29\u653e\u548c\u50cf\u7d20\u683c\u5f0f\u8f6c\u6362\u3002 \uff081.5\uff09FFmpeg\u7684\u97f3\u9891\u8f6c\u6362\u8ba1\u7b97\u6a21\u5757swresample swresample\u63d0\u4f9b\u4e86\u97f3\u9891\u91cd\u91c7\u6837API\uff0c\u652f\u6301\u97f3\u9891\u91c7\u6837\u3001\u97f3\u9891\u901a\u9053\u5e03\u5c40\u3001\u5e03\u5c40\u8c03\u6574\u3002 \u4e8c\u3001FFmpeg\u5b89\u88c5 FFmpeg\u53ef\u4ee5\u7f16\u8bd1\u5b89\u88c5\uff0c\u4e5f\u53ef\u4ee5\u4f7f\u7528RPM\u5305\u5b89\u88c5\uff0c\u52a0\u5165\u4f7f\u7528\u7684\u662fCentOS7 \uff0c\u9700\u8981\u5b89\u88c5RPMFusion\uff08Free\u7248\u672c\uff09\u5e93\u6765\u8fdb\u884c\u5b89\u88c5 https:\/\/rpmfusion.org\/Configuration yum install https:\/\/download1.rpmfusion.org\/free\/el\/rpmfusion-free-release-7.noarch.rpm -y yum install ffmpeg -y \u4e09\u3001FFmpeg\u7684\u5de5\u4f5c\u6a21\u5f0f ffmpeg -i input.mp4 output.avi \u5982\u4e0a\u56fe\u663e\u793a\u4e86ffmpeg\u7684\u5de5\u4f5c\u6a21\u5f0f\uff0cffmpeg\u9996\u5148\u8bfb\u53d6\u8f93\u5165\u6e90\uff0c\u7136\u540e\u901a\u8fc7Demuxer\u5c06\u97f3\u89c6\u9891\u5305\u8fdb\u884c\u89e3\u5c01\u88c5\uff0c\u8fd9\u4e2a\u52a8\u4f5c\u901a\u8fc7\u8c03\u7528libavformat\u4e2d\u7684\u63a5\u53e3\u5373\u53ef\u5b9e\u73b0\uff1b\u63a5\u7740\u901a\u8fc7Decoder\u8fdb\u884c\u89e3\u7801\uff0c\u5c06\u97f3\u89c6\u9891\u901a\u8fc7Decoder\u89e3\u5305\u4e3aYUV\u6216\u8005PCM\u8fd9\u6837\u7684\u6570\u636e\uff0cDecoder\u901a\u8fc7libavcodec\u4e2d\u7684\u63a5\u53e3\u5373\u53ef\u5b9e\u73b0\uff1b\u7136\u540e\u901a\u8fc7Encoder\u5c06\u5bf9\u5e94\u7684\u6570\u636e\u8fdb\u884c\u7f16\u7801\uff0c\u7f16\u7801\u53ef\u4ee5\u901a\u8fc7libavcodec\u4e2d\u7684\u63a5\u53e3\u5b9e\u73b0\uff1b\u63a5\u4e0b\u6765\u5c06\u7f16\u7801\u540e\u7684\u97f3\u89c6\u9891\u6570\u636e\u5305\u901a\u8fc7Muxer\u8fdb\u884c\u5c01\u88c5\uff0cMuxer\u5c01\u88c5\u901a\u8fc7libavformat\u4e2d\u7684\u63a5\u53e3\u5373\u53ef\u5b9e\u73b0\uff0c\u8f93\u51fa\u6210\u4e3a\u8f93\u51fa\u6d41\u3002 \u56db\u3001\u4f7f\u7528ffprobe\u547d\u4ee4\u5206\u6790\u5a92\u4f53\u6587\u4ef6 \u9996\u5148\u6211\u4eec\u770b\u5230\u4e00\u5927\u5806\u7684FFmpeg\u7f16\u8bd1\u4fe1\u606f\uff0c\u63a5\u4e0b\u6765\u662f\u6587\u4ef6\u7684MetaData\u4fe1\u606f\uff0c\u7136\u540e\u53ef\u4ee5\u770b\u5230\u6587\u4ef6\u65f6\u957f\u4e24\u5c0f\u65f619\u5206\u949f\uff0c\u6bd4\u7279\u73871333kbps\uff0c\u63a5\u4e0b\u6765\u662f\u89c6\u9891\u4fe1\u606f\u548c\u97f3\u9891\u4fe1\u606f\u3002\u6211\u4eec\u53ef\u4ee5\u770b\u5230\u89c6\u9891\u662fh264\u5206\u8fa8\u73871280×720\u7b49\u7b49\u3002 \u4e94\u3001FFmpeg\u5e38\u7528\u6848\u4f8b\u548c\u547d\u4ee4 5.1 \u89c6\u9891\u8f6c\u6362 \u6bd4\u5982\u4e00\u4e2aavi\u6587\u4ef6\uff0c\u60f3\u8f6c\u4e3amp4 ffmpeg -i input.avi output.mp4 #\u82e5mkv\u4e2d\u4f7f\u7528mp4\u683c\u5f0f\uff0c\u53ef\u4ee5\u76f4\u63a5\u62f7\u51fa\uff0c\u901f\u5ea6\u5feb\uff0c\u79d2\u7ea7 ffmpeg -i test.mkv -c:v copy -c:a copy test.mp4 5.2 \u89c6\u9891\u5207\u5272\u622a\u53d6 […]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[13],"tags":[205],"_links":{"self":[{"href":"https:\/\/c.ipcpu.com\/wp-json\/wp\/v2\/posts\/1293"}],"collection":[{"href":"https:\/\/c.ipcpu.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/c.ipcpu.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/c.ipcpu.com\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/c.ipcpu.com\/wp-json\/wp\/v2\/comments?post=1293"}],"version-history":[{"count":3,"href":"https:\/\/c.ipcpu.com\/wp-json\/wp\/v2\/posts\/1293\/revisions"}],"predecessor-version":[{"id":1297,"href":"https:\/\/c.ipcpu.com\/wp-json\/wp\/v2\/posts\/1293\/revisions\/1297"}],"wp:attachment":[{"href":"https:\/\/c.ipcpu.com\/wp-json\/wp\/v2\/media?parent=1293"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/c.ipcpu.com\/wp-json\/wp\/v2\/categories?post=1293"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/c.ipcpu.com\/wp-json\/wp\/v2\/tags?post=1293"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}