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 > Announcements and Chat > General Discussion

Reply
 
Thread Tools Search this Thread Display Modes
Old 27th November 2011, 16:58   #1  |  Link
Lincoln Burrows
Registered User
 
Lincoln Burrows's Avatar
 
Join Date: Mar 2008
Posts: 280
PAL to NTSC conversion, am I missing something?

Folks,
I am trying to do the following (please look at what steps I have taken so far. I am going to explain this thing very carefully to avoid any doubts).

- First, I have a PAL (25 fps) video with a MP3 file (AVI container).

Duration : 1h 51mn 42s 40ms
Duration : 01:51:42.040

Format : MPEG-4 Visual
Format profile : AdvancedSimple@L5
Format settings : BVOP / Custom Matrix

This video is also using a second audio stream, but I am only working with the first one. If needed I can use Direct Stream copy with VirtualDub and remove it.

- I also have a 24 fps (NTSC) video from the same source. However, this video runtime is:

Duration : 1h 56mn 39s 51ms
Duration : 1h 56mn
Duration : 01:56:39.051

And it should be noted that this video has additional 20 seconds in beginning, from 0 second to 20. And (as far as I know) this is the only difference between the two of them.

My goal: to sync the audio from the 1st video into the second.

OK.

What I need to do is this:

1) Extract the MP3 from the 1st (25 fps) video.

2) Use Audacity to convert this MP3 from PAL to NTSC. Someone said to me I need to use - 4,096% to achieve a PAL to NTSC conversion.

According to Audacity, that will give me this result:



Alterar tempo sem alteração na altura = Change runtime without changing pitch

As you can see, the MP3 will have 6988,27 seconds, and not 6702,03 (PAL/25 fps).

Let's call the resulting file from Audacity, SYLAR.mp3.

3) What I need to do now is to open SYLAR.mp3. using Sound Forge or any other program and add + 20 seconds in the beginning, to sync with the second video (NTSC).

However, step 3 is not working. No matter how many seconds I use, I am always listening to this 1, 2, 3 seconds behind when I insert the file in the NTSC video. What makes me think if I am doing something wrong or some piece from the original source is missing from the 1st file compared to the 2nd one.

************

And now, this is where the whole thing gets interesting:

I used a software to convert the 1st VIDEO FILE (PAL, 25 fps) to NTSC using either 23.976 or 29.970. In both cases, the runtime is still the same.

What is going on? If I am not mistaken, when you convert any video from 25 to 23.976 you will get a different runtime, not the same. Why the resulting file has 1h 51m and not more?

