<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40"><head><meta http-equiv=Content-Type content="text/html; charset=utf-8"><meta name=Generator content="Microsoft Word 15 (filtered medium)"><style><!--
/* Font Definitions */
@font-face
{font-family:"Cambria Math";
panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
{font-family:Calibri;
panose-1:2 15 5 2 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{margin:0in;
font-size:11.0pt;
font-family:"Calibri",sans-serif;}
a:link, span.MsoHyperlink
{mso-style-priority:99;
color:blue;
text-decoration:underline;}
span.EmailStyle18
{mso-style-type:personal-reply;
font-family:"Calibri",sans-serif;
color:windowtext;}
.MsoChpDefault
{mso-style-type:export-only;
font-family:"Calibri",sans-serif;}
@page WordSection1
{size:8.5in 11.0in;
margin:1.0in 1.0in 1.0in 1.0in;}
div.WordSection1
{page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]--></head><body lang=EN-US link=blue vlink=purple style='word-wrap:break-word'><div class=WordSection1><p class=MsoNormal>My playback library removes/ignores audio and timing information, reducing overhead for minimal processing, as the use case is for algorithm training and video security, both process heavy use cases. i.e it tries to playback the video as fast as possible with as little CPU as it can. <o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><div style='border:none;border-top:solid #E1E1E1 1.0pt;padding:3.0pt 0in 0in 0in'><p class=MsoNormal><b>From:</b> Libav-user <libav-user-bounces@ffmpeg.org> <b>On Behalf Of </b>Sushma<br><b>Sent:</b> Saturday, October 15, 2022 9:07 AM<br><b>To:</b> This list is about using libavcodec, libavformat, libavutil, libavdevice and libavfilter. <libav-user@ffmpeg.org><br><b>Subject:</b> Re: [Libav-user] Slow down video<o:p></o:p></p></div><p class=MsoNormal><o:p> </o:p></p><div><p class=MsoNormal>Thanks for the reference code. I would like to check it.<o:p></o:p></p><div><p class=MsoNormal><o:p> </o:p></p></div><div><p class=MsoNormal>Can you let me know what was the command line you had used to get it working. I was able to get blur video from the same command line in code as well. But not for slow down video. I was not able to slow down the complete video as well.<o:p></o:p></p></div><div><p class=MsoNormal><o:p> </o:p></p></div></div><p class=MsoNormal><o:p> </o:p></p><div><div><p class=MsoNormal>On Sat, Oct 15, 2022 at 8:06 PM <<a href="mailto:bsenftner@earthlink.net">bsenftner@earthlink.net</a>> wrote:<o:p></o:p></p></div><blockquote style='border:none;border-left:solid #CCCCCC 1.0pt;padding:0in 0in 0in 6.0pt;margin-left:4.8pt;margin-right:0in'><div><div><div><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'>I have an ffmpeg video player that has the same AVFilter Graph text string inputs as the command line ffmpeg. You could try looking at how I setup the code and compare with what you’re doing.<o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'> <o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'>The key bits are in this file:<o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><a href="https://github.com/bsenftner/ffvideo/blob/master/ffvideolib_src/ffvideo_frameMgr.h" target="_blank">https://github.com/bsenftner/ffvideo/blob/master/ffvideolib_src/ffvideo_frameMgr.h</a><o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'> <o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'>There’s a frame manager class implementing frame filters starting around line 110. <o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'> <o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'>Note, this does not do audio, but I’ve been told by a dev with a similar playback library the audio handling is very similar. <o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'> <o:p></o:p></p><div style='border:none;border-top:solid #E1E1E1 1.0pt;padding:3.0pt 0in 0in 0in'><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><b>From:</b> Libav-user <<a href="mailto:libav-user-bounces@ffmpeg.org" target="_blank">libav-user-bounces@ffmpeg.org</a>> <b>On Behalf Of </b>Sushma<br><b>Sent:</b> Saturday, October 15, 2022 7:36 AM<br><b>To:</b> This list is about using libavcodec, libavformat, libavutil, libavdevice and libavfilter. <<a href="mailto:libav-user@ffmpeg.org" target="_blank">libav-user@ffmpeg.org</a>><br><b>Subject:</b> Re: [Libav-user] Slow down video<o:p></o:p></p></div><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'> <o:p></o:p></p><div><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'>Thanks for the reply.<o:p></o:p></p><div><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'> <o:p></o:p></p></div><div><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'>If <span style='color:#500050'>pix_fmt=0 does not work, what are the other pixel formats that I can use to achieve my requirement?</span><o:p></o:p></p></div><div><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'> <o:p></o:p></p></div><div><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'>>>atrim gets from [in1], i.e. buffer, while in the other version atrim is<br>connected to [0:a], i.e. a abuffer.<o:p></o:p></p></div><div><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'> <o:p></o:p></p></div><div><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'>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.<o:p></o:p></p></div><div><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'> <o:p></o:p></p></div><div><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'>Regards,<o:p></o:p></p></div><div><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'>Madhukar <o:p></o:p></p></div></div><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'> <o:p></o:p></p><div><div><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'>On Fri, Oct 14, 2022 at 6:43 PM Nicolas George <<a href="mailto:george@nsup.org" target="_blank">george@nsup.org</a>> wrote:<o:p></o:p></p></div><blockquote style='border:none;border-left:solid #CCCCCC 1.0pt;padding:0in 0in 0in 6.0pt;margin-left:4.8pt;margin-top:5.0pt;margin-right:0in;margin-bottom:5.0pt'><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'>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" 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".<o:p></o:p></p></blockquote></div></div></div><p class=MsoNormal>_______________________________________________<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" 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".<o:p></o:p></p></div></blockquote></div></div></body></html>