30fps to go into MPEG2? How?

Grazie wrote on 7/5/2009, 1:43 AM
Flesh on the bones here . ..

I have got a Canon Powershot 110. Great lil camera which can also produce non-HD watchable video.

The video is 640x480 running at 30fps and its a MJPEG within an AVI.

OK . ..

I HAVE converted to WMV - VP9 wont take MJPEG, and have great footage, for what it is, running on the timeline. But when I come to prepare a DVD via MPEG I get the 30fps<>25fps cadence. Everything else looks spiffing - as I say, for what it is.

This cadence, on verticals, is annoying me so I am hoping you can offer me a way to remedy this.

I have also used VirtDub as a method to bring the MJPEG into V9. It works but too has this vertical frame shift.

Watching in WMP, great.

TIA

Grazie

Comments

Chienworks wrote on 7/5/2009, 4:37 AM
Is there audio associated? If not, how about stretching the clip out to 1.2x as long (83.33333% speed)? That would match the 25fps frame rate exactly with no resampling or other frame juggling in the slightest; just 1:1 frame rate match.

Yeah, it would slow the action down a bit, but if you're shooting architectural, scenery, interiors, etc. then it shouldn't matter. You could always pan a tad faster when shooting to compensate.
Grazie wrote on 7/5/2009, 5:40 AM
Thanks Kelso! - Obvious, IF you are a maths stella which you are . .

But is it not possible to DO an MPG2 at 30fps? It says/suggests that this is true within the MainConcept Template offering - 30fps. However, when I DO choose 30fps within the MC menu Vegas says "No Dice"! - Now what's all THAT about?

Thanks Kelly.

Any other takers?

Grazie

farss wrote on 7/5/2009, 5:46 AM
You can put the 30fps into 60i, well technically its 30PsF60.

To convert 30fps to 25fps is no simple task. Apple's Compressor can do it as can After Effects. Huge render times.

Bob.
Chienworks wrote on 7/5/2009, 5:52 AM
If often wondered about that myself. With most rendering formats you can type in any frame rate you want ... 30, 24, 22, 63.5, 19.832913 ... whatever you feel like. But with MPEG you're stuck with a dropdown of a few choices, and some of them seem rather unuseful.

Why can't we pick a rate with MPEG?
Grazie wrote on 7/5/2009, 5:57 AM
You can put the 30fps into 60i, well technically its 30PsF60. - How, Bob! When I get kicked out of Vegas for trying 30fps?

Would this be a FrameServer test via VirtDub ( or DirtVub I said earlier today!!!), or what?

I've got 30 frames a second. That is MORE than enough to convince the brain of smooth motion?

Kelly it IS there 30fps. Try it and Vegas says it's unsupported?? Is it a NON DVD compliant thing? In which case the the Holy grail of format agnosticism is not true here.

Apologies to all philosophers in my extremely mixed religious metaphors!

Grazie
farss wrote on 7/5/2009, 6:24 AM
When you render 30p (30fps) into 60i each frame gets split into two fields. Motion resolution does not change when you do this.

It's exactly the same as when a movie is played back over the air in PAL land. The movie is run at 25fps and each frame is split into the two fields to give 50i. It looks exactly the same, in fact most of the later HDTVs will combine the two fields back into the original frame.

Bob.
farss wrote on 7/5/2009, 6:32 AM
If you want to know why Vegas will not let you render mpeg-2 as 30p the answer is probably because most DVD players will not play it.
I recently was handed a DVD by a client authored exactly this way in iDVD. Would not play at all for her or for me on our STB players.

I converted it to 60i and it plays perfectly.

Bob.
Grazie wrote on 7/5/2009, 7:10 AM
I converted it to 60i and it plays perfectly. Ok, Bob, so how do I do it?

Grazie
Chienworks wrote on 7/5/2009, 8:44 AM
But, not all MPEG2 is destined for DVDs. So why not let me choose what i want to do with it?
farss wrote on 7/5/2009, 1:50 PM
"Ok, Bob, so how do I do it?"

Simply render it to mpeg-2 as 60i using one of the DVDA NTSC template, just as you would for PAL.


"But, not all MPEG2 is destined for DVDs. So why not let me choose what i want to do with it?"

Darned if I know the answer to that one, I wasn't a party to the decision :)

Bob.
Grazie wrote on 7/5/2009, 2:42 PM
Simply render it to mpeg-2 as 60i using one of the DVDA NTSC template, just as you would for PAL.

1] Where do I SEE 60fps in the MC Encode? I can see 29.xx - but where is the 60?

2] Will this then play through on PAL?

Grazie
Chienworks wrote on 7/5/2009, 5:07 PM
60i is a colloquial term for 29.97ftp interlaced. The "60" refers to there being about 60 fields per second.
corug7 wrote on 7/6/2009, 8:48 AM
Grazie,

