Avidemux Forum

Avidemux => Main version 2.6 => Topic started by: elkenders on May 04, 2021, 10:14:39 AM

Title: Trimming frames then replacing audio without trimming audio
Post by: elkenders on May 04, 2021, 10:14:39 AM
Hi! Avidemux is a great tool I've been finding it really useful. For my workflow I often trim frames off the head of a video (usually black frames from an editor) then replace the audio with a new mix. However, the audio is mixed from first frame of picture and when I trim the picture, then replace the audio in a single pass the audio is also trimmed. Is there a way of achieving what I'm doing in a single pass rather than trimming the picture, saving the result, then replacing the audio?

Thanks for your help!
Title: Re: Trimming frames then replacing audio without trimming audio
Post by: butterw on May 04, 2021, 11:12:20 AM
A Tinypy script (which can be added to the menu) could do: save the temporary file, reload, prompt for audio filepath and save the output file.

The script binding to load an external audio is: adm.audioAddExternal(filepath)
Title: Re: Trimming frames then replacing audio without trimming audio
Post by: eumagga0x2a on May 04, 2021, 11:17:24 AM
Quote from: elkenders on May 04, 2021, 10:14:39 AMFor my workflow I often trim frames off the head of a video (usually black frames from an editor) then replace the audio with a new mix. However, the audio is mixed from first frame of picture and when I trim the picture, then replace the audio in a single pass the audio is also trimmed.

I'm sorry, I don't follow you. The beginning of an external audio track is never cut away / trimmed when the video is edited.
Title: Re: Trimming frames then replacing audio without trimming audio
Post by: butterw on May 04, 2021, 11:30:37 AM
When an external audio track is loaded it gets trimmed when you trim the video.
Title: Re: Trimming frames then replacing audio without trimming audio
Post by: eumagga0x2a on May 04, 2021, 11:33:42 AM
No, it is not.
Title: Re: Trimming frames then replacing audio without trimming audio
Post by: eumagga0x2a on May 04, 2021, 11:39:43 AM
I probably should have clarified, what is different.

1. Load a video

2. Add external audio track

3. Set marker A to an offset

4. Save video

5. Seek to the position of marker A, reset markers, set marker B

6. Delete the selection (from A = 0 to B)

7. Save video

The result after 4. is a video with audio track starting at offset ( = trimmed). The result after 7. is a video with audio track starting from the beginning ( = not trimmed).

Title: Re: Trimming frames then replacing audio without trimming audio
Post by: butterw on May 04, 2021, 11:51:23 AM
Delete the Selection rather than save the selection, and the external audio doesn't get trimmed.