Ok so I downloaded a video of a tv show from the internet and I wanted to convert it to xvid so it will play easily on a standalone player.
The original video was in a .flv container, I extracted the .aac and .avs files and used Mp4Box to mux them into an .mp4 for easier conversion.
The frame rate was 29.970, aspect ratio 4:3, 640x480 NTSC. Its a reality type show on MTV.
23.976 as this is typically the frame rate previous episodes I have came in from other sources, so I naturally it seems like I need to deinterlace the video since it was probably film.
Knowing that MeGUI has a fairly decent deinterlacing analysis option I decided to see what it came up with. When it was done it said
I know that Tdecimate() brings 29.97 down to 23.976, I'm guessing thats what the 3rd line means, so that seemed like what I was looking for.M-in-5 dissemination required / M:2
Field order:
Deinterlace: Tritical Decimate
After conversion, the output .avi has a framerate of 17.982 which I haven't seen used on anything in years, silent film comes to mind lol.
I've done this before on other shows, but I'm clearly missing something here. I've heard you can pack progressive frames into an interlaced container, but if that is the case here, how do you go back to progressive? Do you even need to?
+ Reply to Thread
Results 1 to 19 of 19
-
-
I checked the sample i'm providing and noticed it says M-in-5 dissemination required / "M:1" instead of the the "M:2" that the analysis of the whole video said, what exactly is that M value specify to us?
Sample attached, .avs script below.
DirectShowSource("C:\workspace\video.mp4", fps=29.970, audio=false, convertfps=true)
LoadPlugin("C:\Program Files (x86)\megui\tools\avisynth_plugin\TIVTC.dll")
TDecimate(cycleR=2)
#crop
#resize
#denoise -
This is a 30p sample (29.97 fps) with blends (i.e. ghosting, or double images)
Whoever prepared it probably blend deinterlaced from 60i to 30p , and there's nothing you can do to "fix" the blends since it's already been deinterlaced and resized (this was shot on video at video rate, not film rate of 23.976)
Take out the TDecimate line and that will give you 29.97fps -
Yes, it's been blend deinterlaced, but it was shot on film and it can be unblended and decimated to 23.976 with decent if not spectacular results. SRestore has a special mode for this kind of thing. Here's the script:
SRestore(omode="pp3")
TDecimate()
Here's the 23.976fps result: -
manono - what clues were there or process did you go through to determine that it was shot on film? e.g. did you count "x" number of distinct frames or blends every "z" interval or something like that?
your script definitely improves the blends imo -
Yep, 3 clean and 2 blended frames in every 5 frame sequence. Granted, the sample wasn't so good, and there wasn't a whole lot of movement, but there was enough to figure it out.
-
Thanks, that makes sense. I guess my eyes and counting skills aren't as good as yours
-
Funny, it occurred to me that the missing frame could be restored from the two blended frames and the two surrounding frames because, given 3 frames of film, A, B, C, the blended video sequence looks like:
A, (A+B)/2, (B+C)/2, C
So you can restore B by subtracting half of A from (A+B)/2, half of C from (B+C)/C, then adding the results together:
B = (A+B)/2 -A/2 + (B+C)/2 - C/2
This isn't perfect because the blended frames only contain one field from each of the surrounding frames, not the entire frame. So (A+B)/2 and (B+C)/2 are only approximations. On first pass the program worked but the resulting B frame was a bit noisy.
Then I saw manono's post indicating SRestore(omode="pp3") already does this. It does better than my first approximation so I won't bother with fine tuning. I wasn't doing this in the context of an AviSynth plugin, I was just working with raw RGB images dumped from the OP's video. Then wrote a quick program to read the images, perform the calculations, and output a raw RGB image. So it's a long way from being a usable program/plugin.
A sample restore frame from my quick hack:
The same restored frame from manono's srestore video:
I'm not sure why the levels are different. But I was just performing a quick test so I wasn't paying too much attention to that.Last edited by jagabo; 23rd Feb 2010 at 19:24.
-
Downloaded both versions of mktools and average so I can run SRestore, its queued up to try this again, many thanks for all the help!
I attempted to do that counting thing from a tutorial I found that explained different methods but I just ended up confused with a headache, I don't know how you managed it lol, it's clearly an art that takes much practice -
You were right, the results came out pretty nice
Only 1 issue to speak of, fixing it would be great but I'm more curious than anything at the moment.
I've attached the first 45seconds both from the source, and the encoded avi that was made after running SRestore as suggested.
You'll notice th first ~25 seconds or so the video stutters a bit forward, then backwards then evens itself out and plays fine the rest of the 20 minute video.
I'm interested in what causes this segment of video to come out differently than the rest, the other 20 mins or so came out great at 23.976 fps as desired
Again thanks for all the help, learning more every post. -
grayfalcon - are you using DirectShowSource() as the source filter? This is one of those times, where frame accuracy is important (or when you use any filters that work temporally on fwd/bwd frames)
It works fine for me with ffms2 (ffmpegsource2) and manono's script -
I don't have the problem. I don't know why. That new source sample also unblends OK for me.
Edit: After posting I saw pdr's post. I'm using FFMPEGSource. -
Thanks I'll try that, I haven't done it that way before
So I should use something like this? I downloaded the lastest 2.13 of FFmpegSource2
FFmpegSource2("C:\workspace\video.mp4")
SRestore(omode="pp3")
TDecimate()
#crop
#resize
#denoise
ConvertToYV12()
DirectShowSource("C:\workspace\video.mp4", fps=29.970, audio=false, convertfps=true)
SRestore(omode="pp3")
TDecimate()
#crop
#resize
#denoise -
-
Thanks again, the FFmpegSource2 worked much better, no jitters, shudders or flickers
-
greyfalcon - This is a megui bug whenever you use ffmpegsource or ffms2 , but you can just ignore all the warnings as you probably already figured out. (and it's already YV12 anyway)
jagabo - do you think your problem is with a certain mvtools version? IIRC there are several "average.dll" versions, and some of them are buggy. Not sure if it will help , but the version I'm using was uploaded by manono in another post
https://forum.videohelp.com/threads/269971-DVD-RB-resize-problems?p=1618540&viewfull=1#post1618540
Similar Threads
-
Converting a "variable framerate" to constant framerate?
By vieo in forum Video ConversionReplies: 6Last Post: 2nd Sep 2010, 09:05 -
Deinterlace?
By ZedsDead in forum Video ConversionReplies: 6Last Post: 14th Mar 2010, 23:21 -
How do I convert xvid framerate 23,967 to xvid framerate 25.000?
By QuickstartDK in forum Newbie / General discussionsReplies: 16Last Post: 4th Nov 2009, 17:57 -
To deinterlace or not deinterlace...
By Nilfennasion in forum MacReplies: 4Last Post: 4th Dec 2008, 00:46 -
Do I need to deinterlace? Or never deinterlace?
By rbatty11 in forum Video ConversionReplies: 12Last Post: 17th Jan 2008, 13:15