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 > Video Encoding > MPEG-2 Encoding

Reply
 
Thread Tools Search this Thread Display Modes
Old 2nd February 2018, 02:36   #1  |  Link
Katie Boundary
Registered User
 
Katie Boundary's Avatar
 
Join Date: Jan 2015
Posts: 1,048
Converting PAL discs to film with soft pulldown

Here's the story: about a week ago, I decided to watch Death Note, the anime... followed by the Netflix movie... followed by the three live-action Japanese movies (skipping the L spinoff movie). Not since Evangelion has an anime hit me this hard. Anyway, I've already gone and bought the first two movies on Amazon, but there's a small problem with the third one, "Light Up the New World": it hasn't yet had a North American release. I can only get the Australian release, which is PAL. What I'd like to do is this: buy the Australian version, rip it, convert the soft subs to hard subs (assuming Vobsub and VSrip will be cooperative that day), resize to 720x480, slow the video back down to 23.976 fps, slow the audio down by the same amount, resample back to 48 khz, encode as MPEG-2 with soft pulldown, and then somehow burn that to a new DVD that will work in 'Murican DVD players.

The problem is, I only know enough to get an .mpg file out of Tsunami MPEG Encoder for playback on a computer. I don't know how to make VOB files, or convert the audio to AC3, or really do much of anything related to authoring an actual DVD. I don't even know if the "3:2 pulldown" option in Tsunami applies hard or soft pulldown. Can I get any help with this?
__________________
I ask unusual questions but always give proper thanks to those who give correct and useful answers.

Last edited by Katie Boundary; 2nd February 2018 at 02:41.
Katie Boundary is offline   Reply With Quote
Old 2nd February 2018, 10:31   #2  |  Link
LogicDeLuxe
Registered User
 
LogicDeLuxe's Avatar
 
Join Date: Nov 2004
Posts: 106
EAC3to can slowdown, resample and encode your audio.
Muxman can make your VIDEO_TS folder with IFO and VOB files.
And ImgBurn is able to format and burn a DVD Video compliant DVD.
__________________
AMD Ryzen 5, 16 GM RAM, Nvidia GTX 1060, Linux Mint
LogicDeLuxe is offline   Reply With Quote
Old 2nd February 2018, 14:32   #3  |  Link
manolito
Registered User
 
manolito's Avatar
 
Join Date: Sep 2003
Location: Berlin, Germany
Posts: 3,078
IMO the easiest way is using AVStoDVD for this task. It has this option under "Preferences->AviSynth":
Quote:
Use NTSC SlowDown for progressive PAL to NTSC
Check this option to use 4% slow down when converting from progressive PAL based footage (25 fps) to NTSC-film based footage (23.976 fps). This option will enable the use of 'AssumeFPS("pal_film")' AviSynth command. 3:2 Pulldown will be performed to bring up the framerate to 29.97 fps.
This will take care of the audio automatically. Probably even the subs will be converted correctly (not sure because I do not use subs).

There is one thing to observe, though:
Commercial PAL DVDs are mostly flagged as interlaced, even if the content is purely progressive. If this is the case for this Australian DVD you need to change the title properties from interlaced to progressive after importing the source. If you forget this, AVStoDVD will do an interlaced conversion without soft pulldown.

The basic work flow is like this:
1. Rip the DVD with MakeMKV. This will preserve the chapters and subs.
2. Import the MKV into AVStoDVD. If necessary change the title properties to "progressive".
3. For the output you have choices of either elementary streams, muxed MPG file, ISO image or burning (if IMGBurn is installed).

Of course this will only convert the main title. So far it is not possible to do a standards conversion preserving all the menus and extras.


Cheers
manolito

Last edited by manolito; 2nd February 2018 at 14:40.
manolito is offline   Reply With Quote
Old 2nd February 2018, 20:59   #4  |  Link
Katie Boundary
Registered User
 
Katie Boundary's Avatar
 
Join Date: Jan 2015
Posts: 1,048
Quote:
Originally Posted by LogicDeLuxe View Post
EAC3to can slowdown, resample and encode your audio.
I can do the slowdown and resampling in AVIsynth.

