PDA

View Full Version : NTSC <-> PAL framerate conversions


Frodo
2003-12-29, 17:28
hi all,

we probably all know that ntsc encoded movies are choppy when viewed on a pal box and vice versa
problem is that ntsc movies are encoded in framerates like 23.97fps or 29.978 fps while pal is 25.0 fps
this means that frames must be skipped/duplicated which results in choppy/jerky playback

however, what if we play a movie faster/slower to match the 25.0fps

take for example a 23.97fps movie. if we play this 25/23.97 times faster then normal, so at 1.0429x then its excactly 25.0 fps and should play perfectly smooth.
same for 29.97fps if we play that 25/29.97 at 0.83394x its 25.0 fps

sure the movie plays back a bit faster or slower, but would anybody notice this? i dont think so

anyway let me know your thoughts about this
if more ppl think this is a nice idea i can implement it in xbmc
frodo


frodo

kraqh3d
2003-12-29, 18:04
could this be made optional so we can play around with both modes to compare them?

Nickman
2003-12-29, 19:07
however, what if we play a movie faster/slower to match the 25.0fps

take for example a 23.97fps movie. if we play this 25/23.97 times faster then normal, so at 1.0429x then its excactly 25.0 fps and should play perfectly smooth.
hehe. should work. the japanese have this system in some dvd players. but not to get around the ntsc/pal issue. just to save time. :d

so how can millions o japanese be wrong :) go for it!

zilvershadow
2003-12-29, 19:27
what about the audio stream?
isn't that going to get out of sync?

Frodo
2003-12-29, 19:34
i added the option to xbmc
you can disable/enable it under settings->screen with the
'adj. framerate' button

(remember you gotta restart the movie b4 when changing this setting)

i tried several 23.97fps movies on my pal box and with this option enabled they play much smoother then before.

the movie plays a bit faster then normal (1.042x),
but i dont notice it.

frodo

Frodo
2003-12-29, 19:39
dont forget to disable pal60;-)

frodo

zordon
2003-12-30, 02:06
whats the harm in adding it if it can be disabled. personally, i would prefer to user this option, hey with the movie playing faster it give me more time for other stuff:-)

AlCapone
2003-12-30, 02:59
i would like to suggest this behavior:

when attempting to play 29,97 fps movie on an 25fps system player should say:

---------------------------
you are about to play an ntsc (xx.xfps) movie in pal (25fps) mode would you like to:

a - play as usual (leave me alone)
x - switch to ntsc mode
y - play this movie at ntsc speed in pal mode.
---------------------------

this would make "everybody" happy- of course - this dialog box should also handle user playing pal on ntsc system.

tslayer
2003-12-30, 07:13
alcapone,

i think the current way is fine. having an extra popup is a pain. i would just like to click on a movie and have it play right away.

why would you decide that some should be left alone and some should not be? i think most people would be comfortable with the current way of setting the option.

just my 2 cents.

ts

MrMario64
2003-12-30, 12:17
this indeed works mighty fine.
super smooth playback. http://www.xboxmediaplayer.de/forums/non-cgi/emoticons/wow.gif

AlCapone
2003-12-30, 12:26
btw: what version are you testing ?
the most recent i found was "xbox_media_center_2003-12-11_build-ind" (cvs)

Frodo
2003-12-30, 12:30
i'm always reffering to the latest source
which i compile myself.

frodo

AlCapone
2003-12-30, 13:07
then i must wait will some nice person compile & publish it :)

hint hint :)

burriko
2003-12-30, 16:07
this is a very cool feature, and works brilliantly.
the pitch of the audio is also increased slightly when speeding up the video (which is also the case for most pal dvds , most people don't tend to notice though). so if there's a us tv series or something that you watch regularly on xbmc don't be surprised if you notice the character's voices are now a bit higher with this option enabled. :)

alexh
2003-12-31, 02:35
scary, i asked this very question (http://forums.xbox-scene.com/index.php?act=st&f=62&t=141410&hl=&s=800bd5a1c88b9a05db3ce5a9eaf282c5) weeks ago on xbox-scene and got no replies. damn i wish i'd known to come here :)

cheers to whoever did the fix.

alex

Troed
2003-12-31, 12:40
hi frodo, it's been a while.

going from 24 fps (film) to 25 (pal) by playing the movie faster and pitching the audio is the standard way of doing a film->pal conversion. it's done in theaters in europe.

going from 29.97 (ntsc) to 25 (pal) is done using a technique called inverse 3:2 pulldown.

http://www.dvdfile.com/news....own.htm (http://www.dvdfile.com/news/special_report/production_a_z/3_2_pulldown.htm)

i knew of the jerky problems in xbmp - and i must confess i was surprised to learn that you used none of these techniques already ;)

so, yes - this is a good change for 24->25. it's not good for 29.97->25 - look into the method described above instead. don't the libraries you use implement these techniques?