This should work for you. Open a 29.97 4:3 progressive timeline. Place your clips on the timeline and set your switches to disable resample and disable maintain aspect ratio. Then just use the template for DVDA NTSC video, but change field order to progressive. DVDA will accept this as will pretty much any other authoring program (with DVDSP you must remember to check the "render to separate audio and video files" checkbox).

I do this all the time and have no issues. You may drop a single frame here and there due to the difference between 29.97 and 30p, but I doubt you'll notice it.
MPM wrote on 7/6/2009, 4:13 PM
Going to 25 fps...
If you've got a version of mjpeg you've got complete frames like DV, but whatever, as long as V/Dub takes it you can decimate (toss out) 5 frames, though the only absolutely correct way to do it is to create 25 new frames interpolated from the 30 you have now... There's one or two apps that come close but the best is expensive analog hardware based on wave theory... There's quite a bit of scattered info on-line. A quick if imprecise method would be IVT in V/Dub to 24, then change the 24 to 25 -- even if it's not pulldown based, you can still use the reverse 3 2 pattern to get there, & 1 fps isn't terribly noticable.

WMV into Vegas
Don't know why Vegas won't accept your vid, but the files can be a bit funky out of some cameras. If you're going to wmv, use v.8 instead of 9 -- I may have that reversed (hard for me to remember), but one only does 29..., the other only 30.

