Page 1 of 1

hard coded subs

Posted: Fri Nov 02, 2018 4:46 pm
by loggedonman
Hi I was given this script by someone to blur hard coded subtitles on movies. But I have now tried a 1.02GB clip as a .avi and its now taken nearly 4 hours. the preview of movie has now reached the end of movie, but the dos window is still running. it says this now. how much longer is it going to take
[Parsed_delogo_0 @ 00000266099288a0] Note: default band value was changed from 4 to 1.
13809.27 M-V: -0.034 fd= 184 aq= 0KB vq= 0KB sq= 0B f=0/0

Code: Select all

 @setlocal
@set ffply= "C:\ffmpeg-3.4-win64-static\bin\ffplay.exe"

@set filename=%1

@rem video width
@set vwidth=1280

@rem subtitle area width
@set subw=1105

@rem subtitle area height
@set subh=86

@rem delogo filter is centered on video
@set xv=(%vwidth%-%subw%)/2

@rem vertical position for delogo filter window
@set yv=2

@echo "delogo=x=%xv%:y=%yv%:w=%subw%:h=%subh%"
@echo copy above line to ffmpeg
@echo .........................................................................

@%ffply% -report -hide_banner -v 32 -stats -i %filename% -an -vf "delogo=x=%xv%:y=%yv%:w=%subw%:h=%subh%:show=1"

@endlocal
@pause  

Re: hard coded subs

Posted: Sat Nov 03, 2018 7:22 pm
by richardpl
Forever, because there is @pause at end, just press any key.

Re: hard coded subs

Posted: Tue Nov 06, 2018 12:11 pm
by loggedonman
richardpl wrote:
Sat Nov 03, 2018 7:22 pm
Forever, because there is @pause at end, just press any key.

no you are not understanding my question. this script is just to make sure the subtitles are blurred correctly,

I need to know how now to set up a script with those numbers from above script to save the movie clip with blurred subs

Re: hard coded subs

Posted: Sat Nov 17, 2018 2:09 pm
by pandy
It smells like my crappy script codding art ;) apologies - luckily to you i'm working on this script for somebody (you?) and since this moment it evolved in a different way - now it is more interactive - doesn't require script modifications, you will be asked for delogo parameters (use virtuadub2 or similar editor that allow you to "measure" subtitles area) then ffplay is launched (significantly faster to confirm visually that delogo parameters works correctly) finally if everything is fine then encoding session is launched. Seem it works for other, maybe it will work for you - apologies for my coding skills:

Code: Select all

@setlocal
@echo off
@echo "ffplay delogo paramaters script"

@rem folder where ffmpeg.exe is located
@set FF=C:\ffmpeg
@set PATH=%FF%;%PATH%

@set filename=%~1

:new
@cls
@rem delogo filter settings
@set /p xx="Enter X - the top left corner coordinate of the subtitle: "
@set /p yy="Enter Y - the top left corner coordinate of the subtitle: "
@set /p ww="Enter W - the width of the subtitle to clear: "
@set /p hh="Enter H - the height of the subtitle to clear: "

@echo .
@echo .
@echo      delogo=x=%xx%:y=%yy%:w=%ww%:h=%hh%
@echo .
@echo .
@echo "Are you OK with above delogo filter parameters"

@choice /c:yn /t 30 /d N /M "You have 30 seconds to decide, Press Y for Yes, N for No."

@if errorlevel 2 goto new
@if errorlevel 1 goto start

:start
@ffplay.exe -hide_banner -v 32 -stats -autoexit  -i %filename% -an -vf "setpts=PTS/5,delogo=x=%xx%:y=%yy%:w=%ww%:h=%hh%:show=1"

@echo .
@echo .
@echo "Start ffmpeg with delogo filter parameters?"
@echo .
@echo .
@choice /c:yn /t 30 /d N /M "You have 30 seconds to decide, Press Y for Yes, N for No."

@if errorlevel 2 goto new
@if errorlevel 1 goto encode

:encode
@cls
@echo .
@echo "ffmpeg begin encode with delogo=x=%xx%:y=%yy%:w=%ww%:h=%hh% parameters"
@echo .

@rem video quality settings
@set vq=23

@rem audio bitrate
@set ab=192

@SET x264opts="crf=%vq%:level=4.0:qpmin=8:vbv_maxrate=19999:vbv_bufsize=9999:ref=3:bframes=3:rc-lookahead=30:cabac=1:interlaced=0:no_psnr=1:no_ssim=1:bluray_compat=1:open-gop=0:pic_struct=1:aud=1:nal_hrd=vbr:force_cfr=1:overscan=show:colorprim=bt709:transfer=bt709:colormatrix=bt709"
@set aproc="pan=stereo|FL < FL+1.414FC+0.5BL+0.5SL+0.25LFE|FR < FR+1.414FC+0.5BR+0.5SR+0.25LFE,dynaudnorm=p=1/sqrt(2):m=100:s=20"
@set vproc="pp=ac,delogo=x=%xx%:y=%yy%:w=%ww%:h=%hh%,scale=iw:ih:sws_flags=spline+accurate_rnd+full_chroma_int+full_chroma_inp:interl=-1:out_range=auto:out_color_matrix=bt709,format=pix_fmts=yuv420p"

@ffmpeg.exe -hide_banner -v 32 -stats -y -i "%filename%" -vf %vproc% -c:v libx264 -preset faster -tune film -profile:v high -level:v 4.0 -x264opts %x264opts% -x264-params %x264opts% -af %aproc% -c:a ac3 -b:a %ab%k -f matroska "%~n1_delogodynaudio.mkv"

@rem - in case of errors to activate log, please remove REM (everything after REM is ignored)
@REM ffmpeg.exe -report -hide_banner -v 32 -stats -y -i "%filename%" -vf %vproc% -c:v libx264 -preset faster -tune film -profile:v high -level:v 4.0 -x264opts %x264opts% -x264-params %x264opts% -af %aproc% -c:a ac3 -b:a %ab%k -f matroska "%~n1_delogodynaudio.mkv"


:end
@echo terminating script
@endlocal
@timeout 30
@exit
btw - to address your question - ffplay console will close if '-autoexit' command will be added.

Re: hard coded subs

Posted: Sun Nov 18, 2018 1:15 pm
by loggedonman
thank you so so much pandy much appreciated