Ubuntu – ny equivalent to the atempo ffmpeg audio filter but for avconv to speed up video & audio

audioavconvffmpegUbuntuvideo

As noted here, we could speedup audio with ffmpeg using:

$ ffmpeg -i input.mkv -filter:a "atempo=2.0" -vn output.mkv

But on Ubuntu, ffmpeg is replaced by avconv, and the atempo filter is not available in avconv.

My question is:

  1. Are there any alternatives to the atempo filter to use with avconv, or how to speed up audio AND video using avconv?
  2. How to speed up a video file (if you have better ideas)?

Best Answer

It is possible to circumvent the fact that the atempo filter is not available for avconv(yet the setpts video filter is). Simply use another tool like sox to do the audio part(adjust mapping depending on streams):

avconv -i input.mkv -c copy -map 0:0 video.raw                   #copy raw video stream
avconv -i input.mkv -c copy -map 0:1 audio.raw                   #copy raw audio stream
sox audio.raw audioq.raw speed 4                         #speed up(4x)audio&pitch
sox audio.raw audioq.raw tempo 4                         #or, to preserve pitch
avconv -i video.raw -filter:v "setpts=0.25*PTS" output.raw #speed up (4x) video
avconv -i output.raw -i audioq.raw final.mkv             #combine outputs to .mkv

There is surely a simpler way to do this but I've tried with some random .mkv file and it worked.

Related Question