I have different video files.
I want to combine this into single one using ffmpeg.
i am using the following command
ffmpeg -f concat -safe 0 -i inputs.txt -vcodec copy -acodec copy output.mp4
in the inputs.txt i have given the list of the names of the files to be combined
when i run the above command it is giving me a video much greater than the sum of the original video lengths and from second video onwards the audio is muted or corrupted.
can some some one help me in fixing this issue.
+ Reply to Thread
Results 1 to 6 of 6
Can't be done. One audio has to be reencoded to match the sample rate of the other.
Actually both the videos are same but i changed the audio of one file with another audio file using another audio file by using ffmpeg command
I have arrived at file1 by replacing the audio of file2 with the audio of new_audio.mp3 file attached.
ffmpeg -i withsound.mp4 -i new_audio.mp3 -map 0:0 -map 1:0 -c:v copy -c:a aac -b:a 256k -shortest OUTPUT1.mp4
so instead of replacing the audio of one video with another audio file can we reencode the audio before replacing the audio of the video so that i can merge both the videos.
can some one help me how to renconde the audio of new_audio.mp3 in ffmpeg
-ar 44.1k to change the sample rate
Replace audio in file1.mp4 with 44.1Khz version , to produce "file1b.mp4"
ffmpeg -i file1.mp4 -i new_audio.mp3 -map 0:0 -map 1:0 -c:v copy -c:a aac -b:a 256k -ar 44.1k -shortest file1b.mp4
file file1b.mp4 file file2.mp4
This is working. Thanks a lot.
I am trying to club two types of files. One is in english and another is the translated portion of the english video in telugu.
Telugu video follows the english video
It worked when only one english and telugu files are given are given for concatenation. But when i give english1.mp4,telugu1.mp4 and english2.mp4and telugu.mp4 in this sequence, the video's audio is getting muted when english2 portion of the mp4 is playing. and audio is resumed when telugu2 portion is played
This is happening in VLC while the media player is playing the video properly with out muting any portion of the video. do i need to do any setting changes in VLC so that it plays the audio without muting.
I am using this command to combine four files
ffmpeg -f concat -safe 0 -i inputs.txt -vcodec copy -acodec copy output_851.mp4
the input.txt has the following names
English MP4 files has the following parameters
Bit Rate = 96kbps
No of Channels = 2 channels
Audi Sample rate= 44khz
the tr mp4 files has the following parameters
Bit Rate = 144kbps
No of Channels = 1 channel(mono)
Audi Sample rate= 44khz
I have replace the english audio with telugu audio by using the following command in ffmpeg in telugu.mp4 file
for %%g in (*mp3) do echo ffmpeg -i %%~ng%inputvideo_prefix%.mp4 -i %%g -map 0:0 -map 1:0 -c:v copy -c:a aac -ar 44.1k -shortest %%~ng%outputvideo_prefix%.mp4
I have uploaded the split_video.mp4 which is a portion of the final video. kindly play it in VLC and Windows media player and see the difference.