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 > (HD) DVD, Blu-ray & (S)VCD > One click suites for DVD backup and DVD creation

Reply
 
Thread Tools Search this Thread Display Modes
Old 20th July 2018, 14:16   #3121  |  Link
manolito
Registered User
 
manolito's Avatar
 
Join Date: Sep 2003
Location: Berlin, Germany
Posts: 3,078
Quote:
Originally Posted by MrC View Post
Got it. Do you have a small sample with AAC-LATM audio track?

Thanks



Bye
Sure, the link still works...
https://www51.zippyshare.com/v/KY10rZkC/file.html

It is not just this file, it applies to all captured files from stations which use AAC-LATM. About half of the public broadcasters in Germany use this audio format, the other half use E-AC3. Since you fixed A2D recently so it no longer confuses E-AC3 with standard AC3 these captures do work nicely with A2D.


Cheers
manolito

//EDIT//
When I said that mts files with E-AC3 audio tracks work nicely in A2D I forgot to mention that audio delay correction is a little bit tricky with such transport streams (could well be an issue with MediaInfo). The reported delay may be something like -1500 ms for both audio tracks. For a perfect result the delay correction for the first track (the one which is decoded with DirectShowSource) must be disabled. For the second track (the one which gets decoded by ffms2) the delay correction must be applied, but it needs to be reversed. So the "-" sign in the "DelayAudio" command has to be removed.

//EDIT2//
It gets even more confusing. The above behavior only applies when the A2D default settings are used, i.e. DSS2Mod/LavFilters for video, DirectShowSource/LAVFilters for the first audio track and FFmpegSource for the second audio track. If the user forces FFmpegSource for video and audio under "Preferences" then the audio delay correction must be disabled for both audio tracks. Weird...

Last edited by manolito; 21st July 2018 at 19:09.
manolito is offline   Reply With Quote
Old 21st July 2018, 20:41   #3122  |  Link
MrC
AVStoDVD Dev
 
MrC's Avatar
 
Join Date: Apr 2006
Location: Italy
Posts: 1,302
Quote:
Originally Posted by manolito View Post
Could you upload the file elsewhere? When I click on "Download Now" from zippyshare site, I have to download and install first the app "MessengerTime"... I really don't...



Bye
__________________
MrC

AVStoDVD Homepage
AVStoDVD @ Doom9 Forum
MrC is offline   Reply With Quote
Old 21st July 2018, 21:44   #3123  |  Link
manolito
Registered User
 
manolito's Avatar
 
Join Date: Sep 2003
Location: Berlin, Germany
Posts: 3,078
Sorry for the zippyshare trouble. I always use a custom hosts file from
winhelp2002.mvps.org/hosts.htm
so I never experienced these issues.

You can get the file here:
https://www.zeta-uploader.com/2097415887
and here:
https://we.tl/8EraIY43vo

Let me know if you also need a captured mts file with E-AC3 audio.


Cheers
manolito
manolito is offline   Reply With Quote
Old 22nd July 2018, 11:57   #3124  |  Link
MrC
AVStoDVD Dev
 
MrC's Avatar
 
Join Date: Apr 2006
Location: Italy
Posts: 1,302
Hi manolito, zeta-uploader works

Yes, please, upload the mts with e-ac3 too



Bye
__________________
MrC

AVStoDVD Homepage
AVStoDVD @ Doom9 Forum
MrC is offline   Reply With Quote
Old 22nd July 2018, 16:30   #3125  |  Link
manolito
Registered User
 
manolito's Avatar
 
Join Date: Sep 2003
Location: Berlin, Germany
Posts: 3,078
No problem, here it is:
https://www.zeta-uploader.com/2130213520

Unfortunately I could not find a station which broadcasts with 2 different audio languages at the moment.


Cheers
manolito
manolito is offline   Reply With Quote
Old 22nd July 2018, 21:54   #3126  |  Link
MrC
AVStoDVD Dev
 
MrC's Avatar
 
Join Date: Apr 2006
Location: Italy
Posts: 1,302
About the mts with aac-latm, switching to FFmpeg Safe Mode for audio encoding is the better workaround. With FFmpeg Safe Mode the audio delay is ignored, and for this capture is the right thing. Somehow MediaInfo is exposing a wrong delay.

