[FFmpeg-trac] #5283(avcodec:closed): Add bitstream filter to remove Closed Captions from h264

FFmpeg trac at avcodec.org
Fri Aug 6 21:52:25 EEST 2021


#5283: Add bitstream filter to remove Closed Captions from h264
-------------------------------------+-------------------------------------
             Reporter:  Carl Eugen   |                    Owner:  (none)
  Hoyos                              |
                 Type:  enhancement  |                   Status:  closed
             Priority:  wish         |                Component:  avcodec
              Version:  git-master   |               Resolution:  fixed
             Keywords:  h264 cc      |               Blocked By:
             Blocking:               |  Reproduced by developer:  0
Analyzed by developer:  0            |
-------------------------------------+-------------------------------------
Changes (by Balling):

 * status:  new => closed
 * resolution:   => fixed

Comment:

 It is actually possible, just like with primaries/trc/matrix OF THE SOURCE
 that is in prefix type of SEI.

 FFmpeg has a bitstream filter called filter_units, which allows you to
 pass or reject NAL units by type. So we can use this to remove all the SEI
 NAL units, which strips out the captions. Type 6 is for closed caption.

 ffmpeg -i input.mkv -codec copy -bsf:v "filter_units=remove_types=6"
 output.mkv


 See: https://stackoverflow.com/questions/48177694/removing-eia-608-closed-
 captions-from-h-264-without-reencode

 Now, that is not perfect, since there are many types of SEI. You can
 further use the type of SEI (like 39 for prefix SEI)

 I suppose the same can be done for HEVC.
-- 
Ticket URL: <https://trac.ffmpeg.org/ticket/5283#comment:2>
FFmpeg <https://ffmpeg.org>
FFmpeg issue tracker


More information about the FFmpeg-trac mailing list