Quote:
Originally Posted by LogicDeLuxe View Post
Muxman can make your VIDEO_TS folder with IFO and VOB files.
And EAC3to makes the AUDIO_TS folder?

Quote:
Originally Posted by LogicDeLuxe View Post
And ImgBurn is able to format and burn a DVD Video compliant DVD.
Excellent. What would it take as input? A DVD-compliant MPEG-2 file? If so, would it perform a direct stream copy or would it re-encode?

Quote:
Originally Posted by manolito View Post
IMO the easiest way is using AVStoDVD for this task. It has this option under "Preferences->AviSynth":


This will take care of the audio automatically. Probably even the subs will be converted correctly (not sure because I do not use subs).
Eh... assume that I don't need it converted automatically. Assume I'm doing it in AVIsynth.

Quote:
Originally Posted by manolito View Post
There is one thing to observe, though:
Commercial PAL DVDs are mostly flagged as interlaced, even if the content is purely progressive. If this is the case for this Australian DVD you need to change the title properties from interlaced to progressive after importing the source.
LOLWUT? You mean add assumeframebased() to the AVIsynth script?

Quote:
Originally Posted by manolito View Post
The basic work flow is like this:
1. Rip the DVD with MakeMKV. This will preserve the chapters and subs.
2. Import the MKV into AVStoDVD. If necessary change the title properties to "progressive".
3. For the output you have choices of either elementary streams, muxed MPG file, ISO image or burning (if IMGBurn is installed).
:\ Although that does seem "easier", it removes too much human input from the equation. For example, I want to have control over the resizing method that would be used to convert 720x576 to 720x480:


Code:
A=mpeg2source("deathnote3.d2v")
B=wavsource("deathnote3 t81 2_0ch blah blah.wav")

Audiodub(A,B).arearesize(720,480).assumefps(24000,1001,true).resampleaudio(48000)
__________________
I ask unusual questions but always give proper thanks to those who give correct and useful answers.

Last edited by Katie Boundary; 2nd February 2018 at 21:12.
Katie Boundary is offline   Reply With Quote
Old 2nd February 2018, 21:58   #5  |  Link
manolito
Registered User
 
manolito's Avatar
 
Join Date: Sep 2003
Location: Berlin, Germany
Posts: 3,078
Well, you cannot have a basic understanding how AVStoDVD works if you never tried it...

Quote:
Eh... assume that I don't need it converted automatically. Assume I'm doing it in AVIsynth.
AVStoDVD uses AviSynth, and you can easily edit the script it has created.

Quote:
LOLWUT? You mean add assumeframebased() to the AVIsynth script?
Nothing like this. AVStoDVD takes the source properties from MediaInfo. For each title you can edit these properties, just select "Scan Type" and enter "Progressive" instead of "Interlaced". AVStoDVD will take care of the AVS script accordingly.

Quote:
:\ Although that does seem "easier", it removes too much human input from the equation. For example, I want to have control over the resizing method that would be used to convert 720x576 to 720x480:
One of the nice things about AVStoDVD is its versatility. Users can control the resize method globally under "Preferences", and after importing sources each title can be edited. The generated AVS script can be easily modified to use a different resizer than the one which was specified under "Preferences".


But you know, you can lead a horse to the water, but...
Do whatever you like, this was just my 2 cents, and I live in PAL country and I do know what I am talking about.


Good luck
manolito
manolito is offline   Reply With Quote
Old 2nd February 2018, 22:16   #6  |  Link
sneaker_ger
Registered User
 
Join Date: Dec 2002
Posts: 5,565
Muxman takes MPEG2 elementary stream + AC3 audio and creates the VIDEO_TS and AUDIO_TS folders. imgurn can burn them as a Video DVD.
hcenc can take AviSynth script and create MPEG2 stream, ffmpeg can create AC3 audio.
sneaker_ger is offline   Reply With Quote
Old 3rd February 2018, 22:46   #7  |  Link
Katie Boundary
Registered User
 
Katie Boundary's Avatar
 
Join Date: Jan 2015
Posts: 1,048
Quote:
Originally Posted by manolito View Post
AVStoDVD uses AviSynth, and you can easily edit the script it has created.

...

