VideoHelp Forum
+ Reply to Thread
Page 1 of 2
1 2 LastLast
Results 1 to 30 of 32
Thread
  1. Average video editor Sviests's Avatar
    Join Date
    Sep 2018
    Location
    USA,Sweden
    Search Comp PM
    Hi,everyone.

    I have a H.264 type file (with .mkv as a container) that has some closed captions (CEA-608 aka EIA-608) and they're appearing in middle of the screen so i need to permanently remove them. I have tried various of options,but seems that most software are not detecting it,while VLC,MPC-HC does and plays them.
    Here's a screen of VLC that shows that there are captions (streams 2-5):
    Click image for larger version

Name:	VLC_captions.png
Views:	400
Size:	26.6 KB
ID:	46698

    I have tried CCextractor , Subtitle Edit , MKVToolinx even VideoRedo had option to remove NAL units,but none of them are able to pick those captions up or exported the file still having those captions.

    For example,CCextractor kept returning
    Code:
    No captions were found in input.
    The closest i got was with FFMPEG.
    Apparently it has a bitstream filter called filter_units so you can either pass or reject NAL units by it's type.I found also this:
    EIA-608 and similar closed captioning standards, the captions are embedded directly in the video bitstream as user data. H.264 bitstreams are stored as a sequence of NAL (network abstraction layer) units. Each unit has a type; user data is stored in a NAL unit of the supplemental enhancement information (SEI) type.


    The latest H.264 spec table (table 7.1 page 86) says that SEI type is 6,so my code would be:
    Code:
    ffmpeg -i input.mkv -codec copy -bsf:v 'filter_units=remove_types=6' output.mkv


    But apparently it doesn't recognize filter_units at all,here's what FFMPEG returns (error in red color):
    Code:
    C:\Users\Sviests\Desktop\ffmpeg\bin>ffmpeg -i input.mkv
    v -codec copy -bsf:v "filter_units=remove_types=6" output.mkv
    ffmpeg version N-90264-g80798e3857 Copyright (c) 2000-2018 the FFmpeg developers
    
      built with gcc 7.3.0 (GCC)
      configuration: --enable-gpl --enable-version3 --enable-sdl2 --enable-bzlib --e
    nable-fontconfig --enable-gnutls --enable-iconv --enable-libass --enable-libblur
    ay --enable-libfreetype --enable-libmp3lame --enable-libopencore-amrnb --enable-
    libopencore-amrwb --enable-libopenjpeg --enable-libopus --enable-libshine --enab
    le-libsnappy --enable-libsoxr --enable-libtheora --enable-libtwolame --enable-li
    bvpx --enable-libwavpack --enable-libwebp --enable-libx264 --enable-libx265 --en
    able-libxml2 --enable-libzimg --enable-lzma --enable-zlib --enable-gmp --enable-
    libvidstab --enable-libvorbis --enable-libvo-amrwbenc --enable-libmysofa --enabl
    e-libspeex --enable-libxvid --enable-libmfx --enable-amf --enable-ffnvcodec --en
    able-cuvid --enable-d3d11va --enable-nvenc --enable-dxva2 --enable-avisynth
      libavutil      56.  8.100 / 56.  8.100
      libavcodec     58. 14.100 / 58. 14.100
      libavformat    58. 10.100 / 58. 10.100
      libavdevice    58.  2.100 / 58.  2.100
      libavfilter     7. 12.100 /  7. 12.100
      libswscale      5.  0.102 /  5.  0.102
      libswresample   3.  0.101 /  3.  0.101
      libpostproc    55.  0.100 / 55.  0.100
    Input #0, matroska,webm, from 'input.mkv':
      Metadata:
        encoder         : libebml v1.3.6 + libmatroska v1.4.9
        creation_time   : 2018-09-10T16:37:05.000000Z
      Duration: 01:39:15.03, start: 0.000000, bitrate: 14218 kb/s
        Stream #0:0: Video: h264 (High), yuv420p(tv, bt709, progressive), 1920x1080
    [SAR 1:1 DAR 16:9], Closed Captions, 23.98 fps, 23.98 tbr, 1k tbn, 47.95 tbc (de
    fault)
        Metadata:
          BPS-eng         : 13576112
          DURATION-eng    : 01:39:15.033000000
          NUMBER_OF_FRAMES-eng: 142778
          NUMBER_OF_BYTES-eng: 10105774524
          _STATISTICS_WRITING_APP-eng: mkvmerge v26.0.0 ('In The Game') 64-bit
          _STATISTICS_WRITING_DATE_UTC-eng: 2018-09-10 16:37:05
          _STATISTICS_TAGS-eng: BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES
        Stream #0:1(eng): Audio: eac3, 48000 Hz, 5.1(side), fltp, 640 kb/s
        Metadata:
          title           : English Surround 5.1 - E-AC3
          BPS-eng         : 640000
          DURATION-eng    : 01:39:14.976000000
          NUMBER_OF_FRAMES-eng: 186093
          NUMBER_OF_BYTES-eng: 476398080
          _STATISTICS_WRITING_APP-eng: mkvmerge v26.0.0 ('In The Game') 64-bit
          _STATISTICS_WRITING_DATE_UTC-eng: 2018-09-10 16:37:05
          _STATISTICS_TAGS-eng: BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES
        Stream #0:2: Video: mjpeg, yuvj440p(pc, bt470bg/unknown/unknown), 450x600 [S
    AR 72:72 DAR 3:4], 90k tbr, 90k tbn, 90k tbc
    Unknown bitstream filter filter_units
    I hope i made it as clear as possible, i would appreciate any type of help.

    Thanks beforehand.
    Quote Quote  
  2. It seems to work ok here ; vlc, mediainfo, ffmpeg report the 608 streams gone , and ffmpeg no longer reports closed caption for the video stream

    1) check if your ffmpeg binary has filter_units available as a bitstream filter; it might not have been compiled with it
    Code:
    ffmpeg -bsfs

    2) is there a typo in you console copy/paste ? there seems to be an extra "v" after input.mkv . Maybe double check your actual command line
    Quote Quote  
  3. Average video editor Sviests's Avatar
    Join Date
    Sep 2018
    Location
    USA,Sweden
    Search Comp PM
    That extra v was just a typo while copy/pasting here.

    ffmpeg -bsfs returned:
    Code:
    Bitstream filters:
    aac_adtstoasc
    chomp
    dump_extra
    dca_core
    extract_extradata
    h264_metadata
    h264_mp4toannexb
    h264_redundant_pps
    hevc_metadata
    hevc_mp4toannexb
    imxdump
    mjpeg2jpeg
    mjpegadump
    mp3decomp
    mpeg2_metadata
    mpeg4_unpack_bframes
    mov2textsub
    noise
    null
    remove_extra
    text2movsub
    trace_headers
    vp9_raw_reorder
    vp9_superframe
    vp9_superframe_split
    Edit: I updated binaries,filter_units is now there,let's see if it works this time.
    Last edited by Sviests; 11th Sep 2018 at 01:44. Reason: update to avoid double posting
    Quote Quote  
  4. I don't see it in your list

    Here is my list. I'm using a windows binary from zeraone
    https://ffmpeg.zeranoe.com/builds/
    Code:
    Bitstream filters:
    aac_adtstoasc
    chomp
    dump_extra
    dca_core
    eac3_core
    extract_extradata
    filter_units
    h264_metadata
    h264_mp4toannexb
    h264_redundant_pps
    hapqa_extract
    hevc_metadata
    hevc_mp4toannexb
    imxdump
    mjpeg2jpeg
    mjpegadump
    mp3decomp
    mpeg2_metadata
    mpeg4_unpack_bframes
    mov2textsub
    noise
    null
    remove_extra
    text2movsub
    trace_headers
    vp9_metadata
    vp9_raw_reorder
    vp9_superframe
    vp9_superframe_split
    Quote Quote  
  5. Average video editor Sviests's Avatar
    Join Date
    Sep 2018
    Location
    USA,Sweden
    Search Comp PM
    It's all good now. Worked like a charm. Just needed to update some binaries (apparently i thought i had the latest version,heh).
    Anyway,this can be locked now, thanks!
    Quote Quote  
  6. Hi. I want to remove closed captions frm mkv file. how can I remove them?
    Quote Quote  
  7. users currently on my ignore list: deadrats, Stears555
    Quote Quote  
  8. mkvtoolnix can't see closed captions.
    Quote Quote  
  9. Then a simple remux with mkvtoolnix should remove them,... doesn't it?
    users currently on my ignore list: deadrats, Stears555
    Quote Quote  
  10. what's the difference between mkvtoolnix and simple mkvtoolnix? as I said mkv doesn't work.
    Quote Quote  
  11. You wrote that mvktoolnix doesn't see the captions, in which case it won't passthrough the captions on remuxing and thus removing the captions which is what you wanted.
    ...so i need to permanently remove them.
    what's the difference between mkvtoolnix and simple mkvtoolnix?
    ??
    users currently on my ignore list: deadrats, Stears555
    Quote Quote  
  12. To be more clear: I want to remove closed captions on white collar tv show see pic 1. But when add the mkv to mkvtoolnix they can not seen see pic 2. Not the question is: how to remove them?
    Image Attached Thumbnails Click image for larger version