I have found that remuxing the mts to mkv has some benefits: the filesize decreases a lot (padding within the mts?) and FFMS2 is now able to decode the 2nd aac track. In this case, major drawback, the audio delay is messed up even more. Again, FFmpeg Safe Mode with the remuxed mkv works as well.

Still to test the mts with e-ac3



Bye
__________________
MrC

AVStoDVD Homepage
AVStoDVD @ Doom9 Forum
MrC is offline   Reply With Quote
Old 23rd July 2018, 02:10   #3127  |  Link
manolito
Registered User
 
manolito's Avatar
 
Join Date: Sep 2003
Location: Berlin, Germany
Posts: 3,078
Quote:
Originally Posted by MrC View Post
About the mts with aac-latm, switching to FFmpeg Safe Mode for audio encoding is the better workaround. With FFmpeg Safe Mode the audio delay is ignored, and for this capture is the right thing. Somehow MediaInfo is exposing a wrong delay.
This is what I said in my first post about the problem:
Quote:
Specifying "FFmpeg Safe Mode" under preferences works, but there is no way to process audio.
This may be all which most users need, but others like me really like to be able to manipulate the audo tracks.

Quote:
Originally Posted by MrC View Post
I have found that remuxing the mts to mkv has some benefits: the filesize decreases a lot (padding within the mts?) and FFMS2 is now able to decode the 2nd aac track. In this case, major drawback, the audio delay is messed up even more. Again, FFmpeg Safe Mode with the remuxed mkv works as well.
I agree, I always do this with HEVC transport streams, but mainly for the video track. None of the available source filters does a decent job seeking within such sources. Finding the right cut points when trying to cut out parts is painful. MKV is a much better format to do this.

Great that you found out that ffms2 can decode AAC-LATM when it is in an MKV container, I did not have this situation on my screen. And the messed up audio delay actually is not too challenging. You just need to use the delay value reported by MediaInfo, only reverse the prefix. Just remove the "-" prefix from the "DelayAudio" command.

My take on the whole issue is that such captured transport streams always have non-decodable B-Frames at the beginning. And all the available source filters have different ways how they treat these non-decodable frames. Luckily we only need to deal with DirectShow based source filters and ffms2 (Donald Graft handles such sources differently again).


Cheers
manolito
manolito is offline   Reply With Quote
Old 23rd July 2018, 19:08   #3128  |  Link
manolito
Registered User
 
manolito's Avatar
 
Join Date: Sep 2003
Location: Berlin, Germany
Posts: 3,078
I am trying to find a fool proof work flow for such captured MTS transport streams which allows me to add audio filters and does not have any audio delay problems. And I believe that I found such a work flow...

These are the steps:
1. Repack the source to MKV while converting the audio tracks to PCM. Here is a universal FFmpeg command line for this task:
Quote:
ffmpeg.exe -fflags +genpts -y -i "ONE.mts" -map 0:0 -c:v:0 copy -aspect:v:0 16:9 -map 0:1 -c:a:0 pcm_s24le -map 0:2 -c:a:1 pcm_s24le -shortest "ONE.mkv"
2. In AVStoDVD preferences disable audio delay correction AND force FFmpegSource for video and audio.

So far I tested 6 different captured sources, and they all came out in perfect sync. During the remuxing to MKV there are dozens of FFmpeg warnings at the beginning, but the garbled non-decodable frames are removed perfectly.


Cheers
manolito
manolito is offline   Reply With Quote
Old 26th July 2018, 15:06   #3129  |  Link
MrC
AVStoDVD Dev
 
MrC's Avatar
 
Join Date: Apr 2006
Location: Italy
Posts: 1,302
@manolito

great, thanks for sharing the workflow



Bye
__________________
MrC

AVStoDVD Homepage
AVStoDVD @ Doom9 Forum
MrC is offline   Reply With Quote
Old 6th August 2018, 14:33   #3130  |  Link
manolito
Registered User
 
manolito's Avatar
 
Join Date: Sep 2003
Location: Berlin, Germany
Posts: 3,078
New versions of my A2D plugins...
https://files.videohelp.com/u/172211...D%20Plugins.7z