DVD mpg2 at 30
DVDA & players pretty much all go off the mpg2 fps flag, so try changing it. DVDA only goes off the 1st flag it encounters, so you can also try just changing the one. Or lie to Vegas & set the fps for the file properties at 29, or change the wmv tag (it's been quite a while but I think you can edit it).
johnmeyer wrote on 7/6/2009, 11:06 PM
I'm doing a large project with five different types of video, including 29.97 ("60i"), 30p, 24p, and some weird stuff from mp4 files I downloaded from YouTube using the Javascript trick.

Some of the footage is 30p from a Canon still camera, just like what you're dealing with. If you want it to look good when viewed from a DVD, whether that DVD is NTSC or PAL, you need to change it from 30p to either 50i or 60i. I spent a LOT of time on this and have a wonderful AVISynth script that generates "real" video from the 30p stuff. If Vegas doesn't ingest the MJPEG video directly, download and install the MainConcept MJPEG codec. It will decode without purchasing a license (you'll get a watermark if you use the non-registered version for encoding).

Then, frameserve out of Vegas using the YUY2 format, and read into this script:
# This script converts 30 fps progressive footage from a 640x480 still camera
# into 720x480 29.97 interlaced (NTSC SD) video

loadplugin("C:\Program Files\AviSynth 2.5\plugins\MVTools\mvtools.dll")

AVISource("E:\frameserver.avi")
source=AssumeFPS(30, false)
#source=AssumeFPS(10, false)

backward_vec = source.MVAnalyse(blksize=16, overlap=4, isb = true, pel=2, search=3, idx=1, chroma=false)
forward_vec = source.MVAnalyse(blksize=16, overlap=4, isb = false, pel=2, search=3, idx=1, chroma=false)

#ml is important parameter for tuning out artifacts. Eliminate it and look at artifacts.
#Use values >100 to reduce artifacts.
last.MVFlowFps(backward_vec, forward_vec, num=60000, den=1001, ml=100)

AssumeFrameBased()
SeparateFields()
SelectEvery(4, 0, 3)
#ComplementParity()
Weave()
LanczosResize(720,480)
AssumeBFF()
AssumeFPS(29.97, false)


For PAL, change the num=60000 to num=50000 and change the AssumeFPS from 29.97 to 25. If for any reason you get juddery results, un-comment the ComplementParity line. Change the LanczosResize to whatever your final resolution will be.

If you want to send me a few seconds of your video I can do the conversion and you can decide if you like the result.

Grazie wrote on 7/6/2009, 11:24 PM
John! YOU BEAUTY!!!!!!

And now for the good news,, and a large dollop of humble pie.

Yesterday, while SKYPING with our chum from Oz - Bob! - I was giving-it large as to HOW Vegas9 was NOT importing my 30p Canon stuff. I was quite big-headed, bullish and being blatantly "know-it-all" about it.

"Yer see Bob, I would do what you ask, but for the life of me I can't get the MJPEG stuff into Vegas!! - Audio yes; video no"

"You sure Grazie?2

"Absolutely! Look I'll show you . .. Er . .. Bob?? . .Er .. The video is working now . .. "

"Tell me about it!" Says Bob . . .

So John, it would appear I CAN get the Canon MJPEG into VP9 and have since yesterday night been cutting on the timeline.

Q1: Should I do converts first and then edit or use the MJPEGs as my cutting material?

Q2: What do I need to accomplish the workflow you are suggesting? I have VirtDub? How big<>small are the output files?

John, you are really inviting me to take my abilities to a higher level. Can we do this off-line?

Grazie
Grazie wrote on 7/6/2009, 11:59 PM
John, I've sent you an email? No content yet, just want to be sure you WILL get the 15mbs of stuff?

G
Grazie wrote on 7/7/2009, 12:47 AM
I have Virtual Dub. I need to get VirtDub to use your script? I have not done this before. In the script it's AviSynth? What do I do now? Willing to learn though.

Grazie
farss wrote on 7/7/2009, 1:26 AM
Just so everyone is clear here. What this is doing is converting 30p to 50i/60i not 60PsF. The end result will look like footage shot 50i/60i.

Bob.
Grazie wrote on 7/7/2009, 1:59 AM
Meaning? Good or Bad?

Grazie
farss wrote on 7/7/2009, 2:38 AM
Good. This is the best way to convert it to PAL.

Bob.
Grazie wrote on 7/7/2009, 3:17 AM
The way that John is suggesting? Yes?

Grazie
farss wrote on 7/7/2009, 5:55 AM
Yes,
this is the same tech that we discussed, significantly more advanced / complex than what Vegas does. Instead of creating in between frames by blending adjacent frames it attempts to work out where all the objects would be at the required point in time by analysing how they're moving. The same technology is the basis of image stabilisation. The difference is how the results of the tracking are used.

Bob.
johnmeyer wrote on 7/7/2009, 11:40 AM
Bob is correct in everything he has said.

Grazie sent a PM to me and I'll convert some footage for him. FWIW, this is the reply I sent to him.The quality of my approach is pretty darn good. The basic issue with 30p footage from the Canon still cameras (other than the contrast) is that it has half the temporal resolution as our NTSC video which, of course, has roughly 60 fields per second. It isn't quite as bad for you, but there still is quite a difference between 30 events every second and the 50 events per second you get with PAL. So, the solution is to use motion estimation technology which looks at every small portion of the video and estimates where each block of pixels is moving from frame to frame and, using this information, generate an intermediate frame (or frames). This is what Twixtor and some of the fancier AE plugins do. By contrast, Vegas generates intermediate frames by simply doing what amounts to a cross-fade between the two adjacent frames, giving differing weights to the before and after frames, depending on how many in-between frames are being generated. This approach always produces video which is predictable (no unusual artifacts), but it is very soft and fuzzy, and ultimately you see the "ghosts" of the before and after frames in the in-between frame.

What my technique does (I didn't invent this, but I did spend a lot of time perfecting it) is to first double the frame rate of the progressive video (and for your PAL, it won't quite be double but instead will increase the frame rate from 30 frames progressive to 50 frames progressive). I then separate the odd and even fields, and then take the odd field from the first frame, and the even field from the second frame and put them together into one single frame. I then throw out the even field from the first frame and odd field from the second frame. Thus, I end up with 25 fps interlaced footage, where the odd and even frames are now from different moments in time, although these moments in time are now synthesized. Thus, the result is truly 50i (i.e., 25 fps interlaced) with the temporal "feel" that you expect.

As a quick side note, getting rid of interlacing is such an amazingly bad idea (unless you want the lower rate temporal "feel"). I shudder when I hear so many people talking about doing it. I understand the reason, since most modern LCD/Plasma/DLP displays do not provide a way to display interlaced, but there is absolutely no technical reason why these displays cannot do this (other than cost). Thus, I expect that some day, we will have displays which can display anything in its native cadence, although pixels will still have to be scaled when going to an addressable (instead of a raster) display. When that day comes, those who deinterlace will never again be able to recover all that temporal information that they threw out in all the projects they are doing now. What is most strange to me is that if I asked someone if they would consider reducing the resolution on their HD video to 1/2 of what they started with, they would think I was nuts, and yet that is exactly what they are doing in the time domain when they deinterlace: half the information in that video is gone forever.

Back to the motion estimation stuff. The only place I have seen this break down a little is when you have shots of vertical things moving across the field of view. The best example is someone walking rapidly from left to right (or vice versa). The legs will sometimes show slight distortion. For most video, however, you won't see any artifacts, and the results are fantastic.

I think I mentioned once (in the forum) that I had used similar techniques to take Kinescope footage (filmed footage taken by pointing a film camera at a TV set) and convert it from its bastard film-video format (the 60 field/sec temporal data is all lost, leaving only 24 progressive frames per second) back to true 60i NTSC video. The results are unbelievable, and almost unsettling because this old footage suddenly looks modern. I can even do this trick on regular film. I have some amazing amateur footage of the 1929 Chicago Cubs World Series (a big deal here in the states - think World Cup from that era) and for fun I converted a minute of it using this technology. Between all the film restoration (digital removal of dirt and spots), gamma correction, [and Deshaker motion stabilization to get rid of both gate weave and camera movement] and then this trick, it suddenly looks like TV footage of an event that took place twenty years before the first baseball television broadcast.

So, send your footage and I'll send back the results. If it is interesting, I'll spend a little more time walking you through what it takes to do this. No promise on this being "Grazie proof," but I guarantee that it is something you can do.