(I tried to convert the video to see what's wrong with the whole thing I explained in this thread. I can't find what's wrong when both videos have different framerates - it will make things hard for me to compare).
__________________
"Whoever has not known himself has known nothing. But whoever has known himself has simultaneously achieved knowledge about the depth of all things."

Last edited by Lincoln Burrows; 27th November 2011 at 17:08.
Lincoln Burrows is offline   Reply With Quote
Old 27th November 2011, 17:42   #2  |  Link
CWR03
Custom User Title
 
CWR03's Avatar
 
Join Date: Mar 2005
Posts: 3,737
What are you using to merge the audio? If you're using VirtualDubMod and imputting MP3 audio, select "No" to rewrite headers. You can also adjust the audio delay within it.
CWR03 is offline   Reply With Quote
Old 27th November 2011, 22:33   #3  |  Link
Lincoln Burrows
Registered User
 
Lincoln Burrows's Avatar
 
Join Date: Mar 2008
Posts: 280
If you need to demux the audio from the AVI file, you only need to use VirtualDub MOD;

If you need to insert the resulting file, with the PAL > NTSC conversion + adding 20 seconds for example, you might simply use this option from Media Player Classic-Home Cinema to know it the sync is correct (> Dub):



That is how I know the resulting file is incorrect.

As you can see, I am not even merging anything to check the results.
__________________
"Whoever has not known himself has known nothing. But whoever has known himself has simultaneously achieved knowledge about the depth of all things."
Lincoln Burrows is offline   Reply With Quote
Old 28th November 2011, 10:02   #4  |  Link
hello_hello
Registered User
 
Join Date: Mar 2011
Posts: 4,541
Quote:
Originally Posted by Lincoln Burrows View Post
I used a software to convert the 1st VIDEO FILE (PAL, 25 fps) to NTSC using either 23.976 or 29.970. In both cases, the runtime is still the same.
It sounds like the software is actually converting the video, not simply changing the frame rate, which means it'll be adding/deleting frames and keeping the duration the same. The audio probably remains untouched.

Is your ultimate goal to stay with the AVI format?

If it is and you don't care about which frame rate is used you could add the PAL audio "as is" to the NTSC AVI using VirtualDub, delay it by 20 seconds, use VirtualDub to change the video frame rate to 25ps, then save it as a new AVI.

If you need to adjust the audio delay you can open the new AVI with MPC-HC and use the + & - keys to adjust it in real time, then use the delay amount in MPC-HC's status bar to adjust the audio delay correctly with VirtualDub.
hello_hello is offline   Reply With Quote
Old 3rd December 2011, 01:00   #5  |  Link
Lincoln Burrows
Registered User
 
Lincoln Burrows's Avatar
 
Join Date: Mar 2008
Posts: 280
Quote:
Originally Posted by hello_hello View Post
Is your ultimate goal to stay with the AVI format?
My ultimate goal is to sync this audio with the NTSC video. It doesn't matter if I have to convert either videos or even both audios to see what's wrong here.

I need to find out exactly what are the differences between both audios. At first I see nothing different besides the runtime.

Otherwise I will have to stay with this audio and a PAL source with poor quality.

I noticed you have these options in Virtual Dub:



What should I choose here?

I mean, to convert this video (and audio) from PAL to NTSC, changing the runtime.

There's another issue (I saw a disc like this once), maybe the original source was (or it is currently using) a different framerate (despite the fact you see 25 fps in the file properties).

For example, let's say a movie called "Adventures":

Adventures, NTSC runtime = 136 minutes (NTSC). Released in Region 1, DVD. 720x480
Adventures, PAL runtime = 131 minutes (PAL). Released in Region 2, DVD. 720x576

And this one was released in a country that only reads NTSC discs like United States (Region 1):

Adventures, PAL runtime = 131 minutes (NTSC). 720x480 *

* The disc/video can only be read by NTSC players, but the runtime is from a PAL source. Despite the fact it was converted into this disc at 29.97 frames per second, not 25.
__________________
"Whoever has not known himself has known nothing. But whoever has known himself has simultaneously achieved knowledge about the depth of all things."
Lincoln Burrows is offline   Reply With Quote
Old 3rd December 2011, 02:19   #6  |  Link
hello_hello
Registered User
 
Join Date: Mar 2011
Posts: 4,541
Just use the "Source rate adjustment" option in VirtualDub, you don't need to worry about the other two.
My idea would be to do it the other way around. Open the NTSC AVI, change the frame rate from 23.976 to 25fps, open the Streams menu, delete the existing audio, add the PAL audio, apply a 20 second delay to it and resave it as a new AVI using direct stream copy for the video. You might have to fiddle with the audio delay a little to get it to match up, but if you sync it okay at the beginning then hopefully it'll still be in sync at the end.
The idea is not to re-encode the video (hence selecting direct stream copy when saving), hopefully to just re-save it with a different frame rate and get it to match the audio.

The DVD stuff you posted seems similar to when you re-encoded your AVI... the last DVD was converted to NTSC by re-encoding and adding/duplicating frames in the process, not by simply changing the frame rate, hence still having a PAL runtime with an NTSC frame rate and resolution... but there's not really (the way I look at it) any PAL or NTSC factor to worry about when working with AVIs. Normally the video would be resized when converted to AVI and encoded using square pixels, so whether the source was originally NTSC or PAL is probably irrelevant because once it's converted to AVI it'll basically be the same video regardless of the source (ignoring any PAL and NTSC color differences which aren't really an issue). The only difference will be the frame rate.
So once you've converted to AVI you've just got two AVIs of different frame rates and changing the frame rate of one to match the other shouldn't effect your ability to play it if your hardware can already play the other.