Changes:
For the FF_VBR and the HC_Mod plugins I added an option to append a Prefetch() command to the end of the AVS script generated by AVStoDVD. This is for users of AVS+ who want to automatically enable multithreading.


Cheers
manolito
manolito is offline   Reply With Quote
Old 19th August 2018, 14:51   #3131  |  Link
thescrapyard
Registered User
 
thescrapyard's Avatar
 
Join Date: Feb 2008
Posts: 59
Bit of a strange error/bug here

Setting up a project everything is fine, but if I save any project then load it again, a few lines have been added onto the end of the avisynth scripts which then causes it to fail with a script error

I've tried literally running AVStoDVD, setting up a very simple project and saving it without touching any settings or fiddling with anything. Loading the project straight back into AVstoDVD gives the extra lines

No ideas where they are being added from, or why

All that has been done is use the A2DPlugins for FFMPEG, HCEnc and WAVI mods. These have always worked perfectly

The scripts still work as they should, BUT the extra lines have to be removed first from any loaded project or it fails with an error

The lines added to the end of AVISynth scripts for any project that has been saved and then loaded are :

AVSDelayAudio1: 0
AudioDelay1: 0
AVSAmplifyAudio1: 0
AudioAmplify1: 1

But I haven't changed any settings. Just tried saving a job list then loading it. Nothings changed, so seems to be an issue with saving and loading projects only


Thanks
thescrapyard is offline   Reply With Quote
Old 19th August 2018, 15:54   #3132  |  Link
manolito
Registered User
 
manolito's Avatar
 
Join Date: Sep 2003
Location: Berlin, Germany
Posts: 3,078
This post is in the wrong thread. It should be moved to the "AVStoDVD Support Thread". Can a moderator please move the post...
[moved from Avisynth+ thread]

But you are right, you have discovered a bug in the latest AVStoDVD versions. I can confirm it under version 2.8.8 Alpha, I have no idea when this regression was introduced. I also tested if my plugins have anything to do with it, but they don't.

Some work for MrC...


Cheers
manolito


//EDIT//
This regression was introduced with version 2.8.8 Alpha. Probably issues with the new code which was needed for the audio peak level detection. Going back to version 2.8.7 stable solves the problem.

Last edited by manolito; 19th August 2018 at 18:02. Reason: posts moved
manolito is offline   Reply With Quote
Old 22nd August 2018, 22:06   #3133  |  Link
MrC
AVStoDVD Dev
 
MrC's Avatar
 
Join Date: Apr 2006
Location: Italy
Posts: 1,302
Yes, there's a load project routine section not updated after the introduction of the peak level detection feature. My bad. I will fix it asap, together with a better management of the peak level stuff.

Thanks for the report.



Bye
__________________
MrC

AVStoDVD Homepage
AVStoDVD @ Doom9 Forum
MrC is offline   Reply With Quote
Old 23rd August 2018, 08:36   #3134  |  Link
thescrapyard
Registered User
 
thescrapyard's Avatar
 
Join Date: Feb 2008
Posts: 59
Quote:
Originally Posted by MrC View Post
Yes, there's a load project routine section not updated after the introduction of the peak level detection feature. My bad. I will fix it asap, together with a better management of the peak level stuff.

Thanks for the report.



Bye


Thanks. At least it wasn't me messing about with things again
thescrapyard is offline   Reply With Quote
Old 3rd September 2018, 02:09   #3135  |  Link
manolito
Registered User
 
manolito's Avatar
 
Join Date: Sep 2003
Location: Berlin, Germany
Posts: 3,078
@MrC

Sorry I have to bug you with another request to change the A2D behavior for progressive 23.976 clips with pulldown flags...

Turns out that some of my previous findings about source filter behavior for such sources were wrong.
https://forum.doom9.org/showthread.p...21#post1850321

These statements are not true:
Quote:
The problem with A2D is that whenever DSS2Mod or DirectShowSource or FFmpegSource is used then the frame rate reported by MediaInfo is included in the call for the source filter. This will give incorrect results. If MediaInfo reports 2:3 pulldown then the frame rate for the source filter call should be 29.97 (or it could be omitted).

