[Libav-user] bitstream filtering

Andrew Randrianasulu randrianasulu at gmail.com
Mon Nov 21 12:42:40 EET 2022


Our software (cinelerra-gg) had some code for using bitstream filtering at
muxing stage, but it was not functional (crashes)

I tried to use this code as example

and added initialization (av_bsf_init())

now simple filters like dump_extra seems to work (file size increases) but
complex ones like h264_metadata get their string (they complain if option
unknown) but not doing their job?

cingg uses av_bsf_list_parse_str
line 3092 here


should I also manually put bitstream filter options in av_dictionary? Or do
something else non-obvious?

Note, right now this code lacks initialization, I just send patch to our
mail list.

 cinelerra-5.1/cinelerra/ffmpeg.C | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/cinelerra-5.1/cinelerra/ffmpeg.C b/cinelerra-5.1/cinelerra/
index 2d441a79..ee3edba5 100644
  --- a/cinelerra-5.1/cinelerra/ffmpeg.C
+++ b/cinelerra-5.1/cinelerra/ffmpeg.C
  @@ -585,6 +585,10 @@ int FFStream::write_packet(FFPacket &pkt)
                ret = av_interleaved_write_frame(ffmpeg->fmt_ctx, pkt);
        else {
+       bsfc->time_base_in = st->time_base;
+       avcodec_parameters_copy(bsfc->par_in, st->codecpar);
+       av_bsf_init(bsfc);
                ret = av_bsf_send_packet(bsfc, pkt);
                while( ret >= 0 ) {
                     FFPacket bs;

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://ffmpeg.org/pipermail/libav-user/attachments/20221121/1fa9698b/attachment.htm>

More information about the Libav-user mailing list