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 Development

Reply
 
Thread Tools Search this Thread Display Modes
Old 30th November 2023, 04:10   #1501  |  Link
flossy_cake
Registered User
 
Join Date: Aug 2016
Posts: 592
Quote:
Originally Posted by flossy_cake View Post
From what I can tell though the required d2v index file cannot be created within an Avisynth script
I stand corrected - it looks like RT_Call and DGIndex CLI may be able to achieve that.

Assuming RT_Call waits until the command is complete before allowing the next Avisynth filter in the chain (MPEG2Source) to be called - can you clarify StainlessS?
Quote:
Originally Posted by StainlessS View Post
@StainlessS
flossy_cake is offline   Reply With Quote
Old 30th November 2023, 15:26   #1502  |  Link
StainlessS
HeartlessS Usurer
 
StainlessS's Avatar
 
Join Date: Dec 2009
Location: Over the rainbow
Posts: 10,960
Flossy, no, but see CallCmd(Synchronous=7), [EDIT: Using Open command]
https://forum.doom9.org/showthread.php?t=166063

Code:
CallCmd(clip,string "Command"="", string "Frames"="",string "Insert"="",int "Digits"=6,bool "Once"=true,int "Offset"=0,
  bool "Hide"=false,bool "Debug"=false,string "Open"="",string "Close"="",int "Synchronous"=7)

Synchronous (default 7, range 0 - 7)
  The Synchronous arg is a group of 3 bitflags, 
    bit 0 if set means wait for process to terminate before returning from the 'Open' command.
    bit 1 if set means wait for process to terminate before returning from the 'Frames' commands.
    bit 2 if set means wait for process to terminate before returning from the 'Close' command.
      0 = All Asynchronous, ie dont wait at all.
      1 = Wait only on 'Open' command.
      2 = Wait only on 'Frames' commands.
      3 = Wait on 'Open' and 'Frames' commands.
      4 = Wait on 'Close' command.
      5 = Wait on 'Open' and 'Close' commands.
      6 = Wait on 'Frames' and 'Close' commands.
      7 = Wait on ALL commands (default).

   Beware, if you dont wait it is very possible that any future reliance upon output of command may fail due to the
   output file being in use. Also, if debug true and waiting for process to complete, then will also show the process return
   code on successful process creation (and completion) in DebugView, cannot do this if NOT waiting completion.
EDIT: OOps, actually, I think not, you have to provide already Opened source clip, and CallCmd command executed on first frame
during frameserve stage. [EDIT: Actually on CallCmd filter construction, during filter graph creation and BEFORE frameserving starts]
Maybe you could call eg RT_Sleep(10.0), and pole for existing index file, else loop.
EDIT: If using DGIndex Template, then created AVS file is created last after indexing. [Using DGIndex GUI, dont know about CMD line ver$]

EDIT: Gone t' pub.
__________________
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 December 2023 at 14:01.
StainlessS is online now   Reply With Quote
Old 30th November 2023, 18:09   #1503  |  Link
kedautinh12
Registered User
 
Join Date: Jan 2018
Posts: 2,133
Wow, sound good
kedautinh12 is offline   Reply With Quote
Old 1st December 2023, 05:44   #1504  |  Link
flossy_cake
Registered User
 
Join Date: Aug 2016
Posts: 592
Quote:
Originally Posted by eac3to_mod View Post
Here's a test version for auto-indexing. This is for 64-bit DGDecode.dll (MPEG2). Currently Avisynth only. Make sure that the included DGIndex.exe is in the same directory as DGDecode.dll. The revised DGIndex.exe's only change is to print a message in CLI mode saying that indexing is taking place. Please advise your test results.

https://rationalqm.us/misc/DGDecode64_test.rar

We should take discussion away from this thread. How about here:

https://www.rationalqm.us/board/view...p=18807#p18807
Thanks for this. I couldn't get it to create d2v from within an Avisynth script, only from its GUI. I'll reply on your forum...
flossy_cake is offline   Reply With Quote
Old 1st December 2023, 10:46   #1505  |  Link
kedautinh12
Registered User
 
