{"id":8418,"date":"2020-01-25T04:59:26","date_gmt":"2020-01-25T04:59:26","guid":{"rendered":"https:\/\/stevepedwards.today\/DebianAdmin\/?p=8418"},"modified":"2022-08-14T18:32:48","modified_gmt":"2022-08-14T17:32:48","slug":"joining-mp4-video-files-concatenating","status":"publish","type":"post","link":"https:\/\/stevepedwards.today\/DebianAdmin\/joining-mp4-video-files-concatenating\/","title":{"rendered":"Joining\/Sizing MP4 Video Files"},"content":{"rendered":"<div class=\"pvc_clear\"><\/div>\n<p id=\"pvc_stats_8418\" class=\"pvc_stats all  \" data-element-id=\"8418\" style=\"\"><i class=\"pvc-stats-icon medium\" aria-hidden=\"true\"><svg aria-hidden=\"true\" focusable=\"false\" data-prefix=\"far\" data-icon=\"chart-bar\" role=\"img\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" viewBox=\"0 0 512 512\" class=\"svg-inline--fa fa-chart-bar fa-w-16 fa-2x\"><path fill=\"currentColor\" d=\"M396.8 352h22.4c6.4 0 12.8-6.4 12.8-12.8V108.8c0-6.4-6.4-12.8-12.8-12.8h-22.4c-6.4 0-12.8 6.4-12.8 12.8v230.4c0 6.4 6.4 12.8 12.8 12.8zm-192 0h22.4c6.4 0 12.8-6.4 12.8-12.8V140.8c0-6.4-6.4-12.8-12.8-12.8h-22.4c-6.4 0-12.8 6.4-12.8 12.8v198.4c0 6.4 6.4 12.8 12.8 12.8zm96 0h22.4c6.4 0 12.8-6.4 12.8-12.8V204.8c0-6.4-6.4-12.8-12.8-12.8h-22.4c-6.4 0-12.8 6.4-12.8 12.8v134.4c0 6.4 6.4 12.8 12.8 12.8zM496 400H48V80c0-8.84-7.16-16-16-16H16C7.16 64 0 71.16 0 80v336c0 17.67 14.33 32 32 32h464c8.84 0 16-7.16 16-16v-16c0-8.84-7.16-16-16-16zm-387.2-48h22.4c6.4 0 12.8-6.4 12.8-12.8v-70.4c0-6.4-6.4-12.8-12.8-12.8h-22.4c-6.4 0-12.8 6.4-12.8 12.8v70.4c0 6.4 6.4 12.8 12.8 12.8z\" class=\"\"><\/path><\/svg><\/i> <img loading=\"lazy\" decoding=\"async\" width=\"16\" height=\"16\" alt=\"Loading\" src=\"https:\/\/stevepedwards.today\/DebianAdmin\/wp-content\/plugins\/page-views-count\/ajax-loader-2x.gif\" border=0 \/><\/p>\n<div class=\"pvc_clear\"><\/div>\n<p><span style=\"color: #0000ff;\">sudo apt install ffmpeg<\/span><\/p>\n<p><span style=\"color: #0000ff;\">ffmpeg -i input.avi -vf scale=\"720:-1\" output.avi<\/span><\/p>\n<p>Shrink size<br \/>\n<span style=\"color: #0000ff;\">ffmpeg -i \/media\/stevee\/489EB74C63B82B0E\/ Iquitos.mp4 -vcodec libx264 -s hd720 -crf 25 -vf copy Dieta3Iquitos.mp4<\/span><\/p>\n<p>Merge vids:<br \/>\nLet,s create the list first. Here is an example and let us call the list fileList.txt. In this example, both the files are in the home directory. each line starts with the keyword file and contains the path of the file within single quotes.<\/p>\n<p>$ <span style=\"color: #0000ff;\">cat fileList.txt<\/span><br \/>\nfile '\/home\/file1.mp4'<br \/>\nfile '\/home\/file1.mp4'<\/p>\n<p>Now, you can concatenate them.<br \/>\nERROR : More than 1000 frames duplicatedsing the following FFmpeg command<\/p>\n<p><span style=\"color: #0000ff;\">ffmpeg -f concat -safe 0 -i fileList.txt -c copy mergedVideo.mp4<\/span><\/p>\n<p><span style=\"color: #0000ff;\">ffmpeg -i input.wav -vn -ar 44100 -ac 2 -b:a 192k output.mp3<\/span><\/p>\n<p>FOR Truncated vids, no MOOV data at end<br \/>\n<span style=\"color: #0000ff;\">ffmpeg -i Desktop\/FOLVids\/day2postPedro2AppleRitual.mp4 -vcodec copy -acodec copy -movflags faststart Desktop\/apple.mp4<\/span><\/p>\n<p><span style=\"color: #0000ff;\">ffplay \/media\/stevee\/A08A-A20D\/C26Edit1.mp4<\/span><\/p>\n<p>Trim sections, cuts WANTED sections to new file, then merge all WANTED cuts using above Concat with List:<br \/>\n<span style=\"color: #0000ff;\">ffmpeg -i C26C.mp4 -ss 00:00 -to 01:01 -c:v libx264 -crf 25 P1Edit.mp4<\/span><\/p>\n<p><span style=\"color: #0000ff;\">ffprobe C23.mp4<\/span>:<br \/>\nInput #0, mov,mp4,m4a,3gp,3g2,mj2, from 'C23.mp4':<br \/>\nMetadata:<br \/>\nmajor_brand : isom<br \/>\nminor_version : 512<br \/>\ncompatible_brands: isomiso2avc1mp41<br \/>\nencoder : Lavf57.83.100<br \/>\nDuration: 00:02:31.10, start: 0.000000, bitrate: 5921 kb\/s<br \/>\nStream #0:0(eng): Video: h264 (High) (avc1 \/ 0x31637661), yuv420p, 1280x720 [SAR 1:1 DAR 16:9], 5843 kb\/s, 30 fps, 30 tbr, 15360 tbn, 60 tbc (default)<br \/>\nMetadata:<br \/>\nhandler_name : VideoHandler<br \/>\nStream #0:1(eng): Audio: aac (LC) (mp4a \/ 0x6134706D), 48000 Hz, mono, fltp, 69 kb\/s (default)<br \/>\nMetadata:<br \/>\nhandler_name : SoundHandler<\/p>\n<p>REMOVE AUDIO STREAM<br \/>\n<span style=\"color: #0000ff;\">ffmpeg -i Desktop\/100VIDEO\/HikeRape.MOV -c copy -an \/media\/stevee\/36BC-884B\/Movies\/HikeRape.mov<\/span><\/p>\n<p>ADD AUDIO AND CHANGE FORMAT (e.g. after mp3 has been normalised in Audacity)<br \/>\n<span style=\"color: #0000ff;\">ffmpeg -i Desktop\/100VIDEO\/XimenaHikeIkaro.MOV -i Desktop\/100VIDEO\/XimenaHikeIkaro.mp3 -map 0:v -map 1:a -c:v copy -shortest \/media\/stevee\/36BC-884B\/hikemp3.mp4<\/span><\/p>\n","protected":false},"excerpt":{"rendered":"<div class=\"pvc_clear\"><\/div>\n<p id=\"pvc_stats_8418\" class=\"pvc_stats all  \" data-element-id=\"8418\" style=\"\"><i class=\"pvc-stats-icon medium\" aria-hidden=\"true\"><svg aria-hidden=\"true\" focusable=\"false\" data-prefix=\"far\" data-icon=\"chart-bar\" role=\"img\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" viewBox=\"0 0 512 512\" class=\"svg-inline--fa fa-chart-bar fa-w-16 fa-2x\"><path fill=\"currentColor\" d=\"M396.8 352h22.4c6.4 0 12.8-6.4 12.8-12.8V108.8c0-6.4-6.4-12.8-12.8-12.8h-22.4c-6.4 0-12.8 6.4-12.8 12.8v230.4c0 6.4 6.4 12.8 12.8 12.8zm-192 0h22.4c6.4 0 12.8-6.4 12.8-12.8V140.8c0-6.4-6.4-12.8-12.8-12.8h-22.4c-6.4 0-12.8 6.4-12.8 12.8v198.4c0 6.4 6.4 12.8 12.8 12.8zm96 0h22.4c6.4 0 12.8-6.4 12.8-12.8V204.8c0-6.4-6.4-12.8-12.8-12.8h-22.4c-6.4 0-12.8 6.4-12.8 12.8v134.4c0 6.4 6.4 12.8 12.8 12.8zM496 400H48V80c0-8.84-7.16-16-16-16H16C7.16 64 0 71.16 0 80v336c0 17.67 14.33 32 32 32h464c8.84 0 16-7.16 16-16v-16c0-8.84-7.16-16-16-16zm-387.2-48h22.4c6.4 0 12.8-6.4 12.8-12.8v-70.4c0-6.4-6.4-12.8-12.8-12.8h-22.4c-6.4 0-12.8 6.4-12.8 12.8v70.4c0 6.4 6.4 12.8 12.8 12.8z\" class=\"\"><\/path><\/svg><\/i> <img loading=\"lazy\" decoding=\"async\" width=\"16\" height=\"16\" alt=\"Loading\" src=\"https:\/\/stevepedwards.today\/DebianAdmin\/wp-content\/plugins\/page-views-count\/ajax-loader-2x.gif\" border=0 \/><\/p>\n<div class=\"pvc_clear\"><\/div>\n<p>sudo apt install ffmpeg ffmpeg -i input.avi -vf scale=\"720:-1\" output.avi Shrink size ffmpeg -i \/media\/stevee\/489EB74C63B82B0E\/ Iquitos.mp4 -vcodec libx264 -s hd720 -crf 25 -vf copy Dieta3Iquitos.mp4 Merge vids: Let,s create the list first. Here is an example and let us call the list fileList.txt. In this example, both the files are in the home directory. each <a href=\"https:\/\/stevepedwards.today\/DebianAdmin\/joining-mp4-video-files-concatenating\/\" class=\"more-link\">...<span class=\"screen-reader-text\">\u00a0 Joining\/Sizing MP4 Video Files<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-8418","post","type-post","status-publish","format-standard","hentry","category-uncategorised"],"a3_pvc":{"activated":true,"total_views":1,"today_views":0},"_links":{"self":[{"href":"https:\/\/stevepedwards.today\/DebianAdmin\/wp-json\/wp\/v2\/posts\/8418","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/stevepedwards.today\/DebianAdmin\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/stevepedwards.today\/DebianAdmin\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/stevepedwards.today\/DebianAdmin\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/stevepedwards.today\/DebianAdmin\/wp-json\/wp\/v2\/comments?post=8418"}],"version-history":[{"count":3,"href":"https:\/\/stevepedwards.today\/DebianAdmin\/wp-json\/wp\/v2\/posts\/8418\/revisions"}],"predecessor-version":[{"id":8704,"href":"https:\/\/stevepedwards.today\/DebianAdmin\/wp-json\/wp\/v2\/posts\/8418\/revisions\/8704"}],"wp:attachment":[{"href":"https:\/\/stevepedwards.today\/DebianAdmin\/wp-json\/wp\/v2\/media?parent=8418"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/stevepedwards.today\/DebianAdmin\/wp-json\/wp\/v2\/categories?post=8418"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/stevepedwards.today\/DebianAdmin\/wp-json\/wp\/v2\/tags?post=8418"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}