hi everyone let me state what im trying to accomplish then maybe you would have some insight
been searching around for a while and not comming up with too much mainly avi info
first off im recording shows off my hdhr and removing the commercials all automatically
which leaves me with a mpg or tp file so i would like to automatically take those files and auto encode them to x264
most of the recordings are hi def
basically im looking for a template to use as im far to tired to start digging into avs scripting at the moment
i suppose it would have to auto crop and auto mod16 and stuff like that can it be done and or does one exist maybe one that scans a dir for specific file types and auto encodes or something like that
+ Reply to Thread
Results 1 to 14 of 14
-
-
I'd hack together a script, maybe something similar to one of these:
http://speeddemosarchive.com/kb/Batch_Encoding
https://forum.videohelp.com/topic377997.html
You can use the -crf flag for x264.exe btw to make sure the output quality is decent (try -crf 21 or -crf20, lower is higher quality. 20 is probably as low as I'd go).
For auto-crop, you can check out what StaxRip does I believe.
MPG shoudln't be too hard to import into an avisyth script to use as your source. -
great find I really like the powershell one but i havnt played with it in a long time guess its time to do some reading ha ha
really though the only thing i need to change is the audio can anyone reccommend a way to just keep the audio original or at the very least ac3 im not a fan of aac but it is decent -
You should be able to extract the audio and then just mux it in with mp4box. You can extract the audio with ffmpeg (http://www.catonmat.net/blog/how-to-extract-audio-tracks-from-youtube-videos/). There is another tool to extract the audio which may be better but I don't remember. As for ac-3 maybe aften? http://aften.sourceforge.net/
Edit: another option might be to use http://www.codeplex.com/NicAudio to create an .avs script that's the same as the source one, but load the video as an ac3 audio file, then feed that into the muxer.
This will work but not sure if it's the most lossless way (wav used as intermediate): https://forum.videohelp.com/topic342632.html -
other thoughts come to mind maybe an all in one script i think im gonna abort on staxrip for the moment as i came across a dgindex code that will look at every file in your dir and demux all tracks and create a d2v file for it.
so with this id like to create a script that looks for iso and vob*_1 files (all filetypes really avi mpg wmv etc.) maybe use some if and elseif statements to achieve different encoder settings for each filetype still pondering though what im most suprised about is that a template script is nowhere on the net well maybe there is but i cant seem to find it i did see one that did iso only but i cant seem to find it anymore im looking though.
the next step is to find a way to generate the avs script automatically and feed the d2v into it also need the script to:
1 auto crop
2 auto resize and mod16
3 auto analyze to choose proper interlace settings
4 encode video with a x264 profile
5 probably leave orig audio in tact and just mux in the end(but we should make a tweak to encode audio if wanted)
6 clean up after itself(should be the easy part)
so if anyone has some info maybe commands for each process that would be very helpful as its reletivly hard to find certain info
O and before i forget here is the code to find ur mpg's and batch demux
just replace the dgindex dir with your own and place in a dir with all ur files and run the creator said to drop a folder on it and itl run but does not you must run it un the folder you want it to run in. also only set for mpg's right now though with some playing im sure it can demux everything we want for the most part.
set filetype=*.mpg
set dgindex=C:\Users\Public\Recorded TV\New Folder\dgindex\DGIndex.exe
for /R %%A in (*.mpg) do IF NOT EXIST "%~1%%~pnA.d2v" "%dgindex%" -OM=2 -AIF=[%~1%%~pnxA] -OFD=[%~1%%~pnA] -exit
this demuxes all streams in my case all i want is the audio demuxed so im going to work on that i think its has to do with dgindexes ini file -
Originally Posted by kronick
If you don't want to demux the video with DGIndex, you can just change your -OFD= string to -OF=.
As far as a template file goes, you can just generate one and call it with the -AT=[templatename.avs] string.
For instance, here is a template file that I use for NTSC DVD rips:
Code:loadplugin("Path\To\DGDecode.dll") loadplugin("Path\To\TIVTC.dll") loadplugin("Path\To\VSFilter.dll") MPEG2Source("__vid__") TFM().TDecimate() #Crop(16,16,-16,-16) #Lanczos4Resize(720, 400) # use VobSub for .idx/.sub subtitles, use TextSub for .srt/.smi/etc #VobSub("__vid__.idx") TextSub("__vid__.srt")
Your best bet for determining interlacing is to simply step through the video. You can use a simple avs script and then open in Virtualdub to step through a fast action scene.
Code:oadplugin("Path\To\DGDecode.dll") MPEG2Source("d2v file") AssumeTFF().SeparateFields()
abcdef pattern is interlaced content
aabbccdd pattern is progressive
aaabbcccdd pattern is 3:2 pulldown
You can also use the number listed at the bottom of the .d2v file as an indicator. 100% FILM is pure 3:2 pulldown. 100% VIDEO is pure interlaced. I usually run NTSC material that is less than 100% through IVTC (TFM.TDecimate listed above) rather than forcing film in DGIndex.
I feed the .avs files generated from DGIndex into HCenc since I am re-encoding the files as MPEG2. You should be able to feed those file into something to generate h.264 video as well (probably ffmpeg or x264).
Also, I am pretty sure that DGIndex is only for MPEG1/2 content. -
some excellent info here the change for just the audio to demux is great thanks
so i gather your saying to just use a template instead of trying to analyze the video which of course would work and i will probably do to save time but i and this is just thoughts thought that megui was just a gui right so therefore everything it does has some code or script to it I.E if i look in the logs for megui it shows many of the commands for the operations of what im doing but of course no auto analyze at least that i can see anyways my overall goal would be to have no user interaction whatsoever maybe schedule the batch file to run every day at 2pm or something.
actually after looking through the avsfolder in staxrip it has a autocrop.dll and a autocrop script so that could cross off #1 on my list just need to put into practice -
I think that was one or two sentences...
I am only saying that it is difficult to really automate the process of determining interlacing. I used XVID4PSP for quite some time and it attempts to determine whether the program is progressive, interlaced, NTSC film, or some hybrid. It just wasn't very accurate. That is because encoding houses will mix and match content.
If you plan to do a batch of NTSC DVD rips, you could probably pretty safely just assume that they are all mostly NTSC film and run them through DGIndex with Honor Pulldown flags enabled and then IVTC them back to 23.976 fps progressive in avisynth. If you are going to convert some shows like Robinhood or Torchwood or Dr. Who from UK, they are interlaced material, so you would need to handle them differently.
The short answer is, unless you know how your source material is encoded, you cannot blindly set up batch processes to convert them for you and expect perfect results. -
right i see why a template would be a logical solution but still if you were to leave it in the hands of the program to determine the interlace could it be done? i mean this is purely my own experience but i personally use megui and you are right that gerenally the settings are the same 98% of the time. as i always use the analyze feature and id say 98% of the time its correct so all im really looking for is a command to perform the analysis that megui does certainly there is one. perfect results are far from what im looking for realistically i just want a scrip that works
anyways after some thought a template is best do you have any ideas on the coding it will have to look for any *.d2v files and place them into an avs template auto crop and auto mod 16 must be in there regardless of their performance i can take care of that i think though also it should move the source file and scripts to a temp folder for later review instead of deleting themin case of a bad crop or something
o and how do i set dgindex to perminatly do what you said -
Here is a batch string that I use to index pure NTSC film content:
100% FILM
(takes all .mpg in the directory and indexes, demuxes [based on DGIndex.ini settings] and generates avs script)
Code:FOR /F "usebackq" %%A IN (`dir /b /on *.mpg`) DO "c:\hcenc\dgindex" -IF=[%%A] -FO=1 -AT=[c:\hcenc\film.avs] -OF=[%%~nA] -HIDE -EXIT
Code:FOR /F "usebackq" %%A IN (`dir /b /on *.mpg`) DO "c:\hcenc\dgindex" -IF=[%%A] -FO=0 -AT=[c:\hcenc\ivtc.avs] -OF=[%%~nA] -HIDE -EXIT
Similar Threads
-
To Script or Not To Script, that is the Question... (Custom Videos)
By TheMcD in forum EditingReplies: 2Last Post: 21st Oct 2010, 10:11 -
PHP script for batch encoding
By gdanko in forum LinuxReplies: 0Last Post: 12th Oct 2008, 02:32 -
Automatic batch encoding DIV3 videos?
By cbstryker in forum Video ConversionReplies: 2Last Post: 17th Jul 2008, 15:17 -
Advice Request regarding TMPGEnc, File encoding, and DVD creation w/ Menus
By Hal05154 in forum Newbie / General discussionsReplies: 9Last Post: 25th Sep 2007, 13:13 -
DVD Authoring: Menu Creation, Encoding, etc
By kerpal in forum Authoring (DVD)Replies: 7Last Post: 20th May 2007, 18:27