Join Date: Jan 2018
Posts: 2,133
I think you can create a new thread about DGDecode on doom9 forum
kedautinh12 is offline   Reply With Quote
Old 5th December 2023, 12:59   #1506  |  Link
tebasuna51
Moderator
 
tebasuna51's Avatar
 
Join Date: Feb 2005
Location: Spain
Posts: 6,867
WARNING: the sintax in last L-SMASH-Works-r1156.0.0.0 have a important change:

the recommended parameter for LWLibavAudioSource/LSMASHAudioSource(..., drc_scale=0,...) not work now, must be:
(..., ff_options = "drc_scale=0", ...)
__________________
BeHappy, AviSynth audio transcoder.
tebasuna51 is online now   Reply With Quote
Old 5th December 2023, 13:40   #1507  |  Link
StainlessS
HeartlessS Usurer
 
StainlessS's Avatar
 
Join Date: Dec 2009
Location: Over the rainbow
Posts: 10,960
Quote:
Originally Posted by flossy_cake View Post
I stand corrected - it looks like RT_Call and DGIndex CLI may be able to achieve that.

Assuming RT_Call waits until the command is complete before allowing the next Avisynth filter in the chain (MPEG2Source) to be called - can you clarify
Quote:
Originally Posted by StainlessS View Post
Flossy, no, but see CallCmd(Synchronous=7), [EDIT: Using Open command]
https://forum.doom9.org/showthread.php?t=166063

Code:
CallCmd(clip,string "Command"="", string "Frames"="",string "Insert"="",int "Digits"=6,bool "Once"=true,int "Offset"=0,
  bool "Hide"=false,bool "Debug"=false,string "Open"="",string "Close"="",int "Synchronous"=7)

Synchronous (default 7, range 0 - 7)
  The Synchronous arg is a group of 3 bitflags, 
    bit 0 if set means wait for process to terminate before returning from the 'Open' command.
    bit 1 if set means wait for process to terminate before returning from the 'Frames' commands.
    bit 2 if set means wait for process to terminate before returning from the 'Close' command.
      0 = All Asynchronous, ie dont wait at all.
      1 = Wait only on 'Open' command.
      2 = Wait only on 'Frames' commands.
      3 = Wait on 'Open' and 'Frames' commands.
      4 = Wait on 'Close' command.
      5 = Wait on 'Open' and 'Close' commands.
      6 = Wait on 'Frames' and 'Close' commands.
      7 = Wait on ALL commands (default).

   Beware, if you dont wait it is very possible that any future reliance upon output of command may fail due to the
   output file being in use. Also, if debug true and waiting for process to complete, then will also show the process return
   code on successful process creation (and completion) in DebugView, cannot do this if NOT waiting completion.
EDIT: OOps, actually, I think not, you have to provide already Opened source clip, and CallCmd command executed on first frame
during frameserve stage. [EDIT: Actually on CallCmd filter construction, during filter graph creation and BEFORE frameserving starts]
Maybe you could call eg RT_Sleep(10.0), and pole for existing index file, else loop.
EDIT: If using DGIndex Template, then created AVS file is created last after indexing. [Using DGIndex GUI, dont know about CMD line ver$]

EDIT: Gone t' pub.
You could perhaps use CallCmd() to execute Open command on dummy clip eg BlankClip(length=1).CallCmd(Open="...",Syncronous=7), to create an index for the actual target file,
then just use index as per normal. [object being to use Callcmd with Syncronous=7 to wait until target file index is actually created]
[Open="..." being the command line to call the indexer on target file. Also, see BLUE EDIT line in above quote]

But it looks like the problem is solved anyway.
__________________
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 December 2023 at 14:01.
StainlessS is online now   Reply With Quote
Old 7th December 2023, 07:36   #1508  |  Link
flossy_cake
Registered User
 
