Is there any equivalent to the atempo ffmpeg audio filter but for avconv to speed up video & audio?

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)?
Asked By: gongzhitaao

||

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.

Answered By: user44370

Rater than use avconv why not just switch to ffmpeg instead. The project offers a statically built version which you can simply download and install + use in place.

Once downloaded and unpacked you can run it like so:

./ffmpeg ....
Answered By: slm
Categories: Answers Tags: , , , ,
Answers are sorted by their score. The answer accepted by the question owner as the best is marked with
at the top-right corner.