I've done exactly what I've described with AVIs and MKVs on a few occasions. Sometimes you get lucky and once you get the audio delay correct it stays in sync with the video perfectly, sometimes you discover that even though the PAL and NTSC versions appear the same they're actually slightly different and there's no hope for swapping audio tracks no matter how you do it (even re-encoding the audio), and sometimes for reasons I don't understand you need to fiddle with the frame rate a little. For example if you change to 25fps and the audio gradually loses sync a bit, sometimes 24.999 or 25.001fps instead will do the trick.
The main reason for changing the frame rate rather than re-encoding the audio is that nothing needs to be re-encoded to do it and if you do have to experiment a little to get the two to match it's generally easier to adjust the frame rate and/or audio delay than it is to re-encode the audio over and over again trying to get it to sync.

Hopefully that makes sense.

Last edited by hello_hello; 3rd December 2011 at 02:52.
hello_hello is offline   Reply With Quote
Old 4th December 2011, 01:43   #7  |  Link
Lincoln Burrows
Registered User
 
Lincoln Burrows's Avatar
 
Join Date: Mar 2008
Posts: 280
hello_hello, the NTSC video is using those specs:

Quote:
Video
ID : 1
Format : VC-1
Format profile : AP@L3
Codec ID : WVC1
Codec ID/Hint : Microsoft
Duration : 1h 56mn
Bit rate : 22.7 Mbps
Width : 1 920 pixels
Height : 1 080 pixels
Display aspect ratio : 16:9
Frame rate : 24.000 fps
Chroma subsampling : 4:2:0
Bit depth : 8 bits
Scan type : Progressive
Compression mode : Lossy
Bits/(Pixel*Frame) : 0.457
Stream size : 18.5 GiB (83%)
Language : English
Default : Yes
Forced : No
It's a Matroska file, what software should I use to convert from NTSC to PAL (24 to 25 fps)? I don't think VirtualDub can do this. I tried SUPER, from eRIGHTSOFT, but it failed to change the runtime even after converting to 25 fps.
__________________
"Whoever has not known himself has known nothing. But whoever has known himself has simultaneously achieved knowledge about the depth of all things."
Lincoln Burrows is offline   Reply With Quote
Old 4th December 2011, 03:13   #8  |  Link
hello_hello
Registered User
 
Join Date: Mar 2011
Posts: 4,541
MKVMergeGUI. It's included with MKVToolnix. The frame rate option is under the "format specific options" tab, assuming you have a video stream selected.

You can also open other file types with it such as MP4, AVI etc and use streams they contain, then save the output as MKV. Or you can add multiple files and select only the streams you want to keep from each before muxing them into a new MKV.
There's a link to MKVCleaver on the MKVTooknix page I linked to. It's a handy utility to have too.

I think Super would have converted the video and added frames to keep the runtime the same. It has an option to copy a video or audio stream but I don't think it'll change the frame rate in the process.

When you've resaved the MKV you can try what I do to make sure the audio is exactly right, rather than guess. What I do is open the original video (in your case the 25fps AVI) in one instance of MPC-HC, then I open the new file (in your case new 25fps MKV) in a second instance of MPC-HC. I play them both at the same time making sure the audio of each is playing at the same place. Usually you'll have to mess around a little bit, pausing one or the other until they line up (I do it by quickly double clicking on the video to stop it and start it again but by default I think MPC-HC uses double clicking to switch the video full screen. I usually change that to a middle click instead). You'll know when the audio from each video is playing in sync because you won't hear any delay between the audio of each video, you'll hear a "phasing" type effect.
When the audio from each video is playing in sync I then watch both videos together as they change from one scene to another. If the scene changes happen at exactly the same time then the audio is synced to the video in exactly the same way for each file. If the scene changes don't happen at exactly the same time I pause both videos (because with two players running changing the audio delay doesn't seem to work unless they're paused) and then use the + or - keys to apply a bit of audio delay to the "new" video file. I then restart them both and go through the process again. When the audio of the two videos sounds like it's phasing and the scene changes in each version of the video happen at exactly the same time, then I know I've got the audio delay for the "new" video exactly right.
Once I've got the delay correct I look to see what amount of audio delay MPC-HC is displaying in it's status bar. I open the "new" version of the video again using VirtualDub or MKVToolnix etc, apply that amount of audio delay and then resave the "new" version of the video as a "newer" version.

