VideoHelp Forum




+ Reply to Thread
Results 1 to 3 of 3
  1. Member
    Join Date
    Mar 2011
    Location
    Paris, France
    Search PM
    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:
    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
    Here are the setting I tried to encode the new video:
    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"
    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
    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:
    (for %%i in (*.mp4) do @echo file '%%i') > input.txt
    ffmpeg -safe 0 -f concat -i input.txt -c copy merged.mp4
    Thank you.
    Last edited by yetanotherlogin; 4th Nov 2026 at 13:34.
    Quote Quote  
  2. 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
    Quote Quote  
  3. Member
    Join Date
    Mar 2011
    Location
    Paris, France
    Search PM
    Perfect! Thank you.
    Quote Quote  



Similar Threads

Visit our sponsor! Try DVDFab and backup Blu-rays!