[FFmpeg-devel] [PATCH 02/13] lavf: update auto-bsf to new BSF API
Michael Niedermayer
michael at niedermayer.cc
Wed Jun 29 04:53:42 CEST 2016
On Tue, Jun 28, 2016 at 01:33:13PM +0200, Nicolas George wrote:
> Le primidi 11 messidor, an CCXXIV, Nicolas George a écrit :
> > Well, looking at the code, I am thinking that the current design is flawed:
> > the extra alloc in ff_bsf_get_packet() seems completely useless, and could
> > be removed as is without any other change in the current code, because all
> > current filters are 1:1, it would be different for future 1:N filters. Maybe
> > implementing ff_bsf_peek_packet() and using it to replace
> > ff_bsf_get_packet() in 1:1 cases would do the trick.
>
> I have checked that the following quick-and-dirty changes pass FATE. Making
> it in shape (testing filters not covered by FATE, making future-proof) would
> take time that I would like to spend on lavfi right now. But it proves the
> overhead can be reduced easily.
applying only the attached patch causes
./ffmpeg -i ~/videos/matrixbench_mpeg2.mpg -vbsf noise file.avi
to
[mpeg4 @ 0x25c60a0] Failed to open bitstream filter noise for stream 0 with codec mpeg4: Resource temporarily unavailable
[mpeg4 @ 0x25c60a0] Failed to open bitstream filter noise for stream 0 with codec mpeg4: Resource temporarily unavailable
[mpeg4 @ 0x25c60a0] Failed to open bitstream filter noise for stream 0 with codec mpeg4: Resource temporarily unavailable
[mpeg4 @ 0x25c60a0] Failed to open bitstream filter noise for stream 0 with codec mpeg4: Resource temporarily unavailable
[mpeg4 @ 0x25c60a0] Failed to open bitstream filter noise for stream 0 with codec mpeg4: Resource temporarily unavailable
[mpeg4 @ 0x25c60a0] Failed to open bitstream filter noise for stream 0 with codec mpeg4: Resource temporarily unavailable
[mpeg4 @ 0x25c60a0] Failed to open bitstream filter noise for stream 0 with codec mpeg4: Resource temporarily unavailable
[mpeg4 @ 0x25c60a0] Failed to open bitstream filter noise for stream 0 with codec mpeg4: Resource temporarily unavailable
Segmentation fault
valgrind is also unhappy
==26545== Invalid read of size 8
==26545== at 0x763535: ff_bsf_get_packet (ffmpeg/ffmpeg_g)
==26545== by 0xAA1653: noise (ffmpeg/ffmpeg_g)
==26545== by 0x7609BB: av_bitstream_filter_filter (ffmpeg/ffmpeg_g)
==26545== by 0x705A4D: av_apply_bitstream_filters (ffmpeg/ffmpeg_g)
==26545== by 0x4B5C68: write_frame (ffmpeg/ffmpeg_g)
==26545== by 0x4B6A42: do_video_out (ffmpeg/ffmpeg_g)
==26545== by 0x4B9D3A: reap_filters (ffmpeg/ffmpeg_g)
==26545== by 0x4BE124: transcode (ffmpeg/ffmpeg_g)
==26545== by 0x4A04D5: main (ffmpeg/ffmpeg_g)
==26545== Address 0x35789af8 is 24 bytes inside a block of size 88 free'd
==26545== at 0x4C2B5D9: free (vg_replace_malloc.c:446)
==26545== by 0xAA16F3: noise (ffmpeg/ffmpeg_g)
==26545== by 0x760954: av_bitstream_filter_filter (ffmpeg/ffmpeg_g)
==26545== by 0x705A4D: av_apply_bitstream_filters (ffmpeg/ffmpeg_g)
==26545== by 0x4B5C68: write_frame (ffmpeg/ffmpeg_g)
==26545== by 0x4B6A42: do_video_out (ffmpeg/ffmpeg_g)
==26545== by 0x4B9D3A: reap_filters (ffmpeg/ffmpeg_g)
==26545== by 0x4BE124: transcode (ffmpeg/ffmpeg_g)
==26545== by 0x4A04D5: main (ffmpeg/ffmpeg_g)
==26545==
==26545== Invalid read of size 4
==26545== at 0x763548: ff_bsf_get_packet (ffmpeg/ffmpeg_g)
==26545== by 0xAA1653: noise (ffmpeg/ffmpeg_g)
==26545== by 0x7609BB: av_bitstream_filter_filter (ffmpeg/ffmpeg_g)
==26545== by 0x705A4D: av_apply_bitstream_filters (ffmpeg/ffmpeg_g)
==26545== by 0x4B5C68: write_frame (ffmpeg/ffmpeg_g)
==26545== by 0x4B6A42: do_video_out (ffmpeg/ffmpeg_g)
==26545== by 0x4B9D3A: reap_filters (ffmpeg/ffmpeg_g)
==26545== by 0x4BE124: transcode (ffmpeg/ffmpeg_g)
==26545== by 0x4A04D5: main (ffmpeg/ffmpeg_g)
==26545== Address 0x35789b18 is 56 bytes inside a block of size 88 free'd
==26545== at 0x4C2B5D9: free (vg_replace_malloc.c:446)
==26545== by 0xAA16F3: noise (ffmpeg/ffmpeg_g)
==26545== by 0x760954: av_bitstream_filter_filter (ffmpeg/ffmpeg_g)
==26545== by 0x705A4D: av_apply_bitstream_filters (ffmpeg/ffmpeg_g)
==26545== by 0x4B5C68: write_frame (ffmpeg/ffmpeg_g)
==26545== by 0x4B6A42: do_video_out (ffmpeg/ffmpeg_g)
==26545== by 0x4B9D3A: reap_filters (ffmpeg/ffmpeg_g)
==26545== by 0x4BE124: transcode (ffmpeg/ffmpeg_g)
==26545== by 0x4A04D5: main (ffmpeg/ffmpeg_g)
==26545==
frame= 1 fps=0.0 q=3.5 Lsize= 24kB time=00:00:00.04 bitrate=4899.6kbits/s speed=0.0532x
video:13kB audio:1kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 70.148628%
==26545== Invalid read of size 4
==26545== at 0x7532B2: av_packet_free (ffmpeg/ffmpeg_g)
==26545== by 0x7631D1: av_bsf_free (ffmpeg/ffmpeg_g)
==26545== by 0x7608A0: av_bitstream_filter_close (ffmpeg/ffmpeg_g)
==26545== by 0x4BC99B: ffmpeg_cleanup (ffmpeg/ffmpeg_g)
==26545== by 0x4A18C0: exit_program (ffmpeg/ffmpeg_g)
==26545== by 0x4A0555: main (ffmpeg/ffmpeg_g)
==26545== Address 0x35789b18 is 56 bytes inside a block of size 88 free'd
==26545== at 0x4C2B5D9: free (vg_replace_malloc.c:446)
==26545== by 0xAA16F3: noise (ffmpeg/ffmpeg_g)
==26545== by 0x760954: av_bitstream_filter_filter (ffmpeg/ffmpeg_g)
==26545== by 0x705A4D: av_apply_bitstream_filters (ffmpeg/ffmpeg_g)
==26545== by 0x4B5C68: write_frame (ffmpeg/ffmpeg_g)
==26545== by 0x4B6A42: do_video_out (ffmpeg/ffmpeg_g)
==26545== by 0x4B9D3A: reap_filters (ffmpeg/ffmpeg_g)
==26545== by 0x4BE124: transcode (ffmpeg/ffmpeg_g)
==26545== by 0x4A04D5: main (ffmpeg/ffmpeg_g)
...
[...]
--
Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB
Modern terrorism, a quick summary: Need oil, start war with country that
has oil, kill hundread thousand in war. Let country fall into chaos,
be surprised about raise of fundamantalists. Drop more bombs, kill more
people, be surprised about them taking revenge and drop even more bombs
and strip your own citizens of their rights and freedoms. to be continued
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 181 bytes
Desc: Digital signature
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20160629/c14538ca/attachment.sig>
More information about the ffmpeg-devel
mailing list