[Libav-user] howto play lavfi complexfilter-script in c++

Leon van Kammen leonvankammen at gmail.com
Thu May 7 19:50:47 EEST 2020


Hi All,

FFmpeg c++ newbie here, I've just joined this wonderful mailinglist, and
have a mission:
Im trying to get the c++ equivalent of this amazing cmd:

$ ffmpeg -filter_complex_script script.txt test.mp4


script.txt
==========
testsrc=r=5:n=1:d=2 [v1];
sine=440:b=2:d=1    [a1];
testsrc=r=5:n=1:d=1 [v2];
sine=622:b=2:d=2    [a2];
testsrc=r=5:n=1:d=1 [v3];
sine=880:b=2:d=1    [a3];

[v1][a1][v2][a2][v3][a3] concat=v=1:a=1:n=3

---

I've tried reading the ffmpeg source, some c++ examples, but without any
results.
I'm stuck fiddling with avformat_open_input(&format, "lavfi", NULL, NULL).

Questions:
1. any tips where to look?
2. how do i read frames from lavfi-streams from the filtergraph?
avcodec_decode_video2()? avcodec_receive_frame()?

My shtick is: I want to play a filtergraph-file in my qt-app (so I can use
movie/amovie/crossfade/mix/blend nodes).
The good news is : playing one simple videofile works using
avformat_open_input.
However, I want to refactor it to render a complex-filter-script like above
instead.
This would be much more powerful, so I any pointers are very welcome!

Thanks for being awesome.


Leon
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://ffmpeg.org/pipermail/libav-user/attachments/20200507/bd1cc4e9/attachment.html>


More information about the Libav-user mailing list