<p>As shown below,</p>
<pre><code>ffmpeg -ss 00:01:00 -to 00:45:00 -i ORIGINAL.mxf
       -ss 00:01:00 -to 00:45:00 -itsoffset 0.200 -i ORIGINAL.mxf
       -map 0:v -map 1:a -c:v libx264 -preset slow -crf 22 -c:a aac ORIGINAL.mp4
       -map 1:a -vn ORIGINAL.wav
</code></pre>

CC BY-SA 4.0
2021-10-09T11:59:02.570Z
This is great! Thanks so much! One other thing though. How do I also keep a master recording (the mxf in this case) that is resynced? In this answer the original is encoded to different formats like I asked, and to see the syntax is great, but I also need a version that is not re-encoded, just with the audio corrected.
CCW
CC BY-SA 4.0
2021-10-11T15:22:22.673Z
Actually. I have been trying to use the code a few times but the result is error notifications. I can't post it here as it has too many characters to post.
CCW
CC BY-SA 4.0
2021-10-09T04:16:46.510Z
2021-10-09T04:16:46.510Z
Gyan
<p>After recording a live show, there are several tasks I need to do before I can render out the video file to different formats. I need to trim the file, and then resync the audio as well. After this I render the video file out to WAV, MP3 and MP4. I created a script like the one below (omitting the command for mp3, as this is just an example).</p>
<p>I'm obviously not very well versed in ffmpeg commands. The way this script works I first create a trimmed version, and then a second version that has the audio synced, before it finally does the encoding to other formats. Since I often have to do several massive files, I run into serious disk space problems with all the intermediary files being rendered out first.</p>
<p>Is there a way to combine the trim and resync command into one, so I can render out a trimmed and resynced master file?</p>
<pre><code>
ffmpeg -i ORIGINAL_TRIM.mxf -itsoffset 0.200 -i ORIGINAL_TRIM.mxf -map 0:v -map 1:a -c copy ORIGINAL_RESYNC.mxf

ffmpeg -i ORIGINAL_RESYNC.mxf -vn ORIGINAL.wav

ffmpeg -i ORIGINAL_RESYNC.mxf -c:v libx264 -preset slow -crf 22 -c:a aac ORIGINAL.mp4
</code></pre>
<p>Pause</p>

<ffmpeg><video><encoding>
Combining multiple commands to render out different formats, while also resyncing the original file, and not have to render that one out first
CCW
# Combining multiple commands to render out different formats, while also resyncing the original file, and not have to render that one out first

(Asked by: username_0 on 2021-10-08)

After recording a live show, there are several tasks I need to do before I can render out the video file to different formats. I need to trim the file, and then resync the audio as well. After this I render the video file out to WAV, MP3 and MP4. I created a script like the one below (omitting the command for mp3, as this is just an example).
I'm obviously not very well versed in ffmpeg commands. The way this script works I first create a trimmed version, and then a second version that has the audio synced, before it finally does the encoding to other formats. Since I often have to do several massive files, I run into serious disk space problems with all the intermediary files being rendered out first.
Is there a way to combine the trim and resync command into one, so I can render out a trimmed and resynced master file?

ffmpeg -i ORIGINAL_TRIM.mxf -itsoffset 0.200 -i ORIGINAL_TRIM.mxf -map 0:v -map 1:a -c copy ORIGINAL_RESYNC.mxf

ffmpeg -i ORIGINAL_RESYNC.mxf -vn ORIGINAL.wav

ffmpeg -i ORIGINAL_RESYNC.mxf -c:v libx264 -preset slow -crf 22 -c:a aac ORIGINAL.mp4

Pause

**Tags:** ffmpeg, video, encoding


---

## 1 answers

### Answer by username_1 on 2021-10-09. Score: 1

As shown below,
ffmpeg -ss 00:01:00 -to 00:45:00 -i ORIGINAL.mxf
       -ss 00:01:00 -to 00:45:00 -itsoffset 0.200 -i ORIGINAL.mxf
       -map 0:v -map 1:a -c:v libx264 -preset slow -crf 22 -c:a aac ORIGINAL.mp4
       -map 1:a -vn ORIGINAL.wav

> **Comments:**
> **username_0**: This is great! Thanks so much! One other thing though. How do I also keep a master recording (the mxf in this case) that is resynced? In this answer the original is encoded to different formats like I asked, and to see the syntax is great, but I also need a version that is not re-encoded, just with the audio corrected.  
> **username_0**: Actually. I have been trying to use the code a few times but the result is error notifications. I can't post it here as it has too many characters to post.  

---

