<div dir="ltr">Thanks for the reply.<div><br></div><div>If <span style="color:rgb(80,0,80)">pi</span><span style="color:rgb(80,0,80)">x_fmt=0 does not work, what are the other pixel formats that I can use to achieve my requirement?</span></div><div><span style="color:rgb(80,0,80)"><br></span></div><div>>>atrim gets from [in1], i.e. buffer, while in the other version atrim is<br>connected to [0:a], i.e. a abuffer.<br></div><div><br></div><div>Do you think I need to use it in a similar way in the API as well? If possible, can you share a sample filter string that I could use? I tried all possible ways but with no luck.</div><div><br></div><div>Regards,</div><div>Madhukar </div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Fri, Oct 14, 2022 at 6:43 PM Nicolas George <<a href="mailto:george@nsup.org">george@nsup.org</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Sushma (12022-10-14):<br>
> Hello All,<br>
> <br>
> I'm trying to use FFMPEG to slow down part of video and audio using C++<br>
> FFMPEG API. I was able to achieve it from the command line but however,<br>
> argument parsing fails using api.<br>
> <br>
> Here is the command line input<br>
> <br>
> ffmpeg -i "inputvideo.mp4" -filter_complex<br>
> "[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"<br>
> -preset superfast -profile:v baseline output.mp4<br>
> <br>
> Here is the filter string i used in avfilter_graph_parse()<br>
> <br>
> buffer=video_size=1920x1080:pix_fmt=0:time_base=1/30:pixel_aspect=0/1:frame_rate=30/1<br>
> [in_1]; [in_1] trim = 0:2, setpts = PTS - STARTPTS [in_2]; [in_2] trim =<br>
> 2:10, setpts = 2 * (PTS - STARTPTS)[in_3]; [in_3] trim = 10, setpts = PTS -<br>
> STARTPTS[in_4]; [in_1] atrim = 0:2, asetpts = PTS - STARTPTS[in_5]; [in_5]<br>
> atrim = 2:10, asetpts = PTS - STARTPTS, atempo = 0.5[in_6]; [in_6] atrim =<br>
> 10, asetpts = PTS - STARTPTS[in_7]; [in_1] [in_2] [in_5] [in_3] [in_6]<br>
> [in_4] [in_7] concat = n = 3:v = 1 : a = 1 [result]; [result] buffersink<br>
> <br>
> Can anyone let me know where I'm wrong? What changes do I need to make in<br>
> the filter string? Kindly help<br>
<br>
I see several issues:<br>
<br>
pix_fmt=0 will probably not work.<br>
<br>
atrim gets from [in1], i.e. buffer, while in the other version atrim is<br>
connected to [0:a], i.e. a abuffer.<br>
<br>
You have several pads that are connected multiple times.<br>
<br>
Regards,<br>
<br>
-- <br>
Nicolas George<br>
_______________________________________________<br>
Libav-user mailing list<br>
<a href="mailto:Libav-user@ffmpeg.org" target="_blank">Libav-user@ffmpeg.org</a><br>
<a href="https://ffmpeg.org/mailman/listinfo/libav-user" rel="noreferrer" target="_blank">https://ffmpeg.org/mailman/listinfo/libav-user</a><br>
<br>
To unsubscribe, visit link above, or email<br>
<a href="mailto:libav-user-request@ffmpeg.org" target="_blank">libav-user-request@ffmpeg.org</a> with subject "unsubscribe".<br>
</blockquote></div>