concat mp4 text list input and wav text list input into one video/audio file?

classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|

concat mp4 text list input and wav text list input into one video/audio file?

Ram Shaffir
Hello all,

I use the following command to concat list of videos to one video ‘merged.mp4’:

ffmpeg -y -f concat -safe 0 -i /usr/ramDisk/video_list.txt -c copy -acodec copy -movflags +faststart /usr/ramDisk/merged.mp4

the content of the ‘video_list.txt’ is something like this:
file '/usr/ramDisk/shared_15/0.mp4'
file '/usr/ramDisk/shared_15/1.mp4'
file '/usr/ramDisk/shared_15/2.mp4'
file '/usr/ramDisk/shared_15/3.mp4'

now I have an additional txt file named ‘audio_list.txt’  with a list of wav files:
file '/usr/ramDisk/shared_15/0.wav'
file '/usr/ramDisk/shared_15/1. wav'
file '/usr/ramDisk/shared_15/2. wav'
file '/usr/ramDisk/shared_15/3. wav'

the length of all files (mp4 and wav) are the same.

how can I concat the mp4 files with the wav files using their txt files as -i inputs to one video ‘merged.mp4’?

Thank you all in advance!
Best,
Ram


_______________________________________________
ffmpeg-user mailing list
[hidden email]
https://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
[hidden email] with subject "unsubscribe".
Reply | Threaded
Open this post in threaded view
|

Re: concat mp4 text list input and wav text list input into one video/audio file?

Ram Shaffir
Forgot to mention that the original concat command referred to mp4 files with an audio stream and now the audio is saved to wav files separately.


_______________________________________________
ffmpeg-user mailing list
[hidden email]
https://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
[hidden email] with subject "unsubscribe".
Reply | Threaded
Open this post in threaded view
|

Re: concat mp4 text list input and wav text list input into one video/audio file?

Moritz Barsnick
In reply to this post by Ram Shaffir
Hi Ram,

On Fri, Jul 03, 2020 at 12:55:00 +0000, Ram Shaffir wrote:
> ffmpeg -y -f concat -safe 0 -i /usr/ramDisk/video_list.txt -c copy -acodec copy -movflags +faststart /usr/ramDisk/merged.mp4
[...]
> how can I concat the mp4 files with the wav files using their txt files as -i inputs to one video ‘merged.mp4’?

BY adding a second input with the audio:
$ ffmpeg -y -f concat -safe 0 -i /usr/ramDisk/video_list.txt -f concat -safe 0 -i /usr/ramDisk/audio_list.txt -map 0 -map 1 -c copy -movflags +faststart /usr/ramDisk/merged.mp4

("-map 0 -map 1" might not be needed, because each input provides
exactly only one video and one audio stream.)

Cheers,
Moritz
_______________________________________________
ffmpeg-user mailing list
[hidden email]
https://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
[hidden email] with subject "unsubscribe".
Reply | Threaded
Open this post in threaded view
|

Re: concat mp4 text list input and wav text list input into one video/audio file?

Ram Shaffir
Many thanks Moritz! Very simple once you know!

A necessary tweak for this task is to move the audio 1.5 seconds forward; I added '-itsoffset 1.5' before the audio input:

ffmpeg -y -f concat -safe 0 -i /usr/ramDisk/video.txt -f concat -safe 0 -itsoffset 1.5 -i /usr/ramDisk/audio.txt -c copy -c:a aac -movflags +faststart /usr/ramDisk/merged.mp4

But it doesn't seem to affect the output.
_______________________________________________
ffmpeg-user mailing list
[hidden email]
https://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
[hidden email] with subject "unsubscribe".
Reply | Threaded
Open this post in threaded view
|

Re: concat mp4 text list input and wav text list input into one video/audio file?

Moritz Barsnick
On Sat, Jul 04, 2020 at 12:48:09 +0000, Ram Shaffir wrote:
> A necessary tweak for this task is to move the audio 1.5 seconds forward; I added '-itsoffset 1.5' before the audio input:
[...]
> But it doesn't seem to affect the output.

You may want to instead try using "-ss 1.5" in front of one of the two
inputs.

Cheers,
Moritz
_______________________________________________
ffmpeg-user mailing list
[hidden email]
https://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
[hidden email] with subject "unsubscribe".
Reply | Threaded
Open this post in threaded view
|

Re: concat mp4 text list input and wav text list input into one video/audio file?

Ram Shaffir
Yay! -ss and -t with a longer audio.txt file list did the trick!

I appreciate your help!
Cheers,
RS.

-----Original Message-----
From: ffmpeg-user <[hidden email]> On Behalf Of Moritz Barsnick
Sent: Saturday, July 4, 2020 4:04 PM
To: FFmpeg user discussions <[hidden email]>
Subject: Re: [FFmpeg-user] concat mp4 text list input and wav text list input into one video/audio file?

On Sat, Jul 04, 2020 at 12:48:09 +0000, Ram Shaffir wrote:
> A necessary tweak for this task is to move the audio 1.5 seconds forward; I added '-itsoffset 1.5' before the audio input:
[...]
> But it doesn't seem to affect the output.

You may want to instead try using "-ss 1.5" in front of one of the two inputs.

Cheers,
Moritz
_______________________________________________
ffmpeg-user mailing list
[hidden email]
https://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email [hidden email] with subject "unsubscribe".
_______________________________________________
ffmpeg-user mailing list
[hidden email]
https://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
[hidden email] with subject "unsubscribe".