Rip SRT file from EIA-608 CEA-708 TV file

Started by Tinhorn, June 26, 2021, 09:41:34 PM

Previous topic - Next topic

Tinhorn

guess what

I made a Post on MPV Player & EIA-608 / CEA-708  & playing embedded subtitles & <CUT> video Files

I found a way to rip SubTitleFile.SRT from Cut MKV video files from AVIdemux using FFMPEG & ccExtractor  [of original .MTS or probably other video w/sub files (like .ts files)

for me, ccExtractor did not read the EIA-608 / CEA-708  subtitles when the video cut files [MKV] but...

One of the Big Guys working with FFMPEG [ Gyan ] & probably other guys came with this code:

 ffmpeg -y -r 29.97   -async 1  -vsync 1 -i Input.mts  -vf scale=720x480 -aspect 16:9 -pix_fmt yuv420p  -c:v libx264 -crf 20  -c:a aac -strict experimental -b:a 192k  -ac 2   -mbd rd -flags +mv4+aic -trellis 2 -cmp 2 -subcmp 2 -g 300  -async 1  -vsync 1 Output.mp4

this code embedded the EIA-608 / CEA-708  subtitles in the MP4 file & ccExtractor can create the SRT subtitle file

   [A standard for closed captioning NTSC TV broadcasts in the United States, Canada, and Mexico]


....greate.....

now go to the Internet & download ffmpeg zip files & zip ccextractor[88] files


I created a Windows 10 Batch file that will convert the video.MKV to MP4 then the Batch file will tell it to tell ccExtractor to rip the Subtitle for us

Create a Folder & put some of the <CUT> MKV video's in it

In the folder add these files for it do the work

ffmpeg.exe

ccextractorwinfull.exe
avcodec-57.dll
avformat-57.dll
avutil-55.dll
swresample-2.dll
swscale-4.dll

paste the bottom code to  NotePad & name it "CreateMP4toSRT.BAT"  & sve it in the folder
 


@ECHO OFF

rem       NOTE   NOTE    NOTE

rem       if you make changes to the settings.....
rem       make sure there are NO SPACES after these 4 variable settings 
rem              ( e.g.   "mp4    "   not allowed )

Rem     The below 3 variables can be changed if needed, see notes below

   set ExtToChange=mkv
   set NewExt=mp4
   set NewExtSRT=srt

rem   ExtToChange = the Original movie EXTENSION (e.g. AVI, Mov, mpg, etc)
rem   NewExt      = the Converted movie EXTENSION (e.g. mp4, mpg, mov, etc)

rem     Main Code     

   set start=%date% %time%

   For %%X in (*.%ExtToChange%) do (
      cls
      @Echo.
      @Echo.
             
      ffmpeg  -fflags +genpts -y -r 29.97   -async 1  -vsync 1 -i "%%X"  -vf scale=720x480 -aspect 16:9 -pix_fmt yuv420p  -c:v libx264 -crf 20  -c:a aac -strict experimental -b:a 192k  -ac 2   -mbd rd -flags +mv4+aic -trellis 2 -cmp 2 -subcmp 2 -g 300  -async 1  -vsync 1  "%%~nX.%NewExt%"

   )

   For %%X in (*.%NewExt%) do (
   
      @Echo.
      @Echo.

      ccextractorwinfull    "%%X"     
   )

   @Echo Done, deleting temporary files

   if exist "null.%NewExt%" del "null.%NewExt%"
   if exist ffmpeg2pass-0.log del ffmpeg2pass-0.log

   @echo off
       setlocal enabledelayedexpansion
       for %%j in (*.%NewExt%) do (
          set filename=%%~nj
          set filename=!filename:.%ExtToChange%=!

   )

   @Echo.

   @Echo Start: %start%
   @Echo.
   @Echo End  : %date% %time%
   @Echo.
   @Echo.
   @Echo.

pause