PDA

View Full Version : From DVD (PAL, interlaced) to Youtube


ernstblaauw
10th December 2007, 10:14
Hi all,

For some promotional stuff of my sports club, I want to upload some parts of home-made DVD's to Youtube. Those DVD's are encoded in PAL and are interlaced; Youtube advices to upload progressive 30fps.

Therefore, I want to convert my DVD's to 30 fps progressive. I think I first need to deinterlace and after that change the framerate to 30. Is this correct? Or do I first need to change the framerate, and after that deinterlace?

Until now, I used the following script:
LeakKernelDeint(1)
ChangeFPS(29.97)
This does not produce very satisfactory results: every 4th and 5th frame are the same. Is it possible to produce more fluent results? I would really love to know, but I didn't found any topics/websites about this one.
Thanks for all your help (or at least reading this ;))!

ajk
10th December 2007, 10:40
I suggest not using 30fps, the bitrate YouTube allows is rather low. I have achieved good results by simply doing a SelectEvery(3,0) after a bob(), this leads to 16.7 frames per second and much clearer image quality. If you want to go a bit further, you can also encode the flash video yourself and achieve a higher bitrate in addition, see this thread here (http://forum.videohelp.com/topic336882.html#1752103).

Here is something I uploaded earlier (http://www.youtube.com/watch?v=k891ubOmrkw) as a test, this is from a video game but it works rather well with any kind of material. Of course you don't have the motion as smooth as 30fps would allow, but personally for me the difference in image quality is worth it. One drawback is that the duration will be wrong, that clip is only about 4 minutes in length even though it says 11 on there.

Even if you do decide to keep the motion smoother, it's still probably worth doing the encoding yourself and sticking to 25 fps rather than trying to get exactly 30; I have never managed good results if you let YouTube encode the video, no matter what the uploaded source file is like.

2Bdecided
10th December 2007, 12:24
You don't need to get up to 30fps for YouTube - that's just the limit. It'll happily keep 25fps at 25fps.

video=mpeg2source("whatever.d2v")
audio=mpaSource("whatever.mp2")

audiodub(video,audio)

crop(8,0,704,576)

converttorgb(interlaced=true)

separatefields()

selectevery(2,0)

bicubicresize(320,240)


That's it. The converttoRGB is kind of optional.


If there is a lot of movement or difficult-to-encode stuff in the video, ajk's 50/3 rather than 50/2 frame rate may help keep the artefacts down, at the expense or a more stuttery look.

Cheers,
David.

pandy
10th December 2007, 12:40
Hi all,
Until now, I used the following script:
LeakKernelDeint(1)
ChangeFPS(29.97)


to be onest 29.97 is not exactly NTSC frame rate - frame should be 30000/1001 ie 29,97002997002997002997002997003...

ernstblaauw
10th December 2007, 14:48
You don't need to get up to 30fps for YouTube - that's just the limit. It'll happily keep 25fps at 25fps.

Cheers,
David.
Ok, I'll try that. I tought it 30 fps was the best setting after reading this page (http://www.google.com/support/youtube/bin/answer.py?answer=55745&topic=10526). I will not alter the framerate and see what happens.

I suggest not using 30fps, the bitrate YouTube allows is rather low. I have achieved good results by simply doing a SelectEvery(3,0) after a bob(), this leads to 16.7 frames per second and much clearer image quality. If you want to go a bit further, you can also encode the flash video yourself and achieve a higher bitrate in addition, see this thread here.
I'm going to try this one. I wil use the ffdshow encoder for FLV1, and see what happens.

Thanks for your help!

ernstblaauw
10th December 2007, 17:22
I've uploaded a video to Youtube which I converted by hand to .flv. What do you think of it?
The movie can be found here (http://www.youtube.com/watch?v=2VDAU6FSZCA&eurl=http://www.ernstblaauw.nl/2007/12/10/jeugdkamp-2006/).

2Bdecided
10th December 2007, 18:00
I think the aspect ratio is wrong.

ernstblaauw
11th December 2007, 00:09
I think the aspect ratio is wrong.

That could be the case. My AviSynth script looks like:
Crop(24, 54, -24, -54)
lanczos4resize(320,240)
So, I'm first cropping to 4:3 and then resizing. Should I remove the 'Crop'? (Or at least do not change the width/height ratio?)

Sagekilla
11th December 2007, 04:12
That could be the case. My AviSynth script looks like:
Crop(24, 54, -24, -54)
lanczos4resize(320,240)
So, I'm first cropping to 4:3 and then resizing. Should I remove the 'Crop'? (Or at least do not change the width/height ratio?)

If it's PAL 16:9 I'd suggest you do a resize to 1024x576, crop it to proper 4:3 then downsize to 320x240. Otherwise, if it's 4:3 material resize to 768x576 first and do a straight drop down to 320x240 or crop as necessary.

ernstblaauw
11th December 2007, 10:32
If it's PAL 16:9 I'd suggest you do a resize to 1024x576, crop it to proper 4:3 then downsize to 320x240. Otherwise, if it's 4:3 material resize to 768x576 first and do a straight drop down to 320x240 or crop as necessary.

The source is 720x576. However, I already cropped to 4:3 by this line:
Crop(24, 54, -24, -54)
By adding that line, the resulting size is 696x522, which is 4:3. After that, I crop. Therefore, I don't think that is the cause. Is it possible there is another reason?

After removing that Crop, it looks more natural. I think I'm going to reencode and leaving that one out!

ajk
11th December 2007, 12:15
Sounds complicated. If the source is anamorphic 16:9, and you want to keep it wide screen, it should be fine by simply doing a resize(320,180) and addborders(0,30,0,30) to add the necessary letterboxing.

You should only need to crop it a little bit in this case if you want to get rid of some ugly borders in the image or something like that.

If you want to crop it to full screen (4:3) and avoid letterboxing, you need to take about 96 pixels off from both sides and then do the resize to 320x240. Just make sure you don't clip off the edges of text or other important stuff from the video however.

2Bdecided
11th December 2007, 12:47
By adding that line, the resulting size is 696x522, which is 4:3.But SD video pixels aren't square - so by keeping a 4x3 ratio of pixels you're not keeping an actual 4x3 area.

If the source is 4x3, I already gave you the correct crop and resize in my code.

Cheers,
David.