Welcome to Doom9's Forum, THE in-place to be for everyone interested in DVD conversion.

Before you start posting please read the forum rules. By posting to this forum you agree to abide by the rules.

 

Go Back   Doom9's Forum > Capturing and Editing Video > Avisynth Usage

Reply
 
Thread Tools Search this Thread Display Modes
Old 5th May 2023, 11:37   #1  |  Link
StainlessS
HeartlessS Usurer
 
StainlessS's Avatar
 
Join Date: Dec 2009
Location: Over the rainbow
Posts: 10,980
Batch converter for AVS

Mod to stuff posted elsewhere:- https://forum.doom9.org/showthread.p...16#post1979916
Added two batch files to encode 1:1 FAR avisynth result clips (pixels are 1:1 aspect ratio), to output MP4 and MKV,
perhaps mod for your particular needs.

This seems to be quite bullet proof, and seems to cope OK with SPACES and even Japanese/Chinese hieroglyphics in the file names.
(which earlier scripts did not do well with)


Folder structure
Code:
BATCH_CONVERTER\                            # Containing directory, move it anywhere.
    FFMPEG\                                 # Directory Contains FFMPEG.EXE # EDIT: Plus any required ffmpeg dll's if ffmpeg.exe is not statically linked version, ie requires some ffmpeg dll files.
    INPUT\                                  # Dir, files to be converted
    OUTPUT\                                 # Dir, Converted results
    Convert_Input_To_UtVideo_Output.BAT                 # Batch File, convert to lossless AVI
    Encode_SquarePixel_AVS_Input_To_Output_AVC_MP4.BAT  # Batch File, Encode square pixel AVS script to x264 MP4
    Encode_SquarePixel_AVS_Input_To_Output_HEVC_MKV.BAT # Batch File, Encode square pixel AVS script to x265 MKV

Avoid problem (eg not frame accurate source filter) clips by converting to AVI with UtVideo video and PCM audio lossless codecs.

Convert_Input_To_UtVideo_Output.BAT
Code:
setlocal

REM Where to Find ffmpeg
set FFMPEG=".\FFMPEG\ffmpeg.exe"

FOR /R ".\INPUT" %%A IN (*.wmv *.mpg *.avi *.flv *.mov *.mp4 *.m4v *.RAM *.RM *.mkv *.TS *.ogv *.264 *.webm *.m2v *.VOB) DO (
  %FFMPEG% -i "%%A" -vcodec utvideo -acodec pcm_s16le ".\OUTPUT\%%~nA.AVI"
)
Pause
These two set aspect ratio based upon square pixels, ie by input avs FAR, Frame Aspect Ratio (ie width/height).
Maybe mod to your favourite crf and aac audio bitrate.

Encode_SquarePixel_AVS_Input_To_Output_AVC_MP4.BAT
Code:
setlocal

REM Where to Find ffmpeg
set FFMPEG=".\FFMPEG\ffmpeg.exe"

FOR /R ".\INPUT" %%A IN (*.avs) DO (
  %FFMPEG% -i "%%A" -c:v libx264 -crf 21.5 -preset slow -c:a aac -b:a 96k  ".\OUTPUT\%%~nA.MP4"
)
Pause
Encode_SquarePixel_AVS_Input_To_Output_HEVC_MKV.BAT
Code:
setlocal

REM Where to Find ffmpeg
set FFMPEG=".\FFMPEG\ffmpeg.exe"

FOR /R ".\INPUT" %%A IN (*.avs) DO (
  %FFMPEG% -i "%%A" -c:v libx265 -crf 25.0 -preset slow -c:a aac -b:a 96k  ".\OUTPUT\%%~nA.MKV"
)
Pause
Can create your own as above, or download 7z compressed file of about 35MB [including ffmpeg.exe] from UTILITY/Batch_Converter.7z
from StainlessS@MediaFire below this post in my sig. [in the UTILITY folder]

or direct link here:- https://www.mediafire.com/file/nhaxv...VERTER.7z/file

I think you could point output to anywhere else by replacing BLUE '.\OUTPUT' above with FULL DRIVE & PATH (no filename nor extension EDIT: Output folder MUST Exist)

If you already have path to ffmpeg.exe set in your system environment PATH Variable, then can change above %FFMPEG% to just FFMPEG.EXE and it should work without needing
the FFMPEG\ffmpeg.exe in zip.
eg,
Code:
setlocal

