Hi everybody!
I have an .avi video file (608x272, 23.976 fps) which I want to convert to a 720x576 25 fps .m2v file to be authored with IfoEdit (muxing back with audiotracks at 25 fps, then create a PAL dvd).
I'm trying to use Avisynth+Henc since I just want to go free.
Can somebody give me some hints on how to set up properly the Avisynth script (or at least point me to some guide here on videohelp)?
Thanks.
+ Reply to Thread
Results 1 to 30 of 35
-
-
Use FitCD to make an AVS script with all the right resizing commands. Make a 23.976 fps progressive 720x576 MPEG2 file, use DgPulldown to add 23.976 -> 25 fps pulldown flags, burn as PAL DVD. This will have two little jerks every second.
If you speed the frame rate up to 25 fps you will have to speed the audio up too. -
I have managed to do the conversion, I had to modify the FitCD script a little, but it seems to work. The only thing is a jerky movement during camera pans, but it is unavoidable, isn't it?
The real issue is in the a/v sync: I tested the video and the audio (which is taken from another file) in VirtualDubMod, they appear to be in sync at the beginning but during the playback they go out of sync.
Any advice? -
Using the Pulldown method is necessary when you want to change the playback framerate without affecting audio. In your case, however, the audio comes from a different format video, so you do need to adjust the playback speed of the video to match the audio, or you will have to change the audio track to match the video.
Use the FitCD script, but include an AssumeFPS(25) statement in it, and encode for PAL 25 fps. This will actually speed up the video slightly to match the audio, and should get you back in sync.Read my blog here.
-
As for the jerky movement, since you said you modified the script, you might post it so we can see what you did. A small sample of the result - a sample showing movement - might help as well.
-
Hi to you too and thanks for helping.
I made some minor changes to the borders values.
This is the script I used for the 23fps encoding:
# -= AviSynth v2.5.8.5 script by FitCD v1.2.8 =-
AVISource("C:\Documents and Settings\User\...\video.avi")
BicubicResize(720,352,0,0,0,0,0,0)
AddBorders(0,112,0,112)
#Trim(0,3047).FadeOut(150)
(then I gave it to DGPulldown).
For the 25fps encoding I just added:
AssumeFPS(25.000, true)
after the AddBorders line.
It seems however that the sync issue exists even with the 25fps (second script) file. -
What sort of sync problem ?
The issue with taking audio from one version and video from another is you cannot be sure that the two versions come from the same source, and how they were created.
If the sync is out the same distance all the way through then it is simply a matter of adding or subtracting a delay.
If you are out progressively then you need to work out why. It could be because the original wasn't sped up from 24 fps to 25 fps, but had extra frames added. It could be because the edit is slightly different, or there are different production or distribution logos at the start.
You have some homework still to do.Read my blog here.
-
Let me tell you what I exactly did:
I took the 3 audio tracks from a DVD. This is the MediaInfo output for the two files that form the video:
----------------------------------------------------------------------------------------------------
Complete name : C:\Documents and Settings\...\VTS_01_1.VOB
Format : MPEG-PS
File size : 1 024 MiB
Duration : 25mn 10s
Overall bit rate : 5 685 Kbps
Video
ID : 224 (0xE0)
Format : MPEG Video
Format version : Version 2
Format profile : Main@Main
Format settings, Matrix : Default
Duration : 25mn 10s
Bit rate mode : Variable
Bit rate : 3 947 Kbps
Nominal bit rate : 4 800 Kbps
Width : 720 pixels
Height : 576 pixels
Display aspect ratio : 4/3
Frame rate : 25.000 fps
Standard : PAL
Colorimetry : 4:2:0
Scan type : Interlaced
Scan order : Bottom Field First
Bits/(Pixel*Frame) : 0.381
Audio #1
ID : 128 (0x80)
Format : AC-3
Format/Info : Audio Coding 3
Duration : 25mn 10s
Bit rate mode : Constant
Bit rate : 448 Kbps
Channel(s) : 2 channels
Channel positions : L R
Sampling rate : 48.0 KHz
Audio #2
ID : 129 (0x81)
Format : AC-3
Format/Info : Audio Coding 3
Duration : 25mn 10s
Bit rate mode : Constant
Bit rate : 448 Kbps
Channel(s) : 2 channels
Channel positions : L R
Sampling rate : 48.0 KHz
Audio #3
ID : 130 (0x82)
Format : AC-3
Format/Info : Audio Coding 3
Duration : 25mn 10s
Bit rate mode : Constant
Bit rate : 448 Kbps
Channel(s) : 2 channels
Channel positions : L R
Sampling rate : 48.0 KHz
Menu
Format : DVD-Video
-----------------------------------------------------------------------------------------------------
Complete name : C:\Documents and Settings\...\VTS_01_2.VOB
Format : MPEG-PS
File size : 693 MiB
Duration : 17mn 27s
Overall bit rate : 5 548 Kbps
Video
ID : 224 (0xE0)
Format : MPEG Video
Format version : Version 2
Format profile : Main@Main
Format settings, Matrix : Default
Duration : 17mn 27s
Bit rate mode : Variable
Bit rate : 3 819 Kbps
Nominal bit rate : 4 800 Kbps
Width : 720 pixels
Height : 576 pixels
Display aspect ratio : 4/3
Frame rate : 25.000 fps
Standard : PAL
Colorimetry : 4:2:0
Scan type : Interlaced
Scan order : Bottom Field First
Bits/(Pixel*Frame) : 0.368
Audio #1
ID : 128 (0x80)
Format : AC-3
Format/Info : Audio Coding 3
Duration : 17mn 27s
Bit rate mode : Constant
Bit rate : 448 Kbps
Channel(s) : 2 channels
Channel positions : L R
Sampling rate : 48.0 KHz
Video delay : -480ms
Audio #2
ID : 129 (0x81)
Format : AC-3
Format/Info : Audio Coding 3
Duration : 17mn 27s
Bit rate mode : Constant
Bit rate : 448 Kbps
Channel(s) : 2 channels
Channel positions : L R
Sampling rate : 48.0 KHz
Video delay : -480ms
Audio #3
ID : 130 (0x82)
Format : AC-3
Format/Info : Audio Coding 3
Duration : 17mn 27s
Bit rate mode : Constant
Bit rate : 448 Kbps
Channel(s) : 2 channels
Channel positions : L R
Sampling rate : 48.0 KHz
Video delay : -480ms
Menu
Format : DVD-Video
--------------------------------------------------------------------------------------------------------
This is the output for the avi I took the video from:
--------------------------------------------------------------------------------------------------------
Complete name : C:\Documents and Settings\...\video.avi
Format : AVI
Format/Info : Audio Video Interleave
File size : 664 MiB
Duration : 42mn 41s
Overall bit rate : 2 174 Kbps
Writing application : VirtualDubMod 1.5.4.1 (build 2066/release)
Writing library : VirtualDubMod build 2066/release
Video
Format : MPEG-4 Visual
Format settings, BVOP : Yes
Format settings, QPel : No
Format settings, GMC : 2 warppoints
Format settings, Matrix : Default
Muxing mode : Packed bitstream
Codec ID : DX50
Codec ID/Hint : DivX 5
Duration : 42mn 41s
Bit rate : 1 741 Kbps
Width : 608 pixels
Height : 272 pixels
Display aspect ratio : 2.25
Frame rate : 23.976 fps
Resolution : 24 bits
Colorimetry : 4:2:0
Scan type : Progressive
Bits/(Pixel*Frame) : 0.439
Stream size : 531 MiB (80%)
Writing library : DivX 5.1.0 (UTC 2003-09-02)
Audio #1
Format : MPEG Audio
Format version : Version 1
Format profile : Layer 3
Codec ID : 55
Codec ID/Hint : MP3
Duration : 42mn 41s
Bit rate mode : Constant
Bit rate : 160 Kbps
Channel(s) : 2 channels
Sampling rate : 48.0 KHz
Resolution : 16 bits
Video delay : 24ms
Stream size : 48.8 MiB (7%)
Alignment : Aligned on interleaves
Interleave, duration : 42 ms (1.00 video frame)
Interleave, preload duration : 504 ms
Audio #2
Format : MPEG Audio
Format version : Version 1
Format profile : Layer 3
Codec ID : 55
Codec ID/Hint : MP3
Duration : 42mn 29s
Bit rate mode : Constant
Bit rate : 128 Kbps
Channel(s) : 2 channels
Sampling rate : 48.0 KHz
Resolution : 16 bits
Video delay : 4ms
Stream size : 38.9 MiB (6%)
Alignment : Split accross interleaves
Interleave, duration : 42 ms (1.00 video frame)
Interleave, preload duration : 500 ms
Audio #3
Format : MPEG Audio
Format version : Version 1
Format profile : Layer 3
Codec ID : 55
Codec ID/Hint : MP3
Duration : 42mn 26s
Bit rate mode : Constant
Bit rate : 128 Kbps
Channel(s) : 2 channels
Sampling rate : 48.0 KHz
Resolution : 16 bits
Video delay : 20ms
Stream size : 38.9 MiB (6%)
Alignment : Split accross interleaves
Interleave, duration : 42 ms (1.01 video frame)
Interleave, preload duration : 500 ms
-----------------------------------------------------------------------------------------
The edit is the same and there is no logo at the beginning.
When I test the encoded file with the audio they seems to be in sync at the start but progressively they go out.
I'm trying to fix it in VirtualDubMod saving the audio one portion at a time and then resync the rest changing the delay but is a PITA. -
There is something screwy going on.
The PAL version has a running time of 42 minutes 37 second, at 25 fps.
The NTSC version has a running time of 42 minutes 41 seconds, at 23.976 fps.
The NTSC version is only 4 seconds longer. If the edits are the same then the NTSC version should run 44 minutes 26 seconds (approx).
Add to the fun that all three NTSC audio tracks run at different lengths.
If these videos have exactly the same edit, then you should find that the PAL audio, and the NTSC video match up almost exactly without conversion.Read my blog here.
-
Uhm, I see your point.
I don't know where the trick is.
BTW, the segment-by-segment method doesn't work. -
Yeah, with the PAL version about the same length as the NTSC version, it looks as if the PAL version may be field blended from being created from the NTSC master, with the only differences being (perhaps) the logo(s) shown before the video starts, the credits at the end, or the amount of black frames at the beginning and/or end. Among other things, this means you don't need the AssumeFPS line. And, personally, I'd handle the audio outside of AviSynth.
As for the jerkiness, it wasn't created by the script so it's either from the source AVI or from the encode.
Is the PAL version really about the same length as the NTSC version? If so, what's this represent:
Duration : 25mn 10s
This kind of begs the question, though, and that's why mess with the NTSC AVI version at all, if you have a working PAL AVI (and DVD?) version? Is that 25fps AVI so bad? -
Thanks, I had it all wrong there. But the other question still stands (unless I messed up something there as well), and that's why is he messing with an NTSC derived 23.976fps AVI at all if he also has a PAL derived 25fps AVI (and a PAL DVD?) source to use? Is he switching or adding languages that the PAL one doesn't have? Is there something wrong with the PAL video?
-
I see I have to be more clear.
This is the story: I have this PAL DVD with a series of anime episodes, two of them have the video screwed up (maybe for a NTSC-PAL conversion not done properly). I have this two episodes in avi format but they are 608x272 23.976fps. The idea was to take the 25fps audio tracks from the DVD (which are better than the audio tracks from the avi) and the video from the avi files, re-encode to PAL DVD standard, remux with the audiotracks and replace the messy episodes in the original DVD structure (in order to keep menus etc...).
But now I am not able to perfectly match the video and audio to keep them in sync for the entire running time.
Now I'm gonna try to work the audio with Audacity and see if it works. -
Unless there's something really bad about the audio in the 23.976fps AVIs, it sounds to me like it would a heck of a lot easier to just use the audio from the AVI, converting it to AC3 audio if it's MP3. It'll save you beating your head against a wall trying to get the audio from the PAL DVD to fit.
Either that or reencode the bad PAL video. If you have a small sample you'd like to upload somewhere, we can tell you if it can be fixed. -
Thanks manono for your advice but I've worked the audio from the DVD with Audacity (stretched it of about 2 sec), then tested it with the video and they appear in sync (at least at an acceptable degree) so I think I'm going that way.
Maybe I'm missing something but shouldn't I to speed up the audio (23.976->25fps) in your scenario ?
Because if that is the case the speed change is clearly audible (I've tested it).
One thing I don't get is why the 23.976fps avi has almost the same running time of the 25fps audio from the DVD.
Anyway, now I'm gonna put my hands on the other episode, hoping everything works fine. -
Originally Posted by Instant Martian
Originally Posted by Instant Martian
And as I mentioned before, to be sure of what was done to create that PAL DVD a sample would be needed. -
Not knowing what hardware the OP has, my way would be play it on a Philips dvd player and set output to PAL, and record onto a dvd recorder or even capture to a computer.
Why is it I find all the solutions to ntsc<>pal so complicated?PAL/NTSC problem solver.
USED TO BE A UK Equipment owner., NOW FINISHED WITH VHS CONVERSIONS-THANKS -
Some of the information on this guide may help you with PAL>NTSC and NTSC>PAL work. In this exact case, not all of it will apply, but some of the basic concepts should help you understand the process better, with some suggestions on software that can achieve your goals.
Guide at http://www.digitalfaq.com/dvdguides/convert/standards/standards.htmWant my help? Ask here! (not via PM!)
FAQs: Best Blank Discs • Best TBCs • Best VCRs for capture • Restore VHS -
Thanks to all of you guys for your time!
Originally Posted by jagabo
Originally Posted by manono
Originally Posted by lordsmurf -
Originally Posted by Instant Martian
Interlaced PAL TV runs at 50 fields per second, NTSC at 59.94 fields per second. There are no frames in the analog interlaced signal -- it's always a series of fields. You see only one field at a time on an interlaced TV screen. Each frame of digital video has to be sent to the TV as a series of fields. Each frame consists of two fields, all the even numbered scanlines in one field, all the odd numbered scanlines in the other. The signal always atlernates between even and odd fields. Pulldown flags tell the DVD player how to output the fields from the frames.
Pulldown flags are most often used to display 23.976 frame per second video as 59.94 fields per second for TV. 3:2 pulldown is the usual pattern. Half the frames are displayed for 3 fields, half for 2 fields. The result is an average of 2.5 fields per frame. 23.976 * 2.5 = 59.94.
film frames: 1 2 3 4...
3:2 pulldown: 1e 1o 1e 2o 2e 3o 3e 3o 4e 4o
The end result is 59.94 fields per second with exactly the same running time as the original 23.976 frames per second video. This is comparable to increasing the frame rate by displaying frames faster but duplicating occasional frames (1 out of every 4 for 23.976 to 29.97 fps). Except fields are duplicated not frames. The result less obvious jerks from the duplicates.
When using pulldown flags to display 23.976 frame per second video at 50 fields per second an extra frame worth of video has to be created every second (plus 1 extra frame every 1000 frames to make up for the difference between 23.976 and 24 fps). This is done by sending one extra field every 12 frames.
first 12 frames: 1 2 3 4 5 6 7 8 9 10 11 12
pulldown: 1e 1o 2e 2o 3e 3o 4e 4o 5e 5o 6e 6o 7e 7o 8e 8o 9e 9o 10e 10o 11e 11o 12e 12o 12e
second 12 frames: 13 14 15 16 17 18 19 20 21 22 23 24
pulldown 13o 13e 14o 14e 15o 15e 16o 16e 17o 17e 18o 18e 19o 19e 20o 20e 21o 21e 22o 22e 23o 23e 24o 24e 24o
The end result is that 23.976 frames per second is displayed as 50 fields per second without changing the running time. -
It's a little technical
The bad news is that the method that worked for the first episode doesn't for the second one.
I can't get the sync, even with the audio from the same avi I took the video from -
Originally Posted by Instant Martian
There are basically two ways you can change frame rate:
1) Simply display each frame for a longer or shorter period of time. The video will play smoothly but the running time will change. For example, if you simply flip through a 24 fps video at 25 fps the running time will be shorter by 4 percent.
2) Display each frame for a longer or shorter period of time but remove or duplicate frames to maintain the same running time. For example, you flip through a 24 fps video at 25 fps but display every 24 frame twice. The overall running time is the same but you get a little jerk every second.
With video you can do these on a field basis rather than a frame basis.
Your problem isn't one of simple frame rate conversion. You have files of unknown and questionable pedigree. So there's no way of knowing how they were mistreated previously.
Similar Threads
-
when Pal dvd has correct Ntsc audio (Pal>Ntsc conver)
By spiritgumm in forum Video ConversionReplies: 15Last Post: 13th Oct 2011, 12:57 -
Cant convert Pal .AVI to NTSC DVD in Avidemux
By Hittz in forum Video ConversionReplies: 6Last Post: 5th Nov 2009, 07:43 -
Can AutoGK convert PAL Region 3 dvd to NTSC .avi?
By bloomcounty in forum Video ConversionReplies: 14Last Post: 20th Nov 2008, 19:31 -
Sound popping after converting PAL AVI to NTSC DVD using DVDFlick
By embreeb in forum Video ConversionReplies: 3Last Post: 25th Sep 2007, 10:46 -
Best point at which to Convert?? (NTSC AVI to PAL DVD)
By junk in forum Video ConversionReplies: 3Last Post: 28th Jun 2007, 16:15