[Libav-user] bitstream filtering

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


Hello!

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
https://github.com/FFmpeg/FFmpeg/blob/master/libavformat/tee.c

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

https://git.cinelerra-gg.org/git/?p=goodguy/cinelerra.git;a=blob;f=cinelerra-5.1/cinelerra/ffmpeg.C;h=2d441a79f6c2bcb244362d024305140cb61c6723;hb=HEAD


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/
ffmpeg.C
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