Name:	white collar.jpg
Views:	427
Size:	141.0 KB
ID:	50354  

    Click image for larger version

Name:	2.jpg
Views:	385
Size:	325.3 KB
ID:	50355  

    Quote Quote  
  13. But when add the mkv to mkvtoolnix they can not seen see pic 2.
    Which is exactly why mvktoolnix should remove the files on remuxing.

    1. open file in mvktoolnix
    2. set 'Destination file' to a file with a different name
    3. press 'Start muxing'
    -> new file shouldn't contain the captions (mkvtoolnix doesn't detect the captions thus it won't remux them)
    users currently on my ignore list: deadrats, Stears555
    Quote Quote  
  14. did exactly what you've said. the result is negative see pic.Image
    [Attachment 50356 - Click to enlarge]
    Quote Quote  
  15. can you share a !small! sample of such a file so I can look into it?
    (you can cut/split the file using mkvtoolnix)
    users currently on my ignore list: deadrats, Stears555
    Quote Quote  
  16. I dont have suitable software to split the video. I searched on google but coudn't find it. But I downloaded the movie from this link: http://links.snahp.it/8fEsK5HrAVZEL0zs7cguIMr5YKrukX3Ahiz. the main page is https://snahp.it/?p=45676
    Quote Quote  
  17. Like I wrote:
    you can cut/split the file using mkvtoolnix
    the the options under Output->splitting
    users currently on my ignore list: deadrats, Stears555
    Quote Quote  
  18. thank you. I didn't know that I can do it with mkvtool. here's a sample, you can check the subtitles: https://www.dropbox.com/s/6ech65kq282nv0n/white%20collar-001.mkv?dl=0
    Quote Quote  
  19. Originally Posted by Selur View Post
    Like I wrote:
    you can cut/split the file using mkvtoolnix
    the the options under Output->splitting
    or you can download from here: https://mega.nz/#!ik1SVAjJ!WhDfwH3NlDO8mqjltZ02-16g88865a4S7P50MxAn_Wo
    Quote Quote  
  20. got the file
    users currently on my ignore list: deadrats, Stears555
    Quote Quote  
  21. some first impressions:
    a. extracing the streams with mkvtoolnix and remuxing the raw streams does kind of remove the captions (vlc still shows them in the subtitle list, but shows nothing if they are selected)
    b. same happens when using:
    Code:
    ffmpeg.exe -i "PATH TO INPUT" -c copy -bsf:v h264_mp4toannexb "PATH TO OUTPUT"
    -> doing some further testing.
    users currently on my ignore list: deadrats, Stears555
    Quote Quote  
  22. may be. waiting... not urgent.
    Quote Quote  
  23. Code:
    ffmpeg -i "PATH TO INPUT" -bsf:v "filter_units=remove_types=6" -c copy "PATH TO OUTPUT"
    removes the captions for me

    Cu Selur
    Last edited by Selur; 30th Sep 2019 at 04:12.
    users currently on my ignore list: deadrats, Stears555
    Quote Quote  
  24. ffmpeg-i "PATH TO INPUT" -bsf:v "filter_units=remove_types=6" -c copy "PATH TO OUTPUT"

    I don't know anything about these codes. I only know using softwares like mkvtoolnix
    Quote Quote  
  25. ffmpeg is a command line took you can download from for example: https://ffmpeg.zeranoe.com/builds/
    extracting ffmpeg.exe into a folder of your choice, for example: "E:\ffmpeg.exe" you could call:
    Code:
    "E:\ffmpeg.exe" -i "E:\Input\input.mkv" -bsf:v "filter_units=remove_types=6" -c copy "E:\Output\output.mkv"
    in a Windows Command Prompt to process an input file names "E:\Input\input.mkv" and create and output file named "E:\Output\output.mkv".
    users currently on my ignore list: deadrats, Stears555
    Quote Quote  
  26. looks little bit confusing. will try it in my free time. thank you a lot. I'll write later.
    Quote Quote  
  27. I'll create a modified version of Hybrid with a small step by step for you end send you a link in an hour or so, then you have a gui which will do more easily.

    Cu Selur
    users currently on my ignore list: deadrats, Stears555
    Quote Quote  
  28. Modified Hybrid and released a new version (2019.09.30.1) you can download over at http://selur.de/downloads

    After downloading and installing Hybrid, do the following:
    1. Start Hybrid
    2. set default output and temp paths (under Config->Path->Default XXX path)
    3. save those settings as defaults, press 'Config->Save->All->Save selected' (right lower corner)
    4. enable "Config->Automation->Passthrough streams->Subtitle" in case you want to keep the normal subtitles (if you don't want to keep any subtitles don't do this)
    5. enable "Base->Subtitle" and "Subtitle->Import->Delete subtitle after muxing" for Hybrid to delete extracted and muxed subtitles.
    6. enable "Congig->Input->Extraction->Stream extraction with ffmpeg"
    7. Set "Base->Processing->Video" to "passthrough"
    8. Set "Base->Processing->Audio" to "passthrough all"
    9. Set "Base->Default container" to 'mkv'
    10. In case you set a default output folder which isn't the input folder enable 'Base->Generate' otherwise set the output file ('Base->Output File')
    11. Load your file ("Base->Open File"; upper right corner)
    12. Create a job for Hybrid by pressing "Base->Add to queue" (lower right corner)
    13. Start the processing ("Jobs->Queue->Play"; upper left corner)
    Once the process is done the output should contain no captions.
    Note that you can do multiple files at once by selecting them and then drag&dropping them onto the input line in the Base-tab.

    Cu Selur
    users currently on my ignore list: deadrats, Stears555
    Quote Quote  
  29. Member
    Join Date
    Oct 2019
    Location
    Australia
    Search Comp PM
    Selur, you are a champion! This worked perfectly for me.
    Quote Quote  



Similar Threads

Visit our sponsor! Try DVDFab and backup Blu-rays!