VideoHelp Forum




+ Reply to Thread
Results 1 to 2 of 2
  1. Member
    Join Date
    Apr 2020
    Location
    Los Angeles, CA
    Search Comp PM
    Hello all:
    I use this batch file to extract the closed caption subtitles from my video files into .srt files:

    @echo off
    setlocal
    FOR %%F IN (*.mp4) DO ffmpeg -f lavfi -i movie="%%F"[out+subcc] -map 0:1 -y "%%~nF.srt"

    However, it adds a bunch of formatting to the .srt files and I need to run a text editor macro to remove all of the "extra" formatting.
    Is there a way to rip the subtitles into an .srt without all of the formatting, just the plain text? Below is a few lines as an example.

    Thanks,
    BobbyGee2003
    -----------------------------------------------------------------------

    1
    00:00:17,351 --> 00:00:19,603
    <font face="Monospace">{\an7}[thunder crashing]</font>

    2
    00:00:19,853 --> 00:00:22,773
    <font face="Monospace">{\an7}[slow electric guitar music]</font>

    3
    00:01:28,046 --> 00:01:29,089
    <font face="Monospace">{\an7}[whispers] Someone’s here.</font>

    4
    00:01:31,008 --> 00:01:33,302
    <font face="Monospace">{\an7}Hmm? Mm...</font>

    5
    00:01:35,095 --> 00:01:37,764
    <font face="Monospace">{\an7}[Anne] Darling. Mm.</font>

    6
    00:01:39,224 --> 00:01:40,642
    <font face="Monospace">{\an7}[music continues]</font>
    Quote Quote  
  2. Feels Good Man 2nHxWW6GkN1l916N3ayz8HQoi's Avatar
    Join Date
    Jan 2024
    Location
    Pepe Island
    Search Comp PM
    You can import it into Subtitle Edit and remove all formatting.

    Image
    [Attachment 77366 - Click to enlarge]


    Edit: Oh you want it straight from ffmpeg. My bad, I missed that.

    Edit2: This command keeps the formatting
    Code:
    ffmpeg -f lavfi -i movie="input.mkv"[out+subcc] -map 0:1 -y "test.srt"
    And this one doesn't
    Code:
    ffmpeg -f lavfi -i movie="input.mkv"[out+subcc] -map 0:1 -c:s text -y "test.srt"
    You should try it.
    Last edited by 2nHxWW6GkN1l916N3ayz8HQoi; 1st Mar 2024 at 03:58.
    --[----->+<]>.++++++++++++.---.--------.
    [*drm mass downloader: widefrog*]~~~~~~~~~~~[*how to make your own mass downloader: guide*]
    Quote Quote  



Similar Threads

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