Hi there,
I have the situation, that I like to concatenate two video files (mp4), however, they are in a slightly different resolution.
Video 1 is 640x480 29.97fps, Video 2 is 480x360 24.87 fps.
The full ouput of ffmpeg info for each file is below. I have a couple of tools available (ffmpeg, mkvtoolnix, Handbrake) but, to be honest, I don’t really know how to do this job.
Appending the two files via mkvtoolnix obviously resulted in that the Video 2 file was not displayed properly (greenish artifacts), likely because of the resultion/fps mismatch when combining both files without any modifications.
I would think that the only way is probably (re-)encoding Video 1 to the smaller resolution of Video 2 and then concateninating both. Is there any “automated” way I can do this with the tools I mentioned? Something like: “adjust resolution, fps and all other parameters according to the target file of video 2” and then re-encode?
I am new to all of this and have limited knowledge of video conversion, so any help would be highly appreciated!
Code:Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'video1.mp4': Metadata: major_brand : isom minor_version : 512 compatible_brands: isomiso2avc1mp41 encoder : Lavf56.25.101 Duration: 00:26:30.99, start: 0.000000, bitrate: 833 kb/s Stream #0:0[0x1](und): Video: h264 (High) (avc1 / 0x31637661), yuv420p(progressive), 640x480 [SAR 1:1 DAR 4:3], 696 kb/s, 29.97 fps, 29.97 tbr, 11988 tbn (default) Metadata: handler_name : VideoHandler vendor_id : [0][0][0][0] Stream #0:1[0x2](und): Audio: aac (LC) (mp4a / 0x6134706D), 44100 Hz, stereo, fltp, 127 kb/s (default) Metadata: handler_name : SoundHandler vendor_id : [0][0][0][0]Code:Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'video2.mp4': Metadata: major_brand : mp42 minor_version : 0 compatible_brands: isommp42 creation_time : 2017-02-19T18:08:03.000000Z Duration: 00:23:04.91, start: 0.000000, bitrate: 519 kb/s Stream #0:0[0x1](und): Video: h264 (Constrained Baseline) (avc1 / 0x31637661), yuv420p(progressive), 480x360 [SAR 1:1 DAR 4:3], 421 kb/s, 24.87 fps, 24.87 tbr, 14350 tbn (default) Metadata: handler_name : VideoHandler vendor_id : [0][0][0][0] Stream #0:1[0x2](und): Audio: aac (LC) (mp4a / 0x6134706D), 44100 Hz, stereo, fltp, 95 kb/s (default) Metadata: creation_time : 2017-02-19T18:08:06.000000Z handler_name : IsoMedia File Produced by Google, 5-11-2011 vendor_id : [0][0][0][0]
+ Reply to Thread
Results 1 to 9 of 9
-
-
Easier might be to create a playlist for players that accept them. Otherwise one has to be reencoded to match the other (resolution, fps and any other differences you might not have noticed. I'd use AviSynth if I had to do the job, myself.
Maybe someone will come up with a batch file you can use. -
Thanks @jagabo, do you mind giving me the ffmpeg command to the the muxing of both files? At the very end, the combined video file should be for the Kodi mediacenter. Can I (or does it make sense) do ultimately convert the "muxed" .TS into a container like .mkv? Appreciate your help!
-
Thank you @jagabo! Somehow I am struggling with the input parameter, even if I specify absolute paths for both inputs.
Both files are in the 'sources' dir and I am in that working directory (I am on macOS):
Code:jabba@MacBook sources % ls file1.mp4 file2.mp4 list.txt jabba@MacBook sources % ffmpeg -f concat -safe 0 -i list.txt -c copy -hide_banner -y ffmpeg_append.ts [concat @ 0x126e04a60] Impossible to open 'file1.mp4"' list.txt: No such file or directory
Code:jabba@MacBook sources % ffmpeg -f concat -safe 0 -i /Users/jabba/Downloads/sources/file1.mp4 -i /Users/jabba/Downloads/sources/file2.mp4 c copy -hide_banner -y ffmpeg_append.ts [concat @ 0x121e04d90] Line 4: unknown keyword 'ftypisom' /Users/jabba/Downloads/sources/file1.mp4: Invalid data found when processing input
-
Try using the full paths in the list.txt file.
Oops, I just noticed a typo in my earlier post. The list.txt file should have single quotes around each filename.
Code:file 'file1.mp4' file 'file2.mp4'
Similar Threads
-
Concatenating m4s files with FFMPEG
By adlkeod in forum Newbie / General discussionsReplies: 2Last Post: 11th Feb 2025, 16:04 -
Audio from 25 fps in 23,976 fps video always out of sync even if converted
By Huggy in forum AudioReplies: 5Last Post: 2nd May 2023, 04:05 -
ffmpeg: Concatenating MP4 files adding chapters for each one
By Keyser in forum Video ConversionReplies: 6Last Post: 12th May 2022, 17:19 -
Concatenating Four MP4 Files
By pone44 in forum Video ConversionReplies: 2Last Post: 9th Jun 2019, 10:14 -
How to make 1080i 59.940 FPS video to 29.970 FPS
By Joycon in forum Newbie / General discussionsReplies: 2Last Post: 10th Dec 2018, 13:47