One of the nice things about AVStoDVD is its versatility. Users can control the resize method globally under "Preferences", and after importing sources each title can be edited. The generated AVS script can be easily modified to use a different resizer than the one which was specified under "Preferences".
Interesting. Can I just entirely skip the part where it creates the script for me, and use my own script?

Quote:
Originally Posted by sneaker_ger View Post
Muxman takes MPEG2 elementary stream + AC3 audio and creates the VIDEO_TS and AUDIO_TS folders. imgurn can burn them as a Video DVD.
hcenc can take AviSynth script and create MPEG2 stream, ffmpeg can create AC3 audio.
ffmpeg either doesn't work on my computer or has grossly insufficient documentation. Either way, I'll need an alternative way of creating the AC3 files. I think Manolito's approach, or a modification thereof, might be the best suited for my goals and circumstances.
__________________
I ask unusual questions but always give proper thanks to those who give correct and useful answers.
Katie Boundary is offline   Reply With Quote
Old 4th February 2018, 01:10   #8  |  Link
manolito
Registered User
 
manolito's Avatar
 
Join Date: Sep 2003
Location: Berlin, Germany
Posts: 3,078
Quote:
Originally Posted by Katie Boundary View Post
Interesting. Can I just entirely skip the part where it creates the script for me, and use my own script?
Pretty much so...

This is a typical script which AVStoDVD creates for a PAL MPEG2 source in an MKV container when you have specified NTSC output:

Quote:
Import("E:\Programme\AVStoDVD\Lib\A2DSource.avsi")

Video = A2DVideoSource("I:\test.mkv", CacheFolder="I:", VFR=false, FrameRate=25)
Audio = A2DAudioSource("I:\test.mkv", CacheFolder="I:")

Video = Video.ConvertToYV12()
Video = Video.Spline36Resize(720,480)
#NTSCSlowDown: using AssumeFPS() to downsize FPS to 23.976 and then DGPulldown to upsize to 29.97

Audio = Audio.DelayAudio(-0.005)

AudioDub(Video, Audio)
AssumeFPS("ntsc_film", sync_audio=true).ResampleAudio(48000)
(Of course you can also use ffms2 as your source filter)

Replacing this whole script with your own script is no problem, but you really have to know what you are doing. I found that the following method is much safer and easier:

Quote:
Import("E:\Programme\AVStoDVD\Lib\A2DSource.avsi")

Video = A2DVideoSource("I:\test.mkv", CacheFolder="I:", VFR=false, FrameRate=25)
Audio = A2DAudioSource("I:\test.mkv", CacheFolder="I:")

Video = Video.ConvertToYV12()

Last = Video
My_AVS_Filter1()
My_AVS_Filter2()
My_AVS_Filter3()
Video = Last


Video = Video.Spline36Resize(720,480)
#NTSCSlowDown: using AssumeFPS() to downsize FPS to 23.976 and then DGPulldown to upsize to 29.97

Audio = Audio.DelayAudio(-0.005)

AudioDub(Video, Audio)
AssumeFPS("ntsc_film", sync_audio=true).ResampleAudio(48000)
You can insert all of your AVS commands right after the "ConvertToYV12()" command before the resize command, but of course it is no problem to insert your commands after the resizer, too.


Well, you won't know if this method is for you until you tried it...

Cheers
manolito


//EDIT//
Oops, I totally forgot to mention that AVStoDVD also supports AVS scripts as a source. This will disable most of the internal script creation, but again the user needs to know what she is doing...

Last edited by manolito; 4th February 2018 at 01:20.
manolito is offline   Reply With Quote
Old 4th February 2018, 07:42   #9  |  Link
Katie Boundary
Registered User
 
Katie Boundary's Avatar
 
Join Date: Jan 2015
Posts: 1,048
Yeah, those just look like more verbose versions of my own script, but with a different resizer. The only key difference that I can see is the addition of ConverttoYV12, and for reasons that I cannot fathom, altered audio timing. Isn't DVD footage already YV12, or is it some other member of the YCbCr family? Also, what is A2DSource.avsi?
__________________
I ask unusual questions but always give proper thanks to those who give correct and useful answers.
Katie Boundary is offline   Reply With Quote
Old 4th February 2018, 12:19   #10  |  Link
StainlessS
HeartlessS Usurer
 
StainlessS's Avatar
 