SpacemanX
2003-12-31, 12:53
thanks for the developers for their dedication.

99.5% of the pal movie dvd's use the 24->25fps conversion. that's the reason they are a bit shorter than their ntsc counterparts.

30->25fps conversion is too noticeable, but the pal60 should handle that. the great majority of the pal tv sets are capable of handling the 60hz mode.

so to the make it short the default behaviour should be:
24->25 = perfect, the best possible way to do this
30->25 = no use, switch xbox to pal60 instead

edit: fixed errors and typos. :)

Frodo
2003-12-31, 13:15
yeah i saw that 30->25 is too noticable so i disabled that
it only works for 24<->25 @ the moment

however i'll look into this inverse 3:2 pulldown thing
pretty sure mplayer has a filter supporting this,
ifso i just need 2 enable it

frodo

Troed
2003-12-31, 15:59
(i realised that some of the readers might get confused when i talk about inversed 3:2 pulldown but link to how the original 3:2 pulldown is performed - so here's a link to the actual inversion .. http://www.lukesvideo.com/telecining2.html )

kraqh3d
2003-12-31, 17:09
techincally, ivtc is not used to go from 29.97 to 25 fps. it's used to go from 29.97 to 24 fps in order to restore the original film framerate. i'll spare the gorey details since troed posted a very nice tutorial on 3:2 pulldown and itvc, but once the original 24fps are restored, you should be able to play it back at 25fps using the current method of speeding up the video.

for 24fps to 30fps, you should use the correct 3:2 pulldown method even though it results in some jaggies.

i'm not sure what's the correct way to get from 25->30. you could use the 25->24 conversion and then use 3:2 pulldown. or just repeat every 5th frame to get up to 30fps which is similar to what progressive scan dvd players do (but in a different pattern).

a progressive scan dvd player first uses itvc to restore the orignial 24fps film. the frames are then repeated in a 3:2 pattern, pushing the framerate up to 60 fps for progressive output. it's not perfectly smooth since each film frame is not displayed for an identical time (3/60,2/60,3/60,2/60,etc.) but it gets rid of the jaggies.

Troed
2003-12-31, 18:34
kraqh3d: ouch that's right - in my head i did the 29.97->24->25 chain but looking back i didn't write it out. thanks for correcting me :)

SpacemanX
2003-12-31, 18:39
pal is nice... :)

for euro users i see the following conversions needed:


30hz->25hz

far most direct way is not to do the conversion at all, but to switch the xbox to 60hz mode. also this provides the best possible end result. if the tv-companies are not able to do decent conversions off-line why use time to trying to fix this?

if switching is not possible the current method is good enough i.e. skipping every sixth field.

also it will be hard to know when to use inverse telecine and when the material is native 30fps. dvd players can always read the flags from the stream, but as far i know most of mpeg4 streams do not have these flags.

most 30fps mpeg4 content i have come across is native ntsc stuff i.e. tv series. ivtc cannot be used on these.


24->25fps

speeding up is absolutely the best way to deal with this.

(worst way is to telecine to ntsc and the convert to pal without inverse telecining. i have seen these too...)


30->24->25 (inverse telecining + speeding up)

i see this worthwhile for ntsc dvd playback. as most of the mpeg4 streams are ivtcd already it does not seem worth the effort for these only.

kraqh3d
2003-12-31, 21:46
no prob troed...

spacemanx is right. ivtc is probably not the right solution. it will only work in some situations. dvd players are able to read the flags in the mpeg2 stream and act accordingly. i dont believe this method will work if those flags are not available, like in the case of tv captures.