Join Date: Aug 2016
Posts: 592
Quote:
Originally Posted by StainlessS View Post
But it looks like the problem is solved anyway.
Yes, DG released auto indexer for DGDecode but it's not compatible with mkv's (I remuxed all my physical copy DVD's to mkv using MakeMKV and plan to continue using that application for various reasons).

FFMS2 is also a good option now too, it seems. So I'm quite spoiled for choice when it comes to accurate DVD playback, and DGDecode is still nice to have as a backup option (just need to give it .vob files from eg. DVD Decrypter or DVD Shrink).

Last edited by flossy_cake; 7th December 2023 at 07:45.
flossy_cake is offline   Reply With Quote
Old 7th December 2023, 07:38   #1509  |  Link
flossy_cake
Registered User
 
Join Date: Aug 2016
Posts: 592
In the interest of improving LWLibAV compability, here is an mkv which FFMpegSource2 can play but LWLibAV cannot:

https://drive.google.com/u/0/uc?id=1...xport=download

It is MPEG2 video remuxed from DVD using MakeMKV.

Code:
FFVideoSource("C:\S01E01.mkv", rffmode=1)        # works
LWLibavVideoSource("C:\S01E01.mkv", repeat=true) # doesn't work


Curiously, if I trim 2 seconds off the end of it with:

Code:
"c:\program files\ffmpeg\bin\ffmpeg.exe" -ss 00:00:00 -to 00:23:52 -i "C:\S01E01.mkv" -c copy -map 0 "C:\S01E01_trimmed.mkv"
the file then plays fine with LWLibAV.

So the offending data appears to be within the last couple of seconds of the clip - hopefully that offers a clue as to why LWLibAV doesn't like it.

It may very well be that the last 2 seconds is somehow incorrectly encoded and FFMS2 should refuse to play it as well, but that is a decision for the authors of the source filters to decide how "fault tolerant" they should be.

Last edited by flossy_cake; 7th December 2023 at 07:44.
flossy_cake is offline   Reply With Quote
Old 7th December 2023, 07:45   #1510  |  Link
kedautinh12
Registered User
 
Join Date: Jan 2018
Posts: 2,133
You neeed create issue here
https://github.com/HomeOfAviSynthPlu...H-Works/issues
kedautinh12 is offline   Reply With Quote
Old 7th December 2023, 08:00   #1511  |  Link
flossy_cake
Registered User
 
Join Date: Aug 2016
Posts: 592
Quote:
Originally Posted by kedautinh12 View Post
Done, thanks.
flossy_cake is offline   Reply With Quote
Old 9th December 2023, 13:27   #1512  |  Link
StainlessS
HeartlessS Usurer
 
StainlessS's Avatar
 
Join Date: Dec 2009
Location: Over the rainbow
Posts: 10,960
Quote:
Originally Posted by tebasuna51 View Post
WARNING: the sintax in last L-SMASH-Works-r1156.0.0.0 have a important change:

the recommended parameter for LWLibavAudioSource/LSMASHAudioSource(..., drc_scale=0,...) not work now, must be:
(..., ff_options = "drc_scale=0", ...)
Thanks Teb,
I've just myself discovered that problem and was about to report it.

I guess that I've got a lot of scripts to change,
would have been nice if old args could remain as was,
and any changes coped with within the LSmash dll,
ie create dll internal ff_options string from eg LSmashAudioSource(..., drc_scale=0).
It should be fairly easily 'do-able' -

EDIT: From the doc file,
Code:
LSMASHVideoSource(string source, int track = 0, int threads = 0, int seek_mode = 0, int seek_threshold = 10,
                    bool dr = false, int fpsnum = 0, int fpsden = 1, string format = "", string decoder = "",
                    int prefer_hw = 0, int ff_loglevel = 0, string ff_options = "")

# ...

            + ff_options (default : "")
                Set the decoder options in FFmpeg.
                The format is `key=value` separated by " ". (e.g. "drc_scale=0 auto_convert=0").
and for all other video audio filters, eg

Code:
LSMASHAudioSource(string source, int track = 0, bool skip_priming = true, string layout = "", int rate = 0,
                    string decoder = "", int ff_loglevel = 0, string ff_options = "")

# ...

            + ff_options (defalut: "")
                Same as 'ff_options' of LSMASHVideoSource().

EDIT: I guess that if there are likely to be many more ffmpeg options added, then would be easiest to just leave it as is,
and change all existing scripts instead
__________________
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; 9th December 2023 at 15:32.
StainlessS is online now   Reply With Quote
Old 10th December 2023, 08:33   #1513  |  Link
flossy_cake
Registered User
 
Join Date: Aug 2016
Posts: 592
Why not have both? The drc_scale param can be removed from documentation so that new users start using ff_options, while old scripts maintain forwards compatibility.
flossy_cake is offline   Reply With Quote
Old 10th December 2023, 08:40   #1514  |  Link
flossy_cake
Registered User
 
Join Date: Aug 2016
Posts: 592
Oh it's just been added back: https://github.com/HomeOfAviSynthPlu...orks/issues/51

Quote:
If `ff_options="drc_scale=x"` is used, `drc_scale` is ignored.
That's perfect imo.

Last edited by flossy_cake; 10th December 2023 at 08:43.
flossy_cake is offline   Reply With Quote
Old 10th December 2023, 09:46   #1515  |  Link
Selur
Registered User
 
Selur's Avatar
 
Join Date: Oct 2001
Location: Germany
Posts: 7,239
Quote:
Oh it's just been added back
but the build action failed: https://github.com/HomeOfAviSynthPlu...uns/7154104282
__________________
Hybrid here in the forum, homepage
Selur is offline   Reply With Quote
Old 10th December 2023, 09:49   #1516  |  Link
kedautinh12
Registered User
 
Join Date: Jan 2018
Posts: 2,133
He will release if it's ready. He need fix some issues from Selur and flossy_cake

Last edited by kedautinh12; 10th December 2023 at 09:55.
kedautinh12 is offline   Reply With Quote
Old 10th December 2023, 10:25   #1517  |  Link
flossy_cake
Registered User
 
Join Date: Aug 2016
Posts: 592
I wasn't even aware drc_scale was supported as it isn't mentioned at the avisynth.nl page (only in readme.md on github).

I am interested in using it, but can't really test it out as I can't seem to find a filter or other tool that can report on whether the AC-3 track has DRC encoding. Can anyone suggest a tool for getting DRC info from video files with ac-3 tracks? MediaInfo doesn't seem to say, I think possibly as it's not flagged as metadata but is somehow baked into the packets inside the audio stream.

Last edited by flossy_cake; 10th December 2023 at 10:35.
flossy_cake is offline   Reply With Quote
Old 10th December 2023, 11:54   #1518  |  Link
tebasuna51
Moderator
 
tebasuna51's Avatar
 
Join Date: Feb 2005
Location: Spain
Posts: 6,867
Quote:
Originally Posted by flossy_cake View Post
... other tool that can report on whether the AC-3 track has DRC encoding...
You need extract the tracks and use LeeAudBi to read all the frames (MediaInfo can't read all the frames)

The metadata are in the Audio Block, a value for each block, normally a frame have 6 blocks

Code:
File: test.ac3
Size: 961536 bytes
----------------------------------------- First Frame Info
SampleRate ..................: 0 (48000 Hz)
BitRate .....................: 14 (384 Kb/s)
FrameSize....................: 1536 bytes
...
Dynamic Range gain ..........: 5.89 dB (first block)
----------------------------------------- Revised full AC3 Info
Dyn. Range min/max : -11.51/5.89 dB
...
------------------------------------------------- End Info
__________________
BeHappy, AviSynth audio transcoder.
tebasuna51 is online now   Reply With Quote
Old 10th December 2023, 14:42   #1519  |  Link
flossy_cake
Registered User
 
Join Date: Aug 2016
Posts: 592
Quote:
Originally Posted by tebasuna51 View Post
You need extract the tracks and use LeeAudBi
flossy_cake is offline   Reply With Quote
Old 15th December 2023, 03:19   #1520  |  Link
kedautinh12
Registered User
 
Join Date: Jan 2018
Posts: 2,133
L-SMASH-works 20231214 1160.0.0.0

https://github.com/HomeOfAviSynthPlu...Works/releases
kedautinh12 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 13:36.


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