logo Sign In

Converting PAL (H264) to NTSC

Author
Time
This is kind of following on from some of the points which came up in DarkJedi's "Howard The Duck" thread, which I felt could do with branching off to this forum so as they don't get lost in 'the mysts of time' as it were. I'm still

working my way through some of this, running into a few problems, but my thinking is that ultimately, it appears they 'we' in Europe seem to be getting better versions of US films in High Def, thanks to SkyHD and Premiere in Germany.

The only problem is of course the speed of these films.

As I understand it, the process should run as follows:

- H264 & Ac3 Transport Stream.ts
- Trim, if necessary with Transport Stream Packet Editor
- Demux using xport
- rename demuxedaudio.mpa to demuxedaudio.ac3
- fix issues with audio stream using ac3fix
- slow down audio to 23.976fps*
- Using an AVISynth Script, slow down, crop, resize your HD Video was needed
- Encode via your AVS file or from a intermediate AVI file to the format of your choice
- Remux audio with video either during DVD authoring or to a standalone file


A couple of points that have come up:

- You may wish to use NTSC audio from a DVD release, in which case you may have sync issues to correct
- Moth3r has suggested using AVC2AVI_mod to wrap you H264 video within an AVI container, although I couldn't get this to work.

*I have read that the trick with the audio is to run the AC3 through BeLight / BeSweet and under advanced settings, set the framerate from 25000 to 23976, but so far this has been unsuccessful. Not being an 'audio-head' I could do with some help on this part.

Disclaimer

This guide is intended to help people preserve content, like 'Howard the Duck' and 'Monster Squad'. Obviously normal OT.com rules apply when discussing such things, so please tread carefully.

Thanks to Dark Jedi, Moth3r and anyone else I've forgotton so far.

Save London’s Curzon Soho Cinema

Author
Time
It's useful to have the relevant information here for future reference, thanks.

Couple of additional notes, bearing in mind that we are all still learning these methods (I hadn't attempted an H.264 conversion before DJ asked me for help, so most of this is based on my experiences with the sample he sent me).

The reason for using the xport Transport Stream Demuxer (http://www.w6rz.net/xport.zip) is that it will start the video from the first key frame, and trim the audio to match. This alleviates the need for trial-and-error to obtain an audio delay when re-muxing your converted video.

Reading AVC (H.264) streams into AVISynth:

There are two mechanisms by which AVISynth can read H.264-encoded files: DirectShow or Video for Windows (VfW).

To use DirectShow, you must have a DirectShow decoding filter present on your system, for example, the Cyberlink H264 decoder that is included with PowerDVD 7. If you can play H264 files in Windows Media Player, then you should be able to read them in AVISynth. It's also recommended that you use AVISynth 2.5.7 or later, because the DirectShowSource() code was improved in this version.

I found that the output from the AVS script was the wrong length (too long, because some of the video was repeated at the end). I don't know why this happened, but a possible workaround is to use the framecount option in DSS, i.e. DirectShowSource("file", framecount=123456).

The alternative is to put the H264 stream into an AVI file using avc2avi_mod (http://sourceforge.net/projects/avc2avi). In order for AVISynth to read the file using AVISource() you will need an VfW H.264 decoder. I used ffdshow; you need to go into the configuration and enable H.264 decoding (libavcodec).

Guidelines for post content and general behaviour: read announcement here

Max. allowable image sizes in signatures: reminder here

Author
Time
I'm still intending to update this with a more detailed explanation, but in the meantime, what is the best way to convert a 25fps WAV file to a 23.976fps WAV file. Using Besweet seems to introduce a choppiness to the file.

A step my step guide for muppets like myself would be great at this point!!

Cheers

Save London’s Curzon Soho Cinema

Author
Time
Did you want to keep the same pitch (timestretch), or just change the playback rate? The latter is easier, and less likely to produce any artefacts - also if the audio was originally sped up to sync with 25fps then slowing it down will restore the correct pitch.

I've found the SoundTouch program is an easy way to change audio speed, and I haven't noticed any choppiness.

A simple command line is all you need:

soundstretch input.wav output.wav -rate=-4.096

Guidelines for post content and general behaviour: read announcement here

Max. allowable image sizes in signatures: reminder here

Author
Time
Hi Moth3r,

You're obviously correct - I want to do what you said! Slow down the audio, so it runs at the correct speed rather than time stretch it so it fits the slower and therefore longer video.

I notice that BeLight / BeSweet has Soundtouch / stretch built in, so I adjusted the rate to the figure you listed, but it now seems to be too slow.

How did you calculate that rate in the first place? I'm assuming it is something to do with the 4% speed difference, but other than that...

Annoyingly I had got the audio to be in sync, yet choppy, but now when I mux there various versions in Scenarist, none of them work anymore.

Conceivably, I can go back to my 'trimmed' transport stream, which I do believe I trimmed to start on the first I-Frame. From there I can demux the ac3, fix the ac3, convert the ac3 to a wav, trim the first 23 frames off the front which I have done within the encoder when I've converted the footage as it seemed to be 'grey', and then re-ac3 back out to author with.

Must. Keep. Going.

Save London’s Curzon Soho Cinema

Author
Time
Originally posted by: DVD-BOY
I notice that BeLight / BeSweet has Soundtouch / stretch built in, so I adjusted the rate to the figure you listed, but it now seems to be too slow. Are you sure you're using the -soundtouch(..) switches? BeSweet also has another way to change the rate, using the -ota(..) switches. I don't know the difference between the two methods.
Originally posted by: DVD-BOY
How did you calculate that rate in the first place? I'm assuming it is something to do with the 4% speed difference, but other than that...
23.976/25 x 100% = 95.904%

This is a slowdown of 4.096%.

Guidelines for post content and general behaviour: read announcement here

Max. allowable image sizes in signatures: reminder here

Author
Time
Probably worth mentioning that there is now a third way to read AVC streams into AviSynth. The author of DGIndex/MPEG2Source() has released DGAVCIndex/AVCSource().

http://forum.doom9.org/showthread.php?t=122598

Guidelines for post content and general behaviour: read announcement here

Max. allowable image sizes in signatures: reminder here

Author
Time
Hey guys, the correct way how to do it in besweet is

besweet -core( -input "inputfile" -output "outputfile" ) -soundtouch( -r 25000 23976 )

Of course replace inputfile and outputfile with the correct names, and the correct framerates - in this case it "converts" sound from 25fps to 23.976fps.