[Libav-user] Slow down video

Sushma sushma.yella at gmail.com
Fri Oct 14 15:57:29 EEST 2022


Hello All,

I'm trying to use FFMPEG to slow down part of video and audio using C++
FFMPEG API. I was able to achieve it from the command line but however,
argument parsing fails using api.

Here is the command line input

ffmpeg -i "inputvideo.mp4" -filter_complex
"[0:v]trim=0:2,setpts=PTS-STARTPTS[v1];[0:v]trim=2:10,setpts=2*(PTS-STARTPTS)[v2];[0:v]trim=10,setpts=PTS-STARTPTS[v3];[0:a]atrim=0:2,asetpts=PTS-STARTPTS[a1];[0:a]atrim=2:10,asetpts=PTS-STARTPTS,atempo=0.5[a2];[0:a]atrim=10,asetpts=PTS-STARTPTS[a3];[v1][a1][v2][a2][v3][a3]concat=n=3:v=1:a=1"
-preset superfast -profile:v baseline output.mp4

Here is the filter string i used in avfilter_graph_parse()

buffer=video_size=1920x1080:pix_fmt=0:time_base=1/30:pixel_aspect=0/1:frame_rate=30/1
[in_1]; [in_1] trim = 0:2, setpts = PTS - STARTPTS [in_2]; [in_2] trim =
2:10, setpts = 2 * (PTS - STARTPTS)[in_3]; [in_3] trim = 10, setpts = PTS -
STARTPTS[in_4]; [in_1] atrim = 0:2, asetpts = PTS - STARTPTS[in_5]; [in_5]
atrim = 2:10, asetpts = PTS - STARTPTS, atempo = 0.5[in_6]; [in_6] atrim =
10, asetpts = PTS - STARTPTS[in_7]; [in_1] [in_2] [in_5] [in_3] [in_6]
[in_4] [in_7] concat = n = 3:v = 1 : a = 1 [result]; [result] buffersink

Can anyone let me know where I'm wrong? What changes do I need to make in
the filter string? Kindly help

Thanks in Advance.

Regards,
Sushma
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://ffmpeg.org/pipermail/libav-user/attachments/20221014/77339187/attachment.htm>


More information about the Libav-user mailing list