{"id":728,"date":"2017-12-05T07:47:26","date_gmt":"2017-12-04T21:47:26","guid":{"rendered":"http:\/\/www.nickdu.com\/?p=728"},"modified":"2017-12-05T07:47:26","modified_gmt":"2017-12-04T21:47:26","slug":"ffmpeg-is-very-handy-utility-to-edit-multimedia-file","status":"publish","type":"post","link":"https:\/\/nickdu.com\/?p=728","title":{"rendered":"FFmpeg is very handy utility to edit multimedia file"},"content":{"rendered":"<p><a href=\"https:\/\/www.ffmpeg.org\/\" target=\"_blank\" rel=\"noopener\">FFmpeg<\/a>\u00a0is very powerful open source multimedia tool. The source code is hosted at\u00a0<a href=\"https:\/\/github.com\/FFmpeg\/FFmpeg\" target=\"_blank\" rel=\"noopener\">https:\/\/github.com\/FFmpeg\/FFmpeg<\/a>, and the pre-compiled binary version can be found at\u00a0<a href=\"https:\/\/ffmpeg.zeranoe.com\/builds\/\" target=\"_blank\" rel=\"noopener\">https:\/\/ffmpeg.zeranoe.com\/builds\/<\/a>. However, sometimes, it not user friendly, and you have to remember many parameters.<\/p>\n<p>Here are some samples, which I regular used:<\/p>\n<p>Converting video and audio into different format<\/p>\n<pre>$ ffmpeg -i input.mp4 output.avi<\/pre>\n<p>Compressing video<\/p>\n<pre>$ ffmpeg -i input.mp4 -s 640x360 output.mp4<\/pre>\n<p>Changing bitrate<\/p>\n<pre>$ ffmpeg.exe -i input.avi -b 3000k  -maxrate 4000k -bufsize 1835k output.avi<\/pre>\n<p>Concating video<\/p>\n<pre>$ ffmpeg.exe -f concat -i filelist.txt -c copy concat.avi<\/pre>\n<p>filelist.txt<\/p>\n<pre>file '1.AVI'   \nfile '2.AVI'   \nfile '3.AVI'\n<\/pre>\n<p>Remove audio from video file<\/p>\n<pre>$ ffmpeg -i input.mp4 -c copy -an output.mp4<\/pre>\n<p>Extract audio from video<\/p>\n<pre>$ ffmpeg -i input.avi -vn -acodec copy output.aac<\/pre>\n<p>Combining audio into video<\/p>\n<pre>$ ffmpeg -i video.mp4 -i audio.m4a -c:v copy -c:a copy output.mp4<\/pre>\n<p>Cutting the videos based on start and end time<\/p>\n<pre>$ ffmpeg -i input.mp4 -ss 00:00:45 -codec copy -t 40 output.mp4<\/pre>\n<p>Adding audio into video file on start and time<\/p>\n<pre>$ ffmpeg -i video.mp4 -ss 00:04:00 -i audio.mp3 -c copy -t 40 output.mkv<\/pre>\n<p>Adding Poster Image to an Audio File<\/p>\n<pre>$ ffmpeg -loop 1 -y -i image.jpg -i audio.mp3 -acodec copy -vcode\nc libx264 -shortest ouput.mp4<\/pre>\n<p>Download m3u8 url and save as MP4 file<\/p>\n<pre>$ ffmpeg -i \"http:\/\/url\/file.m3u8\" ouput.mp4<\/pre>\n\n\n<p><\/p>\n","protected":false},"excerpt":{"rendered":"<p>FFmpeg\u00a0is very powerful open source multimedia tool. The source code is hosted at\u00a0https:\/\/github.com\/FFmpeg\/FFmpeg, and the pre-compiled binary version can be found at\u00a0https:\/\/ffmpeg.zeranoe.com\/builds\/. However, sometimes, it not user friendly, and you have to remember many parameters. Here are some samples, which I regular used: Converting video and audio into different format $ ffmpeg -i input.mp4 output.avi &hellip; <a href=\"https:\/\/nickdu.com\/?p=728\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;FFmpeg is very handy utility to edit multimedia file&#8221;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[2],"tags":[14],"class_list":["post-728","post","type-post","status-publish","format-standard","hentry","category-it","tag-ffmpeg"],"_links":{"self":[{"href":"https:\/\/nickdu.com\/index.php?rest_route=\/wp\/v2\/posts\/728","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/nickdu.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/nickdu.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/nickdu.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/nickdu.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=728"}],"version-history":[{"count":0,"href":"https:\/\/nickdu.com\/index.php?rest_route=\/wp\/v2\/posts\/728\/revisions"}],"wp:attachment":[{"href":"https:\/\/nickdu.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=728"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/nickdu.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=728"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/nickdu.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=728"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}