Of course all the above assumes the original 25fps video and the 24fps video are exactly the same (aside from any initial audio delay), the only difference being the frame rate. Once you change the frame rate of the second video and add the audio from the first, if it's a match, the above method just let's you ensure you've applied the correct amount of audio delay to your newly saved MKV with the modified frame rate.

Last edited by hello_hello; 4th December 2011 at 04:54.
hello_hello is offline   Reply With Quote
Old 5th December 2011, 02:54   #9  |  Link
Lincoln Burrows
Registered User
 
Lincoln Burrows's Avatar
 
Join Date: Mar 2008
Posts: 280
hello_hello, I did it!

The NTSC video has (in the beginning, starting at 0 second) 17 seconds more than the PAL video.

a) The same frame in the NTSC video converted (24 to 25 fps): 00:59:59.974
b) The same frame in the original PAL video (25 fps): 00:59:42.665

I will try now:

1) Open the audio extracted from b) and add 17,309 (seconds);
2) Convert this audio using Audacity's option "Change runtime without changing pitch" using the -4,096% option
3) Check if 2) will sync with the original NTSC video.

Unless there's something else I should check here?

Note: I followed your advice about MKVMerge, but it should be noted the audio embedded into the MKV file didn't had the fps changed. It remained with 24 fps.
__________________
"Whoever has not known himself has known nothing. But whoever has known himself has simultaneously achieved knowledge about the depth of all things."
Lincoln Burrows is offline   Reply With Quote
Old 5th December 2011, 03:35   #10  |  Link
hello_hello
Registered User
 
Join Date: Mar 2011
Posts: 4,541
Quote:
Originally Posted by Lincoln Burrows View Post
Note: I followed your advice about MKVMerge, but it should be noted the audio embedded into the MKV file didn't had the fps changed. It remained with 24 fps.
It won't. The idea was to change the video frame rate to 25fps, delete the existing audio stream and add the one from the 25fps version (with a 17 second delay), then save it as a new MKV.
Once you've done that and you know they'll sync, you can either just keep it, or then you can convert the 25fps audio to 24fps if you'd prefer not to change the frame rate of the second video.

I generally just use the frame rate change method as then the audio doesn't have to be re-encoded to speed it up or slow it down.
hello_hello is offline   Reply With Quote
Old 5th December 2011, 04:21   #11  |  Link
Lincoln Burrows
Registered User
 
Lincoln Burrows's Avatar
 
Join Date: Mar 2008
Posts: 280
Quote:
Originally Posted by hello_hello View Post
Once you've done that and you know they'll sync, you can either just keep it, or then you can convert the 25fps audio to 24fps if you'd prefer not to change the frame rate of the second video.
You see, that's the problem here.

It seems the settings -4,096% are not working to convert this audio (with the 17 second silence inserted in the beginning) from PAL (25 fps) to NTSC (23.976).

It worked! But only in the PAL converted file from the NTSC video. But I need to convert this to NTSC, for the original NTSC source!

So it's only a matter of converting the resulted audio file from PAL to NTSC now. 25 fps > 24 fps.

The first time I heard about the -4,096% setting was in this message:

Quote:
Wow have I learned a lot in two hours.

First off, there are two NTSC versions. There is the film version which is at 23.976 fps but can sometimes be rounded up to say "24 fps" even though its really 23.976. This is what NTSC DVDs are. The other version which I guess is the TV version is 29.970 fps but can sometimes be rounded up to say "30 fps" even though its really 29.970.

-The reason putting 4.271% into audacity converts into PAL (which is 25 fps) is because it works out like this equation:

23.976 + 4.271% (1.02401496) = 25.00001496

That number is as close as you can get to exactly 25 to the thousandth of a percent. I actually worked it out and the difference between 25 and 25.00001496 in a 90 minute movie isn't even a tenth of one single frame. So the timing is only going to be off by almost literally nanoseconds from a real PAL version.

-When converting from PAL to NTSC you would use -4.096% as shown here:

25 - 4.096% (1.024) = 23.976

