[Libav-user] Atempo filter usage

Sebastián Arriagada sebastian.arriagada.p at gmail.com
Tue Sep 8 20:33:21 CEST 2015


Hi everyone,

I'm trying to slow down a mp4 video. I've read that i should use setpts
filter for video and atempo filter for audio. The setpts filter works
pretty good, but there is no way to make atempo works. I'm using the
transcoding ffmpeg example (
https://ffmpeg.org/doxygen/trunk/doc_2examples_2transcoding_8c-example.html),
and changed the filter_spec from "null" and "anull" to "setpts=2*PTS"
and "atempo=0.5" respectively. The problem is the audio encoder complains
about the frame size:

[libfdk_aac @ 06de5960] more samples than frame size (avcodec_encode_audio2)

Here is the complete log for the execution:

Input #0, mov,mp4,m4a,3gp,3g2,mj2, from '../highlight.mp4':

Metadata:

major_brand : isom

minor_version : 512

compatible_brands: isomiso2avc1mp41

encoder : Lavf56.38.100

Duration: 00:00:10.09, start: 0.000000, bitrate: 734 kb/s

Stream #0:0(und): Video: h264 (High) (avc1 / 0x31637661), yuvj420p(pc,
bt709), 432x240 [SAR 1:1 DAR 9:5], 597 kb/s, 29.97 fps, 29.97 tbr, 120k
tbn, 119.88 tbc (default)

Metadata:

handler_name : VideoHandler

Stream #0:1(und): Audio: aac (LC) (mp4a / 0x6134706D), 48000 Hz, stereo,
fltp, 127 kb/s (default)

Metadata:

handler_name : SoundHandler

[libx264 @ 01b115e0] using SAR=1/1

[libx264 @ 01b115e0] using cpu capabilities: MMX2 SSE2Fast SSSE3 SSE4.2 AVX

[libx264 @ 01b115e0] profile High, level 3.1

Output #0, mp4, to '../highlightLento.mp4':

Stream #0:0: Video: h264 (libx264), yuv420p, 432x240 [SAR 1:1 DAR 9:5],
q=10-51, 128 kb/s, 119.88 tbc

Stream #0:1: Audio: aac (libfdk_aac), 48000 Hz, stereo, s16, 128 kb/s

[mp4 @ 01b11080] Using AVStream.codec.time_base as a timebase hint to the
muxer is deprecated. Set AVStream.time_base instead.

[mp4 @ 01b11080] Using AVStream.codec.time_base as a timebase hint to the
muxer is deprecated. Set AVStream.time_base instead.

[swscaler @ 06e288e0] deprecated pixel format used, make sure you did set
range correctly

[libfdk_aac @ 06de5960] more samples than frame size (avcodec_encode_audio2)

I searched for the exact line where the message is printed and it compares
the nb_samples in the AVFrame with the frame_size in the AVCodecContext
gave to the avcodec_encode_audio2 function.
So the question is, what is the correct way to set up the output codec
context to works with the atempo filter? I supposed the filter will do all
the work but it seems i was wrong.

Any help would be very appreciated.
Thanks in advance.

Kind regards,

Sebastián Arriagada.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://ffmpeg.org/pipermail/libav-user/attachments/20150908/39021013/attachment.html>


More information about the Libav-user mailing list