The reason for this incorrect behavior is that all the above source filters have no option to remove pulldown flags with a "Forced Film" option like DGIndex. They all honor the pulldown flags and serve a "pseudo-interlaced" output to AviSynth.
I recently did some more thorough tests about source filter behavior for such sources, have a look here:
https://forum.doom9.org/showthread.p...21#post1850321

Mainly AVStoDVD should use these procedures for the different source filters:

1: DGIndex / DGDecode
Basically leave it as it is. Only add the D2V parameter to the TFM call like:
TFM(d2v="my_d2v_file").TDecimate()

2: FFmpegsource
Use 23.976 as the fps value. Do not invoke IVTC

3: DSS2Mod and DirectShowSource
Use 23.976 as the fps value. Do not invoke IVTC


FFmpegSource does not honor the pulldown flags. When called without fpsnum/fpsden it will decode to 23.976.

DSS2Mod and DirectshowSource when called without an "fps=" parameter will decode to 29.97. But this is misleading because it does not honor the pulldown flags. Instead it decodes to 23.976 first and then adds duplicate frames to reach the 29.97 frame rate. Quite stupid. A2D should add the "fps=23.976" parameter to avoid this stupid behavior.


Alright, you won't like these new findings, I apologize for having misled you. The DSS2Mod/DirectShowSource way of outputting 29.97 but with dupes instead of repeated fields got me on the wrong track.


Cheers
manolito
manolito is offline   Reply With Quote
Old 6th September 2018, 01:08   #3136  |  Link
manolito
Registered User
 
manolito's Avatar
 
Join Date: Sep 2003
Location: Berlin, Germany
Posts: 3,078
Bug report for the latest version 2.88 Alpha
-------------------------------------------------

When converting a PAL progressive DVD title (in an MKV container) to NTSC with HCenc, then AVStoDVD applies pulldown twice. First by putting "*PULLDOWN" into the HC.ini, then again by using DGPulldown. I think that doing this only once would be better...

Here is the relevant part of the log:
Quote:
<06.09.2018 01:35:25>
START VIDEO ENCODING OPERATIONS
Video Encoding Profile: HCenc VBR 1-pass
Target Video FileSize: 4180 MB
Encoding Parameters: -ini "D:\DVD_test.HCenc.ini"
HCenc ini file:
*INFILE D:\DVD_test_1.avs
*AVSRELOAD
*OUTFILE D:\DVD_test.m2v
*LOGFILE D:\DVD_test.HCenc.log
*MAXBITRATE 8724
*1PASS
*BITRATE 5580
*PROFILE NORMAL
*ASPECT 16:9
*PROGRESSIVE
*TFF
*PULLDOWN
*BIAS 60
*DC_PREC 9
*MATRIX MANONO1
*AQ 2
*LUMGAIN 2
*SMP
*PRIORITY IDLE
*DBPATH D:
*WAIT 2
<>

<06.09.2018 01:49:41>
END VIDEO ENCODING OPERATIONS
Video Source Filter: A2DSource - DSS2 mod (LAV Filters on)
Created File: D:\DVD_test.m2v (4182,2 MB)
Ouput Video Info: MPEG-2 Video - 5583 kbps - 720x480 - DAR 16:9 - 29,97 fps - Progressive (2:3 Pulldown) - 1:44:44 hours - 188318 frames
Avg Video Encoding Speed: 223,4 fps
<>

<06.09.2018 01:49:41>
START PULLDOWN OPERATIONS
DGPulldown Parameters: "D:\DVD_test.m2v" -srcfps 29.97 -destfps 29.97 -inplace -tff
<>

<06.09.2018 01:51:49>
END PULLDOWN OPERATIONS
DGPulldown executed on File: D:\DVD_test.m2v (4182,2 MB)
Output Video Info: MPEG-2 Video - 6979 kbps - 720x480 - DAR 16:9 - 29,97 fps - Progressive (TFF) - 1:23:47 hours - 150656 frames
<>

<06.09.2018 01:51:59>
Process halted during Title 1 VIDEO encoding operations.

Error Message: 'Warning! Title 1 output Video duration (01:23:47) is shorter than expected duration (01:44:44).'
This issue might have been there for a while, I do NTSC conversions only rarely.


Cheers
manolito
manolito is offline   Reply With Quote
Old 1st October 2018, 22:28   #3137  |  Link
MrC
AVStoDVD Dev
 