Join Date: Dec 2009
Location: Over the rainbow
Posts: 10,980
Perhaps AVS2DVD can extract as YUY2 (same as DGIndex, dont know dont use it),
but anyways, ConvertToYV12() when already YV12, is a NOP.
Quote:
altered audio timing
Kinda curious bout that myself (the DelayAudio(-0.005) bit), How do them there numbers work Manolito, something to do with re-center
audio in mid frame (pre-adjusting prior to assumefps).
Code:
AssumeFPS("ntsc_film", sync_audio=true).ResampleAudio(48000)
Changes assumed framerate keeping audio in sync, but results in non standard audio SampleRate, so requires the resampleaudio thing.
__________________
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; 4th February 2018 at 13:17.
StainlessS is offline   Reply With Quote
Old 4th February 2018, 12:35   #11  |  Link
sneaker_ger
Registered User
 
Join Date: Dec 2002
Posts: 5,565
Probably 5ms to counter AC3 encoder delay.
sneaker_ger is offline   Reply With Quote
Old 4th February 2018, 13:20   #12  |  Link
StainlessS
HeartlessS Usurer
 
StainlessS's Avatar
 
Join Date: Dec 2009
Location: Over the rainbow
Posts: 10,980
That explains it, thanx Sneaky
__________________
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 4th February 2018, 16:35   #13  |  Link
manolito
Registered User
 
manolito's Avatar
 
Join Date: Sep 2003
Location: Berlin, Germany
Posts: 3,078
Yes, these explanations are all right on the money...

ConvertToYV12() is always inserted by AVStoDVD, because for DVD target the video has to be YV12, and if the source already is YV12 then this instruction is a NOP and won't hurt.

The audio delay value is automatically taken from the MediaInfo output for the source, it can be disabled in the settings. For some source formats this is a bit of a problem, though. Sometimes MediaInfo reports an audio delay of several seconds, and in my experience such huge audio delays have to be ignored.

The last line in the script takes care of the video and audio slowdown. "ResampleAudio" is only used when "SSRC" is not possible. It works reliably, but you need to know that it does not do any pitch correction (so the slowdown goes along with a lower pitch). If you need pitch correction you have to remove "sync_audio=true" and "ResampleAudio" or "SSRC" from this line and instead use the "TimeStretch(tempo={percentage})" command for audio slowdown.

This can also be a little problematic. Pitch correction is complex and prone to audible artifacts (unless you use expensive pro software). The TimeStretch plugin which is part of AviSynth 2.60 is old and does not support 6-ch audio. You can use a newer TimeStretch library by either using the separate TimeStretch plugin by Wilbert, or you can use AviSynth 2.61 Alpha.


Cheers
manolito

Last edited by manolito; 5th February 2018 at 16:54.
manolito is offline   Reply With Quote
Old 4th February 2018, 19:50   #14  |  Link
qyot27
...?
 
qyot27's Avatar
 
Join Date: Nov 2005
Location: Florida
Posts: 1,419
Honestly, whenever I used to come across PAL content and wanted to put it on DVD, I didn't bother messing with the framerate or pitch shifting. Just resize to 720x480, encode with HCenc or whatever as normal 25fps, and then run it through DGPulldown to add the 25->29.97 flagging, no audio manipulation needed. Then mux the video and audio together with mplex* and hand it to your DVD authoring program of choice (in AVStoDVD's case, just tell it to passthrough when the video and audio are compliant).

*use -V -f 8 to make sure it has the correct container settings.
qyot27 is offline   Reply With Quote
Old 4th February 2018, 20:49   #15  |  Link
manolito
Registered User
 
manolito's Avatar
 
Join Date: Sep 2003
Location: Berlin, Germany
Posts: 3,078
Sure, the only thing is that a couple of folks like the 23.976 -> 29.97 pulldown a lot better than the (legal but kind of irregular) 25 -> 29.97 pulldown. I live in PAL land so I am not in a position to make a judgement about this claim. I do remember a very old post by Donald Graft confirming this fact.

And AVStoDVD is smarter than you think. You just have to uncheck the NTSC Speeddown option to make it use DGPulldown for 25 -> 29.97 pulldown. Use whatever you like better...

Cheers
manolito

