Hello,
I'd like to encode a new video with the same settings so I can append it to an existing video without re-encoding.
Here's the existing video:
Here are the setting I tried to encode the new video:Code:Input #0, mov,mp4,m4a,3gp,3g2,mj2, from '01.mp4': Metadata: major_brand : isom minor_version : 512 compatible_brands: isomiso2avc1mp41 encoder : Lavf58.65.101 Duration: 00:02:06.88, start: 0.000000, bitrate: 363 kb/s Stream #0:0[0x1](und): Video: h264 (High) (avc1 / 0x31637661), yuv420p(tv, bt709, progressive), 640x360 [SAR 1:1 DAR 16:9], 292 kb/s, 25 fps, 25 tbr, 12800 tbn (default) Metadata: handler_name : VideoHandler Stream #0:1[0x2](und): Audio: aac (LC) (mp4a / 0x6134706D), 44100 Hz, stereo, fltp, 64 kb/s (default) Metadata: handler_name : SoundHandler
Code:ffmpeg -i "02.mp4" -vf scale=640:360 -c:v libx264 -pix_fmt yuv420p -c:a aac -ar 44100 -b:a 64k -ac 2 -threads 2 -f mp4 "02.ffmpeg.mp4"When I merge them, I can hear the audio in the new video but there's no video. I guess the video settings are wrong (bitrate?). What would you use?Code:Input #0, mov,mp4,m4a,3gp,3g2,mj2, from '02.ffmpeg.mp4': Metadata: major_brand : isom minor_version : 512 compatible_brands: isomiso2avc1mp41 encoder : Lavf63.17.100 Duration: 00:02:46.30, start: 0.000000, bitrate: 387 kb/s Stream #0:0[0x1](und): Video: h264 (High) (avc1 / 0x31637661), yuv420p(tv, bt709, progressive), 640x360 [SAR 1:1 DAR 16:9], 314 kb/s, 29.97 fps, 29.97 tbr, 30k tbn (default) Metadata: handler_name : VideoHandler encoder : Lavc63.25.101 libx264 Stream #0:1[0x2](und): Audio: aac (LC) (mp4a / 0x6134706D), 44100 Hz, stereo, fltp, 64 kb/s (default) Metadata: handler_name : SoundHandler
Thank you.Code:(for %%i in (*.mp4) do @echo file '%%i') > input.txt ffmpeg -safe 0 -f concat -i input.txt -c copy merged.mp4
+ Reply to Thread
Results 1 to 3 of 3
-
Last edited by yetanotherlogin; 4th Nov 2026 at 13:34.
-
Try add this to your code for the new video:
The first video is 25fps & the second is 29.97fps.
-fflags +genpts -r 25
The -fflags +genpts is for timestamps. You may or may not need this to help sync.
Added to your code:
Code:ffmpeg -fflags +genpts -r 25 -i "02.mp4" -vf scale=640:360 -c:v libx264 -pix_fmt yuv420p -c:a aac -ar 44100 -b:a 64k -ac 2 -threads 2 -f mp4 "02.ffmpeg.mp4"
Last edited by cholla; 4th Nov 2026 at 11:37. Reason: corrected
Similar Threads
-
How to use ffmpeg to encode files from folder1 to folder2
By JN- in forum Newbie / General discussionsReplies: 31Last Post: 27th May 2025, 10:45 -
Merging a video and audio with ffmpeg or other. Possible ?
By DB83 in forum EditingReplies: 4Last Post: 20th Nov 2024, 11:45 -
How to prepare clips for ffmpeg merging
By vmackey in forum EditingReplies: 7Last Post: 17th Feb 2024, 19:53 -
Cutting away sections from a video using ffmpeg without re-encode
By BosseB in forum EditingReplies: 33Last Post: 24th Aug 2022, 15:32 -
FFMPEG encode keep first track audio
By iKron in forum Newbie / General discussionsReplies: 1Last Post: 31st Dec 2021, 12:28


Quote