FFmpeg concat video and audio out of sync

This two step process should work Step 1 Pad out the audio in each segment ffmpeg -i segment1.mov -af apad -c:v copy <audio encoding params> -shortest -avoid_negative_ts make_zero -fflags +genpts padded1.mov Or Generate segments with synced streams ffmpeg -y -ss 00:00:02.750 -i input.MOV -c copy -t 00:00:05.880 -avoid_negative_ts make_zero -fflags +genpts segment.MOV Step 2 Concat … Read more

How do I get an audio file sample rate using sox?

just use: soxi <filename> or sox –i <filename> to produce output such as: Input File : ‘final.flac’ Channels : 4 Sample Rate : 44100 Precision : 16-bit Duration : 00:00:11.48 = 506179 samples = 860.849 CDDA sectors File Size : 2.44M Bit Rate : 1.70M Sample Encoding: 16-bit FLAC Comment : ‘Comment=Processed by SoX’ The … Read more

Playing a sound in a ipython notebook

The previous answer is pretty old. You can use IPython.display.Audio now. Like this: import IPython IPython.display.Audio(“my_audio_file.mp3”) Note that you can also process any type of audio content, and pass it to this function as a numpy array. If you want to display multiple audio files, use the following: IPython.display.display(IPython.display.Audio(“my_audio_file.mp3”)) IPython.display.display(IPython.display.Audio(“my_audio_file.mp3”))