and yeah, you euro folks have it good. your tv's support both 50 and 60 fps. our crappy us tv's dont :(

here are the four conversions which would be necessary...

24->25: i cant test this myself, but everyone else seems to be happy with just speeding up the video

30->25: if the xbox can switch the output on the fly to pal60, then thats the way to go. (what was the previous method - dropping every 6th frame to reduce the framerate to 25 fps?)

24->30: a 3:2 pulldown method can be used but it would mean that the video frames would need to be split into fields first. if mplayer supports this, it would be a the right way.

25->30: this is the tough one. just duplicating every 5th frame would probably be ok. whatever is used should be the inverse of the 30->25 if switching to pal60 isnt an option.

nanite1000
2004-01-04, 18:26
hi,
i have pal xbox with pal tv (cabable of pal60)
subtitles becomes too early and the offsync raises while watching the movie.
when turning frame adj. off and pal60 on, the subtitles works fine.
i have 2 other avi files with subtitles at the moment and with these the subs works just fine with framerat adj on pla60 off. those files have the same fps 23.976! strange...
with y-button info the framerate is diffrent between these 3 files.
ac3 passtrough is on and have optical spdif cable to amp.
here are the info from gspot, first the faulty one, then the two that works:
using xbmc build 2004-1-2

subs offsync:
filename: underworld.dvdrip.cd1.xvid-deity.avi
stat: file length correct (click for more info...)
video 4cc: xvid codec name: xvid
ratio: 640x272 (2.35:1) [=40:17]
fps: 23.976 * duration: 00:59:12 (85,173 fr)
interleave: 1 vid frame (42 ms) *split: yes *imrr: 1.00 qf: 0.287 bits/pixel
audiocodec: ac3 (0x2000) dolby laboratories, inc
audiobitrate: 448 kb/s (5 ch) cbr *freq: 48000 hz
subfile: .sub
xbox y-button shows: 24 fps (+- 0.20, mostly stays at 24)
start: 720x576 pal 16:9

subs in sync:
filename: once.upon.a.time.in.mexico.dvdrip.xvid.avi
stat: file length correct (click for more info...)
video 4cc: xvid codec name: xvid
ratio: 544x304 (1.79:1) [=34:19]
fps: 23.976 * duration: 01:41:45 (146,374 fr)
interleave: 1 vid frame (42 ms), p=480 *split: no *imrr: 1.00 qf: 0.208 bits/pixel
audiocodec: 0x0055(mp3) id'd as mpeg-1 layer 3
audiobitrate: 129 kb/s (64/ch, stereo) vbr lame3.90 freq: 48000 hz
subfile: .srt
xbox y-button shows: about 25 fps (24.6 - 25, mostly stays at 25)
start: 720x576 pal 16:9

subs in sync:
filename: ghost.in.the.shell.stand.alone.complex.25.[jap.raw].avi
stat: file length correct (click for more info...)
video 4cc: dx50/divx codec name: divx 5.0
ratio: 640x352 (1.82:1) [=20:11]
fps: 23.976 * duration: 00:24:30 (35,246 fr)
interleave: 1 vid frame (42 ms) *split: yes *imrr: 1.00 qf: 0.198 bits/pixel
audiocodec: 0x0055(mp3) id'd as mpeg-1 layer 3
audiobitrate: 160 kb/s (80/ch, stereo) cbr *freq: 48000 hz
subfile: .smi * .ssa worked too
xbox y-button shows: about 30 fps (+-0.25)
start: 720x576 pal 16:9

Gamester17
2004-01-05, 16:17
have you guys looked into ogo's reclock directshow filter (http://ogo.nerim.net/reclockfilter/) code?, maybe it could give you some ideas, or use all it's code?

MiqueFlesh
2004-01-05, 18:32
is it possible to speed up the sub's so i don't have to convert them to 25 fps every time ?

Butcher
2004-01-07, 15:29
no prob troed...
25->30: this is the tough one. just duplicating every 5th frame would probably be ok. whatever is used should be the inverse of the 30->25 if switching to pal60 isnt an option.
for the 30->25 and 25->30 conversion, you could try alpha blending the frames to try and aproximate the correct speed. i have no idea if this would look any good or not though.

sergej
2004-01-09, 12:23
what format is the subtitle format of the movie with the problem you are referring to? if it's vobsub (.sub and .idx file) it wouldn't make too much sense, because it's timecode-based as your working formats are (at least srt and ssa, not 100% sure about smi). however if it's just a txt-based .sub file (microdvd format), it would make sense indeed. microdvd format is framecode-based, so if you adjust the framerate of the movie, the framerate of the subs also have to be changed. as temporary solution you could try a subtitle tool like: http://www.divx-digest.com/software/subtitle_fps_convert.html
and change the fps to 25.
if this works, it would be nice of course if xbmc could do that on the fly :)

let us know how it goes.

StoneRoses
2004-02-04, 20:34
i asked for this feature on xbmp forum about a year ago, thanks dev team for this feature.

http://www.xboxmediaplayer.de/cgi-bin....neroses (http://www.xboxmediaplayer.de/cgi-bin/ib31/ikonboard.cgi?act=st;f=1;t=2619;hl=stoneroses)

let's summarize:


case 1. 29.97fps video (standard ntsc)
1.1 playback on ntsc box
just play it as is

1.2 playback on pal box
switch to pal60 and play it (if pal60 is available) or

do ivtc (inverse telecine or inverse 3:2 pulldown) to convert it to 23.976fps and speed up to 25fps (this will achieve smooth playback if the source video is 3:2 pulldown (telecine from film) but a bit jerky if the source is standard ntsc



case 2. 25fps video (standard pal)
2.1 playback on ntsc box
slowdown to 23.976fps and do 3:2 pulldown to go up to 29.97fps (quite complicate but this is the best way to go)

2.2 playback on pal box
just play it



case 3. 23.976fps video (ntsc film mode)
3.1 playback on ntsc box
do 3:2 pulldown to convert from 23.976

3.2 playback on pal box
speed up playback 23.976->25fps or

do 3:2 pulldown and switch to pal60 (prefered method if available)


please note: above methods is the correct ways to do framerate conversion in broadcast industry.