<p>If your input stream has no B-pyramid i.e. B-frames used as references for other B-frames, and your ffmpeg build has librubberband linked then use the following commands:</p>

<p><strong>#1</strong> Extract video to raw stream</p>

<pre><code>ffmpeg -i in.mkv -c copy in.h264
</code></pre>

<p><strong>#2</strong> Retime and process audio</p>

<pre><code>ffmpeg -r 25 -i in.h264 -i in.mkv -map 0 -map 1:a -af rubberband=tempo=1.04166 -c:a pcm_s16le out.mkv
</code></pre>

<p>If your H264 stream does have reference B-frames then you'll have to use mp4box as an intermediary.</p>

<p>i.e. </p>

<p><strong>#2a</strong> Retime video</p>

<pre><code>mp4box -add in.h264#fps=25 -new in25.mp4
</code></pre>

<p><strong>#2b</strong> Process audio and add video</p>

<pre><code>ffmpeg -i in25.mp4 -i in.mkv -map 0 -map 1:a -af rubberband=tempo=1.04166 -c:a pcm_s16le out.mkv
</code></pre>

CC BY-SA 3.0
2017-12-03T10:18:34.520Z
Isn't possible to cast a single pass command using atempo ? I was trying a command like: `ffmpeg -i input.mov -r 25 -c:v libx264 -preset ultrafast -crf 18 -c:a libfdk_aac -filter:v "setpts=0.96*PTS" -filter:a "atempo=1.0417" output.mov` I'm not sure about the pitch however.. Anyways sorry for the initial confusion about h264 as input video.. generally my input is a ProRes, DNxHD codec..(would be cool have a command that could work for any kind of input tho)
user3450548
CC BY-SA 3.0
2017-12-03T10:36:31.240Z
`atempo` will alter pitch. There's a new native filter that will soon be added to ffmpeg which will allow tempo changes without pitch change but its quality isn't as good as rubberband.
Gyan
CC BY-SA 3.0
2017-12-03T15:05:34.807Z
I see, so.. can I use rubberband in just one passage as I suggested for atempo ?
user3450548
CC BY-SA 3.0
2017-12-03T04:49:14.637Z
2017-12-03T04:49:14.637Z
Gyan
<p>I have a .mov video with 24fps and 5.1 audio.</p>

<p>Is it possible change the framerate from 24 to 25 fps with no frame resampling (no frame duplication / removal - just new framerate interpretation) and keep the audio pitch the same?</p>

<p>Normally you do this by not resampling the frame data but setting the video flag from 24 to 25 fps however there is the need to adjust the audio so that it is shortened. Is it possible do it all in one ffmpeg command line or maybe in more than one and prepare a batch / bash file for that?</p>

<p>Also, is ffmpeg's audio processing capabilities professional quality or it is low quality compared to pro algorithms like Avid Pro Tools and Adobe Audition?</p>

<p><strong>Note:</strong> This question is different from this one <a href="https://video.stackexchange.com/questions/21725/convert-video-from-24-to-25-fps-while-keeping-video-and-audio-lenght-and-also-co?rq=1">Convert video from 24 to 25 fps while keeping video and audio length and also correct audio pitch</a>.</p>

<p>Here I want to know how to do the same thing but <strong>shortening the actual length of the video and adjust audio accordingly</strong> keeping the pitch in a professional way.</p>

CC BY-SA 3.0
2017-11-28T23:23:34.697Z
Please create a separate question for your question about ffmpeg's quality. Also, you are confusing a codec (Prores) and a program (Audition and ffmpeg).
Michael Liebman
CC BY-SA 3.0
2017-11-29T10:30:24.527Z
Sorry i was sleepy, I wanted to intend Avid Pro Tools
user3450548
CC BY-SA 3.0
2017-12-02T13:22:15.410Z
Which video codec?
Gyan
CC BY-SA 3.0
2017-12-02T21:08:21.727Z
@Mulvya does it matter? Anyways h264. For the audio codec i would like to keep the original pcm audio wav raw as output format too..
user3450548
<video><ffmpeg><audio><conversion><transcoding>
Convert video from 24 fps to 25, shortening length (no frame duplication), keeping audio pitch
user3450548
# Convert video from 24 fps to 25, shortening length (no frame duplication), keeping audio pitch

(Asked by: username_0 on 2017-11-28)

I have a .mov video with 24fps and 5.1 audio.

Is it possible change the framerate from 24 to 25 fps with no frame resampling (no frame duplication / removal - just new framerate interpretation) and keep the audio pitch the same?

Normally you do this by not resampling the frame data but setting the video flag from 24 to 25 fps however there is the need to adjust the audio so that it is shortened. Is it possible do it all in one ffmpeg command line or maybe in more than one and prepare a batch / bash file for that?

Also, is ffmpeg's audio processing capabilities professional quality or it is low quality compared to pro algorithms like Avid Pro Tools and Adobe Audition?

**Note:** This question is different from this one [Convert video from 24 to 25 fps while keeping video and audio length and also correct audio pitch](https://video.stackexchange.com/questions/21725/convert-video-from-24-to-25-fps-while-keeping-video-and-audio-lenght-and-also-co?rq=1).

Here I want to know how to do the same thing but **shortening the actual length of the video and adjust audio accordingly** keeping the pitch in a professional way.

**Tags:** video, ffmpeg, audio, conversion, transcoding

> **Comments:**
> **username_1**: Please create a separate question for your question about ffmpeg's quality. Also, you are confusing a codec (Prores) and a program (Audition and ffmpeg).  
> **username_0**: Sorry i was sleepy, I wanted to intend Avid Pro Tools  
> **username_2**: Which video codec?  
> **username_0**: @Mulvya does it matter? Anyways h264. For the audio codec i would like to keep the original pcm audio wav raw as output format too..  

---

## 1 answers

### Answer by username_2 on 2017-12-03. Score: 1

If your input stream has no B-pyramid i.e. B-frames used as references for other B-frames, and your ffmpeg build has librubberband linked then use the following commands:
#1 Extract video to raw stream
ffmpeg -i in.mkv -c copy in.h264

#2 Retime and process audio
ffmpeg -r 25 -i in.h264 -i in.mkv -map 0 -map 1:a -af rubberband=tempo=1.04166 -c:a pcm_s16le out.mkv

If your H264 stream does have reference B-frames then you'll have to use mp4box as an intermediary.
i.e. 
#2a Retime video
mp4box -add in.h264#fps=25 -new in25.mp4

#2b Process audio and add video
ffmpeg -i in25.mp4 -i in.mkv -map 0 -map 1:a -af rubberband=tempo=1.04166 -c:a pcm_s16le out.mkv

> **Comments:**
> **username_0**: Isn't possible to cast a single pass command using atempo ? I was trying a command like: `ffmpeg -i input.mov -r 25 -c:v libx264 -preset ultrafast -crf 18 -c:a libfdk_aac -filter:v "setpts=0.96*PTS" -filter:a "atempo=1.0417" output.mov` I'm not sure about the pitch however.. Anyways sorry for the initial confusion about h264 as input video.. generally my input is a ProRes, DNxHD codec..(would be cool have a command that could work for any kind of input tho)  
> **username_2**: `atempo` will alter pitch. There's a new native filter that will soon be added to ffmpeg which will allow tempo changes without pitch change but its quality isn't as good as rubberband.  
> **username_0**: I see, so.. can I use rubberband in just one passage as I suggested for atempo ?  

---

