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. |
30th May 2023, 11:58 | #1 | Link |
Registered User
Join Date: Nov 2003
Posts: 365
|
2023 status of tools to open H.264/mpeg4 files
Over the years since 2012 when I got Hauppauge H.264 capture systems, I can recall 3 ways I've used to open such files. There are pros and cons to each. I'd like to see the experts here give the "state of the art" (pros and cons) in this. My knowledge and experience so far is:
1. I've used DGIndexNV (DGSource function). 2. ffvideosource() and ffaudiosource() functions. 3. (Long ago) something I recall called "LSmash" or something. This FAQ does not have all of these and the options it does give there are to me generally unacceptable. http://avisynth.nl/index.php/FAQ_loading_clips Here's my pros and cons: 1. DGIndexNV: Pro: It's rock solid frame accurate every time. Cons: A. It requires running an indexer first, then converting the encoded audio to .wav before using WavSource() to open the audio in Avisynth. Tedious steps if you have a lot of videos to process. (Could double or more the time needed in creating scripts from a skeleton. This labor can be the bottleneck when many scripts need to be created rapidly.) B. I have to pay a license for each computer I run DGIndexNV on, plus it's a very complex process to install the license on any one PC. Price is not bad FOR A DEVELOPMENT environment. But I want to create Avisynth scripts (.avs) to run on any PC (to play a video) without buying or installing licenses, nor running preliminary steps (create index or convert audio). 2. ffvideosource() and ffaudiosource(). (I don't remember how I installed these.) Pros: A. It's free. B. No preprocessing steps needed. (It builds it's own index as needed.) This is great if I have to create a lot of scripts and run them quickly with a minimum of labor. C. It can easily correct VFR sources merely by including a couple of parameters as function parameters (fpsnum=30000,fpsden=1001 or such). Cons: It's notorious for supplying the wrong video frames when you do timeline scrubbing, and maybe other situations too. If I have to have perfect frame selection in the opening seconds of the video, I can't trust this tool. 3. Lsmash. I regret I don't remember anything about it as I haven't used it since discovering DGIndexNV years ago. I surely must have stopped using it because of some disadvantage. I did a search and found this: http://avisynth.nl/index.php/LSMASHSource Is THIS the state of the art now? Can someone please comment? 4. Is there some other open tool for H264 that I don't know about? It would sure be nice if AviSynth had enough INTERNAL features so that installing AviSynth by itself would be enough to run everything needed and not have to install a bunch of external filters to run. Every other computer programming language I've used (spanning 1972 to 2010 or so) had built-in "file open" commands or functions. My motivation in this is based on a radical shift in playback philosophy that I've been pushed to embrace. That is, shift as much processing as possible to the playback stage rather than doing it all before the user sees it. (I've ALWAYS felt the opposite.) The goal is to preserve the original footage as much as possible, knowing that playback abilities improve over time as processors improve. I want the USER to run my script, not me. |
30th May 2023, 13:07 | #2 | Link | |
HeartlessS Usurer
Join Date: Dec 2009
Location: Over the rainbow
Posts: 10,980
|
DGIndexNV (DGSource [EDIT: DgDecNv]) is now free.
LSmash is (IMHO) the one for ISO files, LSMASHVideoSource/LSMASHAudioSource for ISO, otherwise LWLibavVideoSource/LWLibavAudioSource, for anything else. Quote:
Avisynthesizer_Mod A SendTo App that allows Windows Explorer selection of video files and fills in a user supplied Template with the filenames. Can concatenate (join/splice) selected files (default as original non mod version) and create a single output AVS file OR, batch create multiple AVS files, one for each input source file (MOD version only). Has a GUI to select required template and sort input files if multiple input files selected. https://forum.doom9.org/showthread.php?t=166820 Example of Batch mode Code:
---------------------------------------------------------------------- --------- BATCH MODE TEMPLATE ---------------------------------------- ---------------------------------------------------------------------- Here a Batch Mode template (NOT enclosed in square brackets) A script will be generated for each file SendTo Avisynthesizer_Mod. >>>>>>>>>>> TEMPLATE START >>>>>>>>>>>>>>> #ASYNTHER BATCH-AVISOURCE # Above line (preceded by '#ASYNTHER') shows as "BATCH-AVISOURCE" in the Avisynthesizer_Mod GUI. FileCount = ___FILECNT___ # Should always be set to 1 in non-repeating Batch template. # Below not enclosed in square brackets, so is Non-Repeating ie Batch Mode. # Batch Mode == Multiple AVS files generated, one for each selected file SendTo Avisynthsizer_Mod. AVISource("___FILE___") <<<<<<<<<<< TEMPLATE END <<<<<<<<<<<<<<<<< 1--BATCH-AVISOURCE.avs (where 1.avi, 2.avi, and 3.avi sendTo Avisynthesizer_Mod [Only 1st script for "1.avi" shown]), generated script Code:
#ASYNTHER BATCH-AVISOURCE # Above line (preceded by '#ASYNTHER') shows as "BATCH-AVISOURCE" in the Avisynthesizer_Mod GUI. FileCount = 1 # Should always be set to 1 in non-repeating Batch template. # Below not enclosed in square brackets, so is Non-Repeating ie Batch Mode. # Batch Mode == Multiple AVS files generated, one for each selected file SendTo Avisynthsizer_Mod. AVISource("C:\Z\1.avi") DgDecNv :- https://www.rationalqm.us/dgdecnv/binaries/ EDIT: List of command-line and batch utilities for AVISynth (and a few discussions) (Some Avisynthesizer_Mod alternatives) https://forum.doom9.org/showthread.php?t=96451
__________________
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; 31st May 2023 at 09:15. |
|
30th May 2023, 21:30 | #3 | Link |
Registered User
Join Date: Mar 2012
Location: Texas
Posts: 1,664
|
@TCmullet
DGIndexNV A) Why not just open the audio file with an audio source filter? There's a few options: http://avisynth.nl/index.php/Externa...Source_Filters B) As StainlessS mentioned, it has been free since April 2021. See https://forum.doom9.org/showthread.php?t=182778 FFmpegSource and LSMASHSource These two are comparable as they both use FFmpeg to decode. Sometimes one may work better than the other. The advantage LSMASHSource has is that LSMASHVideoSource and LSMASHAudioSource can open ISO base media file formats without indexing. FAQ loading clips wiki page Yes this page is not up to date. |
30th May 2023, 23:34 | #5 | Link | |
Registered User
Join Date: Sep 2007
Posts: 5,346
|
Quote:
|
|
31st May 2023, 09:21 | #6 | Link |
HeartlessS Usurer
Join Date: Dec 2009
Location: Over the rainbow
Posts: 10,980
|
ISO [IIRC] just stands for International Standards Organization.
EDIT: Looked it up, they call themselves "International Organization for Standardization":- https://www.iso.org/home.html ISO container file is any one of below [EDIT: filename extension type] in blue, [its possible that I missed one or two out] Code:
# Requires RT_Stats Function IsISOFileName(String s) {s=RT_GetFileExtension(s) Return(s==".mov"||s==".mp4"||s==".m4v"||s==".3gp"||s==".3g2"||s==".mj2"||s==".dvb"||s==".dcf"||s==".m21")}
__________________
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; 31st May 2023 at 09:33. |
31st May 2023, 16:03 | #7 | Link | |
Registered User
Join Date: Nov 2003
Posts: 365
|
Quote:
I don't want a separate audio file coming out of an extraction step, nor do I want to enter TWO names into the script. I want to code the script, entering ONE filename for my .mp4 or .ts, and GO. I've got 900 video files to do (450 laserdisc movies with average of 2 sides per title). AND, just the other day, it was suggested that I embark on a project to process over 600 half-hour videos! No money in this latter; just donating to mankind some helpful videos. I'm nearly 70... I may be dead before I get done! (But I'm personally shooting for 130.) |
|
31st May 2023, 16:43 | #8 | Link | |
HeartlessS Usurer
Join Date: Dec 2009
Location: Over the rainbow
Posts: 10,980
|
Quote:
Create your template, ONCE. When you have a dozen or two clips to process, just group select the lot in Windows Explorer, right click and SendTo Avisynthesizer_Mod. Choose the template you want to use, click OK. And it will batch produce all the AVS scripts for you. Easy-peasy. DGIndex and DGIndexNV also both support templates for processing both video and audio in the auto created single avs script.
__________________
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; 31st May 2023 at 16:48. |
|
31st May 2023, 17:04 | #9 | Link | |
Registered User
Join Date: Mar 2012
Location: Texas
Posts: 1,664
|
Quote:
Code:
path = "E:\myvideo.ts" v = FFVideoSource(path) # LWLibavVideoSource a = FFAudioSource(path) # LWLibavAudioSource AudioDub(v,a) Not sure what you mean by "a separate audio file coming out of an extraction step". Sounds like you're taking an extra step yourself Just curious, what type of processing are you planning to do to the videos? Last edited by Reel.Deel; 31st May 2023 at 17:15. |
|
31st May 2023, 17:20 | #10 | Link |
HeartlessS Usurer
Join Date: Dec 2009
Location: Over the rainbow
Posts: 10,980
|
Maybe he talks about the likes of DGIndex and DGIndexNV, which produces a separate audio file.
But, in that case can use template something like this [untested]. A DgIndexNV template with .avs extension, in DgDecNv Template folder, and chosen in the settings. Code:
VideoFileName ="__vid__" AudioFileName ="__aud__" AudioDelay =Value("__del__") Video = DgSource(VideoFileName) # for DgIndexNV, or for DgIndex Mpeg2Source(VideoFileName) Audio = LWLibavAudioSource (AudioFileName) AudioDub(Video,Audio).DelayAudio(AudioDelay).Trim(0,0) # Trim, chop/add audio to length #AssumeTFF or AssumeBFF. But I think, MPeg2Source and DgSource both auto set field order. Return Last
__________________
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; 31st May 2023 at 17:23. |
31st May 2023, 23:43 | #11 | Link |
Big Bit Savings Now !
Join Date: Feb 2007
Location: close to the wall
Posts: 1,531
|
Maybe AutoPath can help. Copy the filename onto the script, the script derives the source filter, path and you are done.
I am using it daily for a year now and I think it is ready to be published. https://forum.doom9.org/showthread.p...45#post1987845
__________________
"To bypass shortcuts and find suffering...is called QUALity" (Die toten Augen von Friedrichshain) "Data reduction ? Yep, Sir. We're that issue working on. Synce invntoin uf lingöage..." |
1st June 2023, 01:33 | #13 | Link | |
HeartlessS Usurer
Join Date: Dec 2009
Location: Over the rainbow
Posts: 10,980
|
Quote:
Then what ? EDIT: Emulgator, maybe long paths for W10 are handy. [only a fix for eg W10 Windows Explorer, not for apps that dont adapt/support it] ENABLE_W10_LongPath.reg Code:
Windows Registry Editor Version 5.00 ; created by Walter Glenn ; for How-To Geek ; article: http://www.howtogeek.com/266621/how-to-make-windows-10-accept-file-paths-over-260-characters/ [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\FileSystem] "LongPathsEnabled"=dword:00000001 Code:
Windows Registry Editor Version 5.00 ; created by Walter Glenn ; for How-To Geek ; article: http://www.howtogeek.com/266621/how-to-make-windows-10-accept-file-paths-over-260-characters/ [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\FileSystem] "LongPathsEnabled"=dword:00000000
__________________
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; 1st June 2023 at 01:40. |
|
1st June 2023, 03:11 | #14 | Link |
Registered User
Join Date: Nov 2003
Posts: 365
|
Yes, Reel, that was my point. The original multiplexed TS file is the original container, and with them you don't have to extract them (having a separate extract step); simply refer to them in the script and they invisibly create the needed index.
|
1st June 2023, 03:51 | #15 | Link |
HeartlessS Usurer
Join Date: Dec 2009
Location: Over the rainbow
Posts: 10,980
|
Oops yes, OP is for ISO file, so mutli VOB not an issue.
__________________
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 ??? |
1st June 2023, 19:48 | #16 | Link |
Big Bit Savings Now !
Join Date: Feb 2007
Location: close to the wall
Posts: 1,531
|
Thanks StainlessS for the Longpath regkey !
__________________
"To bypass shortcuts and find suffering...is called QUALity" (Die toten Augen von Friedrichshain) "Data reduction ? Yep, Sir. We're that issue working on. Synce invntoin uf lingöage..." |
23rd July 2023, 21:54 | #17 | Link |
Registered User
Join Date: Nov 2003
Posts: 365
|
Stuck with LSmash not opening file
First, let me say I'm not happy with github's terrible lack of clarity for those who aren't members of their elite superbrains. It's never clear as to HOW to download an installable program. So for those who may be even blinder than I, I've somewhat figured it out:
Here's is LSmash doc: http://avisynth.nl/index.php/LSMASHSource In the upper right corner, a link for downloading appears and takes you here: https://github.com/HomeOfAviSynthPlu...orks/releases/ That takes you to the site I always dread, github.com. With no instructions whatsoever that you're supposed to do this, I hovered mouse over the bold word 20230716. It IS a clickable link. Upon clicking it or the word "latest" next to it, it takes you here: https://github.com/HomeOfAviSynthPlu...s/tag/20230716 This is probably where github stinks the worst. It tells you nothing about what to do next. It lists "used libraries", which I think we don't want. Then it lists "assets" which includes 2 sets of source files. Well, I want to use the executable, not re-program it, therefore skipping "source" files, that leaves one left to try. But sadly it's not the familiar .exe (installer) or .zip. It's the unnecessary (IMHO) .7z format. I just happened to have 7zip, so I saved the .7z file and expanded it. I found a LSMASHSource.dll (my "executable") for 32-bit and for 64-bit processors. As I have a 64-bit processor, I copied that one into my plugins folder. I ran my script which contains: Code:
myfile="2010 The Year We Make Contact.4movie.1080i30.tcm.c2-tv.ed-20m.TS" video=LSMASHVideoSource(myfile) audio=LSMASHAudioSource(myfile) AudioDub(video,audio) Please look at my script code above and tell me if you see anything wrong with it. |
23rd July 2023, 23:16 | #18 | Link | |
Registered User
Join Date: Sep 2007
Posts: 5,346
|
Quote:
Transport streams require LWLibavVideoSource/LWLibavAudioSource, and this will generate an index (might take some time, depending on how large the file is and your hardware) MP4, MOV, ISO base media can be opened with LSmashVideoSource/LSmashAudioSource without indexing You can use vdub2 x64 to "call" avisynth x64 scripts |
|
23rd July 2023, 23:49 | #19 | Link |
Registered User
Join Date: Nov 2003
Posts: 365
|
> "Transport streams require LWLibavVideoSource"
I was not clear that .TS files are not a type of ISO file. I changed to: Code:
video=LWLibavVideoSource(myfile) audio=LWLibavAudioSource(myfile) Apparently, it's part of the LSMASHSource.dll, as I didn't have to find and store any additional dll into plugins folder. The fact that it creates an index is no worse than that for ffvideosource. Yes, it's several times bigger, but it's much more frame accurate that ffvideosource. |
24th July 2023, 08:26 | #20 | Link |
HeartlessS Usurer
Join Date: Dec 2009
Location: Over the rainbow
Posts: 10,980
|
Untested. # Requires RT_Stats
Code:
myfile=".\2010 The Year We Make Contact.4movie.1080i30.tcm.c2-tv.ed-20m.TS" # ".\" at start, means in current directory IsISO = IsISOFileName(myFile) # Is it type ISO file (LSmashVideo/LSmashAudio, ELSE LWLibavVideoSource/LWLibavAudioSource) video = (IsISO) ? LSMASHVideoSource(myfile) : LWLibavVideoSource(myfile) audio = (IsISO) ? LSMASHAudioSource(myfile) : LWLibavAudioSource(myfile) AudioDub(video,audio) Trim(0,0) # Trim, chop/pad audio to SAME length # AssumeTFF # or AssumeBFF, not sure if LSmash auto sets field order # ... Return Last # Requires RT_Stats Function IsISOFileName(String s) {s=RT_GetFileExtension(s) Return(s==".mov"||s==".mp4"||s==".m4v"||s==".3gp"||s==".3g2"||s==".mj2"||s==".dvb"||s==".dcf"||s==".m21")} Code:
# DOES NOT Require RT_Stats Function IsISOFileName(String s) {s=GetFilenameExtension(s) Return(s==".mov"||s==".mp4"||s==".m4v"||s==".3gp"||s==".3g2"||s==".mj2"||s==".dvb"||s==".dcf"||s==".m21")} Function GetFilenameExtension(String fn) { fn=fn.RevStr i1=fn.FindStr("\") i2=fn.FindStr("/") i=(i1==0) ? i2 : (i2==0) ? i1 : min(i1,i2) fn=(i>0) ? Fn.LeftStr(i-1) : fn i=fn.FindStr(".") Return (i>0)?fn.LeftStr(i).RevStr:"" }
__________________
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; 24th July 2023 at 08:57. |
Thread Tools | Search this Thread |
Display Modes | |
|
|