Last edited by manolito; 4th February 2018 at 21:17.
manolito is offline   Reply With Quote
Old 5th February 2018, 00:17   #16  |  Link
StainlessS
HeartlessS Usurer
 
StainlessS's Avatar
 
Join Date: Dec 2009
Location: Over the rainbow
Posts: 10,980
Quote:
Originally Posted by manolito View Post
"ResampleAudio" is only used when "SSRC" is not possible. It works reliably
SSRC used to be somewhat better than ResampleAudio, but little advantage nowadays, also fails on some conversions, I always use ResampleAudio now (used to always use SSRC, except when fails with error).

Quote:
Originally Posted by IanB View Post
Originally when SSRC was added ResampleAudio() only processed 16bit samples. SSRC always processes in ieee 32bit floats. ResampleAudio has since been taught how to also process in floats, so the gap has closed.

SSRC() by default uses Naoki Shibata's "fast" algorithm which yield very excellent result under most normal circumstances. If required you may do SSRC(fast=False) which will use the "slow" algorithm. This is for when you are doing large samplerate down conversions (more than a factor 2). When converting between 32K, 44.1K and 48K there is almost no observable difference. The "slow" algorithm gives improved aliasing prevention at the cost of processing speed.

However SSRC can only convert between particular sample rates as defined by these expressions :-
ResampleAudio() has no such restriction. It uses a a brute force 64 tap FIR filter approach with triangular interpolation. It is about the same speed as "fast" mode SSRC. SSRC uses a fast and clever factoring approach that achieves results similar to a 512 tap FIR filter in "fast" mode and a 4096 tap FIR filter in "slow" mode. For processing 16bit CD grade audio both filters in all modes well exceed the quality requirements of the 16bit data. In float mode a trained observer might be able to detect differences with a true 24bit audio stream.
https://forum.doom9.org/newreply.php...eply&p=1581678

Quote:
Originally Posted by IanB View Post
For 16 bit audio samples ResampleAudio() will be indistinguishable from SSRC(). Also it does not have input/output ratio restriction and you will avoid a ConvertAudioToFloat/ConvertAudioTo16bit pair.

And the question about length relates to the total amount of error we are talking about 14.999 -> 15.0 over 20 minutes is 80 milliseconds ==> don't change it! (It's a lot less than 200ms)

Also 14.999 -> 14.985 over 20 minutes is 1116 milliseconds ==> Do change it!

At 15 fps each frame is 66.6 milliseconds.
https://forum.doom9.org/newreply.php...reply&p=973680

EDIT: More, google
Code:
resampleaudio ssrc ianB site:forum.doom9.org
__________________
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 February 2018 at 00:31.
StainlessS is offline   Reply With Quote
Old 7th February 2018, 03:04   #17  |  Link
manono
Moderator
 
Join Date: Oct 2001
Location: Hawaii
Posts: 7,406
Just discovered this thread.

If I've done this once, I've done it a thousand times.

If you want all-in-one, then AvsToDVD is definitely the way to go. It allows for only rudimentary menus, though, if that's important. As manolito mentions, it's very flexible and allows for editing the AviSynth scripts and a lot more.

Me, I do it manually. Open the script in HC-Enc and use it for encoding (as you can also in AvsToDVD). The script has the resize and slowdown to 23.976fps and anything else needed. I extract the PAL audio when making the D2V file in DGIndex, convert to WAV, slowing it to film speed at the same time, using BeSweet because I usually play with the WAV file in Audacity afterwards. Then it's converted to AC3 using Aften and its GUI. There are lots of ways to handle the audio. I saw eac3to mentioned. Subs are extracted as SSA using SubRip, slowed to film speed in SubStation Alpha, and anti-aliased SST DVD subs created using MaestroSBT. I create the chapter points as a Celltimes.txt file and use Muxman to put all the pieces together into a playable DVD. I use DVDAuthorGUI to make menus, and ImgBurn to burn to disc. All well known freeware tools are used.

I don't know if Katie wants to do the entire thing manually, or wants an all-in-one to do it for her. She mentioned wanting a degree of customization not usually available in an all-in-one program. Doing all the work manually, while slower, certainly allows you to customize it any way you like.
manono 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 21:51.


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