FOR /R ".\INPUT" %%A IN (*.wmv *.mpg *.avi *.flv *.mov *.mp4 *.m4v *.RAM *.RM *.mkv *.TS *.ogv *.264 *.webm *.m2v *.VOB) DO (
  Ffmpeg.Exe -i "%%A" -vcodec utvideo -acodec pcm_s16le ".\OUTPUT\%%~nA.AVI"
)
Pause
and then dont need the FFMPEG folder or zip included ffmpeg.exe.

Reino 32 bit XP [Included in zip, works anywhere but maybe slower in x64 machine] compatible ffmpeg:- https://rwijnsma.home.xs4all.nl/files/ffmpeg/?C=M
I suggest STATIC linked [no dll's] version.

Perhaps users would like to post their additional favourite compatible FFMPEG BAT files. [Together with a name for the BAT file]
__________________
I sometimes post sober.
StainlessS@MediaFire ::: AND/OR ::: StainlessS@SendSpace

"Some infinities are bigger than other infinities", but how many of them are infinitely bigger ???

Last edited by StainlessS; 5th May 2023 at 14:50.
StainlessS is offline   Reply With Quote
Old 5th May 2023, 12:22   #2  |  Link
StainlessS
HeartlessS Usurer
 
StainlessS's Avatar
 
Join Date: Dec 2009
Location: Over the rainbow
Posts: 10,980
Additional to zip: (not included in zip)

Below BAT files have had the REM (REMark, ie comment) and PAUSE (Does not wait for KeyPress before ending) lines removed.

Convert_Input_Audio_To_Stereo_WAV.BAT
Code:
setlocal
set FFMPEG=".\FFMPEG\ffmpeg.exe"
FOR /R ".\INPUT" %%A IN (*.avs *.thd *.dts *.ac3 *.w64 *.aac *.m4a *.eac3 *.wav *.mp3) DO (
  %FFMPEG% -i "%%A" -vn  -acodec pcm_s16le -ac 2  ".\OUTPUT\%%~nA.WAV"
)
Extract_Metadata_To_Output_TXT.BAT [EDIT: Adding a SPACE separated '*.mp3' after the input wildcards should extract mp3 tags, I think, untested]
Code:
setlocal
set FFMPEG=".\FFMPEG\ffmpeg.exe"
FOR /R ".\INPUT" %%A IN (*.MXF *.mp4 *.mkv)) DO (
  %FFMPEG% -i "%%A" -f ffmetadata  ".\OUTPUT\%%~nA.TXT"
)
Might produce Something like this for simple MP4 [eg, See this Ukrainian <lives in USA> girl's FABULOUS Channel, Totally Enchanting ] :- https://www.youtube.com/watch?v=YS6A1slhwd4
Code:
;FFMETADATA1
major_brand=mp42
minor_version=0
compatible_brands=isommp42
encoder=Lavf59.16.100
More from her channel:
https://www.youtube.com/watch?v=iS4qiEw48bI
https://www.youtube.com/watch?v=diP9GLG56Ws
https://www.youtube.com/watch?v=bqbtCs5MRco
https://www.youtube.com/watch?v=8U3kShg9JZc
https://www.youtube.com/watch?v=Yh8WlM_BEs0
https://www.youtube.com/watch?v=1jyUtnvZg80

Or even like this for MP4 [ https://www.youtube.com/watch?v=QB4dQcxgJPY ]
(below edited for screen wraparound, might not make sense in Korean)
Code:
;FFMETADATA1
major_brand=isom
minor_version=512
compatible_brands=isomiso2avc1mp41
title=[MV] GIRL'S DAY(걸스데이) _ Darling(달링)
artist=1theK (원더케이)
date=20140713
description=[MV] GIRL'S DAY(걸스데이) _ Darling(달링)\
\
*English subtitles are now available. :D\
(Please click on 'CC' button or activate 'Interactive Transcript' function)\
\
:: iTunes DL : https://itunes.apple.com/us/album/gi...p/id898670967\
\
Girl's Day, who dominated early 2014, is back again with a summer season song!\
\
Title 'Darling' is written by Double Sidekick who also wrote Girl's Day's biggest hit song of 2014, 'Something'. 
It features awesome brass sessions and exciting shuffle rhythms that really cools off the summer heat! 
The cute lyrics about imagining 'summer loving' help the listener feel bubbly and happy!\
\
▶1theK FB  : http://www.facebook.com/1theK\
▶1theK TW : https://twitter.com/1theK\
▶1theK G+  : https://plus.google.com/+1theK\
\
2014年上半期を「Something」で熱く盛り上げたガールズデーが夏のシーズンソングで帰ってきた。 \
\
タイトル曲「Darling」は、ガールズデイと「Something」で2014年最高のコンビネーションを成したプロデューサーチーム'イダンヨプチャギ'の作品で、
熱い夏冷たい水鉄砲のように吹き出るブラスセッションと軽快なシャッフルリズムが全身を涼しく巻き込む。特に夏の日、突然訪れた恋についてのキュー
トな想像が聞き手にパチパチと弾ける清涼飲料のような涼しさを与える。 \
\
2014년 상반기를 '썸씽'으로 뜨겁게 달궜던 걸스데이가 여름 시즌송으로 돌아왔다.\
\
타이틀곡 "Darling"은 걸스데이와 '썸씽'으로 2014 최고의 콤비네이션을 이룬 프로듀서팀 이단옆차기의 작품으로 뜨거운 여름날 
시원한 물대포처럼 터지는 브라스세션과 경쾌한 셔플리듬이 온 몸을 시원하게 휘감는다. 특히 여름날 갑자기 찾아온 사랑에 대한 
귀여운 상상이 듣는 이로 하여금 톡톡 쏘는 청량음료 같은 시원함을 선사 한다.
comment=[MV] GIRL'S DAY(걸스데이) _ Darling(달링)\
\
*English subtitles are now available. :D\
(Please click on 'CC' button or activate 'Interactive Transcript' function)\
\
:: iTunes DL : https://itunes.apple.com/us/album/gi...p/id898670967\
\
Girl's Day, who dominated early 2014, is back again with a summer season song!\
\
Title 'Darling' is written by Double Sidekick who also wrote Girl's Day's biggest hit song of 2014, 'Something'. 
It features awesome brass sessions and exciting shuffle rhythms that really cools off the summer heat! 
The cute lyrics about imagining 'summer loving' help the listener feel bubbly and happy!\
\
▶1theK FB  : http://www.facebook.com/1theK\
▶1theK TW : https://twitter.com/1theK\
▶1theK G+  : https://plus.google.com/+1theK\
\
2014年上半期を「Something」で熱く盛り上げたガールズデーが夏のシーズンソングで帰ってきた。 \
\
タイトル曲「Darling」は、ガールズデイと「Something」で2014年最高のコンビネーションを成したプロデューサーチー
ム'イダンヨプチャギ'の作品で、熱い夏冷たい水鉄砲のように吹き出るブラスセッションと軽快なシャッフルリズムが全身を涼し
く巻き込む。特に夏の日、突然訪れた恋についてのキュートな想像が聞き手にパチパチと弾ける清涼飲料のような涼しさを与える。 \
\
2014년 상반기를 '썸씽'으로 뜨겁게 달궜던 걸스데이가 여름 시즌송으로 돌아왔다.\
\
타이틀곡 "Darling"은 걸스데이와 '썸씽'으로 2014 최고의 콤비네이션을 이룬 프로듀서팀 이단옆차기의 작품으로 뜨거운 여름날 
시원한 물대포처럼 터지는 브라스세션과 경쾌한 셔플리듬이 온 몸을 시원하게 휘감는다. 특히 여름날 갑자기 찾아온 사랑에 대한 
귀여운 상상이 듣는 이로 하여금 톡톡 쏘는 청량음료 같은 시원함을 선사 한다.
encoder=Lavf59.16.100
__________________
I sometimes post sober.
StainlessS@MediaFire ::: AND/OR ::: StainlessS@SendSpace

"Some infinities are bigger than other infinities", but how many of them are infinitely bigger ???

Last edited by StainlessS; 6th May 2023 at 01:11.
StainlessS is offline   Reply With Quote
Old 5th May 2023, 12:23   #3  |  Link
StainlessS
HeartlessS Usurer
 
StainlessS's Avatar
 
Join Date: Dec 2009
Location: Over the rainbow
Posts: 10,980
Reserved 2
__________________
I sometimes post sober.
StainlessS@MediaFire ::: AND/OR ::: StainlessS@SendSpace

"Some infinities are bigger than other infinities", but how many of them are infinitely bigger ???
StainlessS is offline   Reply With Quote
Old 5th May 2023, 13:54   #4  |  Link
StainlessS
HeartlessS Usurer
 
StainlessS's Avatar
 
Join Date: Dec 2009
Location: Over the rainbow
Posts: 10,980
Added to post #2.
Convert_Input_Audio_To_Stereo_WAV.BAT
Extract_Metadata_To_Output_TXT.BAT
__________________
I sometimes post sober.
StainlessS@MediaFire ::: AND/OR ::: StainlessS@SendSpace

"Some infinities are bigger than other infinities", but how many of them are infinitely bigger ???

Last edited by StainlessS; 5th May 2023 at 14:43.
StainlessS is offline   Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 07:49.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.