<p>I am trying to merge 5 parts of a continuous video using ffmpeg.</p>

<p>For some reason, the 1st part is encoded at 29.97 FPS, while all the others are at 30 FPS.</p>

<ul>
<li>part #1 : 29.97 fps, 29.97 tbr, 19200 tbn, 38400 tbc</li>
<li>part #2 : 30 fps, 30 tbr, 15360 tbn, 60 tbc</li>
</ul>

<p>So before the <code>concat</code> operation, I tried converting Part #1 to 30 FPS, two different ways :</p>

<ul>
<li><code>ffmpeg -i 1.mp4 -filter:v fps=fps=30 output.mp4</code> (based on the example at <a href="https://trac.ffmpeg.org/wiki/ChangingFrameRate" rel="nofollow noreferrer">https://trac.ffmpeg.org/wiki/ChangingFrameRate</a>)</li>
<li><code>ffmpeg -i 1.mp4 -framerate 29.97 -r 30 output.mp4</code></li>
</ul>

<p>Both operations passed and I was able to verify the new FPS just by doing <code>ffmpeg -i output.mp4</code></p>

<p><strong>However</strong>, after the <code>concat</code> operation I realised that the video is now shorter than the audio in Part #1, resulting in a short blackout at the end of the Part, while the audio continues uninterrupted.</p>

<p>Why is that, and how to fix it ?</p>

CC BY-SA 4.0
2020-05-27T04:10:38.657Z
You don't need to change framerate. Just make the `tbn` equal. `ffmpeg -i 1.mp4 -c copy -video_track_timescale 15360 output.mp4`
Gyan
CC BY-SA 4.0
2020-05-27T15:44:55.643Z
Tried your suggestion. Concat with `ffmpeg -f concat -safe 0 -i list.txt -codec copy output.mp4`, I get the following message `Non-monotonous DTS in output stream 0:1; previous: 660480, current: 660114; changing to 660481. This may result in incorrect timestamps in the output file.` and there's still a blank at the end of the video stream of Part 1.
mach128x
<ffmpeg><framerate><filter>
Changing FPS from 29.97 to 30 in ffpmeg creates short blank at end of video, audio is fine
mach128x
# Changing FPS from 29.97 to 30 in ffpmeg creates short blank at end of video, audio is fine

(Asked by: username_0 on 2020-05-26)

I am trying to merge 5 parts of a continuous video using ffmpeg.

For some reason, the 1st part is encoded at 29.97 FPS, while all the others are at 30 FPS.

* part #1 : 29.97 fps, 29.97 tbr, 19200 tbn, 38400 tbc
* part #2 : 30 fps, 30 tbr, 15360 tbn, 60 tbc

So before the `concat` operation, I tried converting Part #1 to 30 FPS, two different ways :

* `ffmpeg -i 1.mp4 -filter:v fps=fps=30 output.mp4` (based on the example at <https://trac.ffmpeg.org/wiki/ChangingFrameRate>)
* `ffmpeg -i 1.mp4 -framerate 29.97 -r 30 output.mp4`

Both operations passed and I was able to verify the new FPS just by doing `ffmpeg -i output.mp4`

**However**, after the `concat` operation I realised that the video is now shorter than the audio in Part #1, resulting in a short blackout at the end of the Part, while the audio continues uninterrupted.

Why is that, and how to fix it ?

**Tags:** ffmpeg, framerate, filter

> **Comments:**
> **username_1**: You don't need to change framerate. Just make the `tbn` equal. `ffmpeg -i 1.mp4 -c copy -video_track_timescale 15360 output.mp4`  
> **username_0**: Tried your suggestion. Concat with `ffmpeg -f concat -safe 0 -i list.txt -codec copy output.mp4`, I get the following message `Non-monotonous DTS in output stream 0:1; previous: 660480, current: 660114; changing to 660481. This may result in incorrect timestamps in the output file.` and there's still a blank at the end of the video stream of Part 1.  

---

## 0 answers