This one actually works out perfectly and so you would actually be more accurate if you recorded your riff in PAL and then made an NTSC version. Of course like I said, the difference is literally nanoseconds and doesn't matter one bit.

Anyways I was able to answer my own question and so I'm going to record my riff using the PAL version and then convert it to NTSC with audacity using that -4.096% number and it should be perfect. YAAAAAAAAAAAY!
Then I assumed using Audacity to change the runtime would work.

Apparently, I was wrong?

P.S. The audio file runtime (the one that worked, with the 17 seconds added) is:

Duration : 1h 51mn
Duration : 1h 51mn 59s 425ms
Duration : 1h 51mn
Duration : 01:51:59.425

The original NTSC video:

Duration : 1h 56mn
Duration : 1h 56mn 39s 51ms
Duration : 1h 56mn
Duration : 01:56:39.051

The strange thing is that MPC-HC is the only player that is reading 1h51m for the file converted using MKVMerge. All other players (and MediaInfo) are reading 1h56m (24 fps runtime). I have no idea why.
__________________
"Whoever has not known himself has known nothing. But whoever has known himself has simultaneously achieved knowledge about the depth of all things."

Last edited by Lincoln Burrows; 5th December 2011 at 04:25.
Lincoln Burrows is offline   Reply With Quote
Old 5th December 2011, 05:43   #12  |  Link
Lincoln Burrows
Registered User
 
Lincoln Burrows's Avatar
 
Join Date: Mar 2008
Posts: 280
OK, mistery solved: I had to input -4 %, the difference between 25 and 24. And not -4.096 % (25 and 23.976).

It's funny that I would make such mistake, but I can explain: I have done this before, and it worked, but the source were NTSC DVDs. In this case, it is a Blu-ray, 24 fps. I assumed it would work as well, but it would never sync using -4.096%.
__________________
"Whoever has not known himself has known nothing. But whoever has known himself has simultaneously achieved knowledge about the depth of all things."
Lincoln Burrows is offline   Reply With Quote
Old 5th December 2011, 07:15   #13  |  Link
hello_hello
Registered User
 
Join Date: Mar 2011
Posts: 4,541
Quote:
Originally Posted by Lincoln Burrows View Post
The strange thing is that MPC-HC is the only player that is reading 1h51m for the file converted using MKVMerge. All other players (and MediaInfo) are reading 1h56m (24 fps runtime). I have no idea why.
Did you keep the audio track when you changed the frame rate? If so maybe that's it as it's length won't have changed.
The frame rate is also stored in the video stream so when you remux the video you're changing the frame rate at the container level. MediaInfo should display both "frame rate" and "original frame rate" with the first being used for the duration (if the audio isn't longer).

Quote:
Originally Posted by Lincoln Burrows View Post
OK, mistery solved: I had to input -4 %, the difference between 25 and 24. And not -4.096 % (25 and 23.976).

It's funny that I would make such mistake, but I can explain: I have done this before, and it worked, but the source were NTSC DVDs. In this case, it is a Blu-ray, 24 fps. I assumed it would work as well, but it would never sync using -4.096%.
Well, if it makes you feel any better I'm happy to feel stupid with you.
You did say 24fps but you mentioned 23.976 in your original post so think I just assumed 24fps was an abbreviation in this case. I see now the MKV info you posted previously clearly says 24fps and the penny didn't drop for me then either, so I guess we get to feel silly together.
hello_hello is offline   Reply With Quote
Old 5th December 2011, 13:35   #14  |  Link
Lincoln Burrows
Registered User
 
Lincoln Burrows's Avatar
 
Join Date: Mar 2008
Posts: 280
The reason I confused 24 and 23.976 was due to the fact that 23.976 audios had no sync problems after being inserted in 24 fps videos.

That's why I assumed immediately it would work if I converted from 25 to 23.976. I was wrong. If the audio was converted to 25 fps (PAL), the only way to fix this for a Blu-ray source is to convert to 24 fps, not 23.976.

And to complicate things, I had to add 17,500 seconds that existed in the Blu-ray video, but not in the AVI (PAL) source.
__________________
"Whoever has not known himself has known nothing. But whoever has known himself has simultaneously achieved knowledge about the depth of all things."
Lincoln Burrows 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 17:05.


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