[FFmpeg-trac] #249(avfilter:open): Fix the filter remove-logo

FFmpeg trac at avcodec.org
Tue Sep 13 10:56:57 CEST 2011


#249: Fix the filter remove-logo
-------------------------------------+------------------------------------
             Reporter:  pbasista     |                    Owner:
                 Type:  defect       |                   Status:  open
             Priority:  normal       |                Component:  avfilter
              Version:  git-master   |               Resolution:
             Keywords:  remove-logo  |               Blocked By:
             Blocking:               |  Reproduced by developer:  1
Analyzed by developer:  0            |
-------------------------------------+------------------------------------

Comment (by cehoyos):

 ppm does not crash atm, but result,png looks very bad,
 pgm crashes:
 {{{
 (gdb) r -i test2.ts -an -vf mp=remove-logo:out.pgm out2.avi

 Starting program: ffmpeg_g -i test2.ts -an -vf mp=remove-logo:out.pgm
 out2.avi
 [Thread debugging using libthread_db enabled]
 ffmpeg version N-32542-g3867035, Copyright (c) 2000-2011 the FFmpeg
 developers
   built on Sep 13 2011 10:00:27 with gcc 4.5.3
   configuration: --cc=/usr/local/gcc-4.5.3/bin/gcc --enable-gpl
   libavutil    51. 16. 0 / 51. 16. 0
   libavcodec   53. 13. 0 / 53. 13. 0
   libavformat  53. 12. 0 / 53. 12. 0
   libavdevice  53.  3. 0 / 53.  3. 0
   libavfilter   2. 40. 0 /  2. 40. 0
   libswscale    2.  1. 0 /  2.  1. 0
   libpostproc  51.  2. 0 / 51.  2. 0
 [mpegts @ 0x12f4780] parser not found for codec dvb_teletext, packets or
 times may be invalid.
 [mpeg2video @ 0x12fbcc0] mpeg_decode_postinit() failure
     Last message repeated 4 times
 [mpegts @ 0x12f4780] PES packet size mismatch
     Last message repeated 3 times
 [NULL @ 0x131d9c0] start time is not set in estimate_timings_from_pts
 [NULL @ 0x1321ac0] start time is not set in estimate_timings_from_pts
 [NULL @ 0x1323b40] start time is not set in estimate_timings_from_pts
 [NULL @ 0x1325bc0] start time is not set in estimate_timings_from_pts
 [NULL @ 0x1327c40] start time is not set in estimate_timings_from_pts
 [NULL @ 0x1329cc0] start time is not set in estimate_timings_from_pts
 [mpegts @ 0x12f4780] PES packet size mismatch
     Last message repeated 3 times
 Input #0, mpegts, from 'test2.ts':
   Duration: 00:00:05.76, start: 12860.063633, bitrate: 2907 kb/s
   Program 10101
     Stream #0.0[0x3f2]: Video: mpeg2video (Main) ([2][0][0][0] / 0x0002),
 yuv420p, 720x576 [SAR 64:45 DAR 16:9], 4300 kb/s, 25.62 fps, 25 tbr, 90k
 tbn, 50 tbc
     Stream #0.1[0x3f3](ger): Audio: mp2 ([3][0][0][0] / 0x0003), 48000 Hz,
 stereo, s16, 160 kb/s (clean effects)
     Stream #0.2[0x3f4](eng): Audio: mp2 ([3][0][0][0] / 0x0003), 48000 Hz,
 stereo, s16, 160 kb/s (clean effects)
     Stream #0.3[0x3f5](ger): Audio: ac3 ([6][0][0][0] / 0x0006), 48000 Hz,
 stereo, s16, 448 kb/s (clean effects)
     Stream #0.4[0x3f6]: Data: none ([6][0][0][0] / 0x0006)
     Stream #0.5[0x3f7](ger): Subtitle: dvb_teletext ([6][0][0][0] /
 0x0006)
     Stream #0.6[0x1b63]: Data: none ([11][0][0][0] / 0x000B)
     Stream #0.7[0x1b64]: Data: none ([11][0][0][0] / 0x000B)
     Stream #0.8[0x1b6d]: Data: none ([12][0][0][0] / 0x000C)
     Stream #0.9[0x1b77]: Data: none ([11][0][0][0] / 0x000B)
     Stream #0.10[0x1bbd]: Data: none ([5][0][0][0] / 0x0005)
   Program 10102
   Program 10120
   Program 10122
 [buffer @ 0x12fb860] w:720 h:576 pixfmt:yuv420p tb:1/1000000 sar:64/45
 sws_param:
 [mp @ 0x12fb980] This is a unholy filter, it will be purified by the
 ffmpeg exorcist team
 which will change its syntax from dark -vf mp to light -vf.
 Thou shalst not make spells or scripts that depend on it
 Output #0, avi, to 'out2.avi':
   Metadata:
     ISFT            : Lavf53.12.0
     Stream #0.0: Video: mpeg4 (FMP4 / 0x34504D46), yuv420p, 720x576 [SAR
 64:45 DAR 16:9], q=2-31, 200 kb/s, 25 tbn, 25 tbc
 Stream mapping:
   Stream #0.0 -> #0.0 (mpeg2video -> mpeg4)
 Press [q] to stop, [?] for help
 [mpeg2video @ 0x12fbcc0] warning: first frame is no keyframe

 Program received signal SIGSEGV, Segmentation fault.
 convert_yv12 (plane=<value optimized out>, y=143, x=<value optimized out>,
 image=0x33d0090,
     value_out=<value optimized out>, vf=<value optimized out>,
 logo_mask=<value optimized out>)
     at libavfilter/libmpcodecs/vf_remove_logo.c:744
 744             get_blur(vf, &output, filter, source_image, x, y, plane);
 (gdb) bt
 #0  0x0000000000456698 in convert_yv12 (plane=<value optimized out>,
 y=143, x=<value optimized out>,
     image=0x33d0090, value_out=<value optimized out>, vf=<value optimized
 out>,
     logo_mask=<value optimized out>)
 #1  0x0000000000456956 in put_image (vf=0x131a140, mpi=0x33d0090,
 pts=849433000000)
     at libavfilter/libmpcodecs/vf_remove_logo.c:789
 #2  0x000000000042712f in end_frame (inlink=0x33143e0) at
 libavfilter/vf_mp.c:872
 #3  0x000000000041bb9f in avfilter_end_frame (link=0x33143e0) at
 libavfilter/avfilter.c:584
 #4  0x000000000042f908 in request_frame (link=0x33143e0) at
 libavfilter/vsrc_buffer.c:192
 #5  0x000000000041b13e in avfilter_request_frame (link=<value optimized
 out>)
     at libavfilter/avfilter.c:514
 #6  0x0000000000426ee0 in request_frame (outlink=0x33145a0) at
 libavfilter/vf_mp.c:832
 #7  0x000000000041b13e in avfilter_request_frame (link=<value optimized
 out>)
     at libavfilter/avfilter.c:514
 #8  0x000000000041f5d4 in av_buffersink_get_buffer_ref (ctx=<value
 optimized out>, bufref=0x12f9d60,
     flags=0) at libavfilter/sink_buffer.c:128
 #9  0x0000000000408dfc in output_packet (ist=<value optimized out>,
 ist_index=0, ost_table=0x12f9b20,
     nb_ostreams=1, pkt=<value optimized out>) at ffmpeg.c:1825
 #10 0x000000000040dbad in transcode (output_files=0x12f80e0,
 nb_output_files=<value optimized out>,
     input_files=0x12fa7b0, nb_input_files=1) at ffmpeg.c:2591
 #11 0x0000000000410ad1 in main (argc=<value optimized out>, argv=<value
 optimized out>) at ffmpeg.c:4373
 (gdb) disass $pc-32 $pc+32
 Dump of assembler code from 0x456678 to 0x4566b8:
 0x0000000000456678 <get_blur+449>:      mov    %rax,%rbp
 0x000000000045667b <get_blur+452>:      nopl   0x0(%rax,%rax,1)
 0x0000000000456680 <get_blur+457>:      cmp    0x14(%rsp),%r15d
 0x0000000000456685 <get_blur+462>:      jg     0x4566cc <get_blur+533>
 0x0000000000456687 <get_blur+464>:      lea    (%r9,%rbp,1),%rsi
 0x000000000045668b <convert_yv12+651>:  mov    %r12,%rcx
 0x000000000045668e <convert_yv12+654>:  mov    %r9,%rax
 0x0000000000456691 <convert_yv12+657>:  xor    %edx,%edx
 0x0000000000456693 <convert_yv12+659>:  nopl   0x0(%rax,%rax,1)
 0x0000000000456698 <get_blur+481>:      cmpb   $0x0,(%rax)
 0x000000000045669b <get_blur+484>:      jne    0x4566b5 <get_blur+510>
 0x000000000045669d <get_blur+486>:      mov    (%r11),%rdi
 0x00000000004566a0 <get_blur+489>:      mov    (%rdi,%rdx,1),%rdi
 0x00000000004566a4 <get_blur+493>:      mov    (%rdi,%r8,1),%edi
 0x00000000004566a8 <get_blur+497>:      test   %edi,%edi
 0x00000000004566aa <get_blur+499>:      je     0x4566b5 <get_blur+510>
 0x00000000004566ac <get_blur+501>:      movzbl (%rcx),%edi
 0x00000000004566af <get_blur+504>:      add    $0x1,%ebx
 0x00000000004566b2 <get_blur+507>:      add    %edi,%r10d
 0x00000000004566b5 <get_blur+510>:      add    $0x1,%rax
 End of assembler dump.
 (gdb) info register
 rax            0x10139be08      4315528712
 rbx            0x0      0
 rcx            0x7ffff54165b0   140737308091824
 rdx            0x0      0
 rsi            0x10139bf71      4315529073
 rdi            0x7      7
 rbp            0x169    0x169
 rsp            0x7fffffffb240   0x7fffffffb240
 r8             0x4      4
 r9             0x10139be08      4315528712
 r10            0x0      0
 r11            0x131b040        20033600
 r12            0x7ffff54165b0   140737308091824
 r13            0x1      1
 r14            0x169    361
 r15            0x0      0
 rip            0x456698 0x456698 <get_blur+481>
 eflags         0x10246  [ PF ZF IF RF ]
 cs             0x33     51
 ss             0x2b     43
 ds             0x0      0
 es             0x0      0
 fs             0x0      0
 gs             0x0      0
 fctrl          0x37f    895
 fstat          0x0      0
 ftag           0xffff   65535
 fiseg          0x0      0
 fioff          0x0      0
 foseg          0x0      0
 fooff          0x0      0
 fop            0x0      0
 mxcsr          0x1fa0   [ PE IM DM ZM OM UM PM ]
 }}}

-- 
Ticket URL: <https://avcodec.org/trac/ffmpeg/ticket/249#comment:7>
FFmpeg <http://ffmpeg.org>
FFmpeg issue tracker


More information about the FFmpeg-trac mailing list