MrC's Avatar
 
Join Date: Apr 2006
Location: Italy
Posts: 1,302
@manolito

back from job marathon...

Thanks for the bug report about the double pulldown procedure. It was a recent entry, after the re-definition of NTSC progressive w/ pulldown flags framerate as 29.97 (2:3 pulldown) instead of 23.976 (2:3 pulldown). Very easy to fix.

About the other post (https://forum.doom9.org/showpost.php...postcount=3135), I will take a careful look. My time for A2D is running so low that I have to be absolutely sure in making changes to the code in order not to insert more damages than gains. I'm sure you can understand. From the link you reported (https://forum.doom9.org/showthread.p...21#post1850321) the discussion was way long: after sept 3rd (your post here), solutions #1, #2, #3 are still valid from your more recent findings?



Bye
__________________
MrC

AVStoDVD Homepage
AVStoDVD @ Doom9 Forum
MrC is offline   Reply With Quote
Old 1st October 2018, 23:51   #3138  |  Link
manolito
Registered User
 
manolito's Avatar
 
Join Date: Sep 2003
Location: Berlin, Germany
Posts: 3,078
Hi MrC,

good to see you back after more than a month (I had hoped that you were on a nice and long vacation...).

For the NTSC progressive with pulldown sources, yes, the 3 solutions are still valid, but only #1 is really fool proof. DSS2Mod and ffms2 have problems with such sources no matter which settings are used.

If the MPEG2 video is in an MKV container, the MKV should probably be demuxed first, then use DGIndex/DGDecode for the video and add the other streams manually. Mr. Graft indicated in the linked thread that he might expand DGIndex to support MPEG2 in an MKV container, but I have no idea if this will materialize.

For ffms2 a working solution is to add "RFFMode=1" to the command line which will honor the pulldown flags. But the field order needs to be the reverse value of the DGIndex field order. Not something the average user wants to deal with.


Another thing you might want to add to the next stable version is AVS+ support. I have been using it on my Core i5 laptop for some time now without any issues. It was requested by steptoe at VideoHelp, see here:
https://forum.videohelp.com/threads/...24#post2526075

It basically comes down to adding a "Prefetch" call at the end of the AVS script after detecting if AVS+ is installed. The number of threads can be determined automatically, Myrsloik proposed this formula:
max(physical cores, min(logical threads, 8))

I have already integrated it into my FF_VBR and HCenc_Mod plugins, but most folks probably do not use them...


Cheers
manolito

Last edited by manolito; 1st October 2018 at 23:59.
manolito is offline   Reply With Quote
Old 2nd October 2018, 12:16   #3139  |  Link
SuLyMaN
Registered User
 
Join Date: Jul 2007
Posts: 156
@mrc Heh man It's been a while since I posted there as I simply am not making an DVDs at the moment. I have shifted to converting my stuffs and watching them on TV via a TV Box.
So, until I need the wonderful piece of free software that is AVStoDVD, a big thank you for the work. Top level software!
SuLyMaN is offline   Reply With Quote
Old 8th October 2018, 00:17   #3140  |  Link
manolito
Registered User
 
manolito's Avatar
 
Join Date: Sep 2003
Location: Berlin, Germany
Posts: 3,078
Handling of more than 1 audio tracks

Just found another bug when dealing with clips with more than 1 audio tracks:

With the default source configuration (A2DSource) DirectShow will be used for audio. But only for the first audio track, because DirectShowSource does not allow track selection. The second and third audio tracks will use FFmpegSource because it allows track selection.

This works nicely as long as DirectShowSource picks the first audio track of the source clip. But I found that this is not always true. The sample clip from this post
https://forum.doom9.org/showthread.p...24#post1854124
has 3 audio tracks, and the second one is marked as "default". For this clip DirectShowSource will pick the second (default) audio track as the first audio track, and A2D will throw an error because the number of channels is different for the two tracks.

The only workaround I can think of so far is to not use DirectShowSource Audio at all for such sources, force using FFmpegSource instead. This will treat the track numbers correctly, but the "Default" audio track flag will be lost. Does MPEG2 even support this flag at all?


Cheers
manolito
manolito 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 Off
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 20:44.


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