VideoHelp Forum




+ Reply to Thread
Results 1 to 19 of 19
  1. 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

    M-in-5 dissemination required / M:2
    Field order:
    Deinterlace: Tritical Decimate
    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.

    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?
    Quote Quote  
  2. Auto analyzers can (and often do) make mistakes

    Please post your .avs script that megui made for you, and a sample of the source
    Quote Quote  
  3. 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
    Thanks for taking a look at it
    Image Attached Files
    Quote Quote  
  4. 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
    Quote Quote  
  5. 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:
    Image Attached Files
    Quote Quote  
  6. 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
    Quote Quote  
  7. 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.
    Quote Quote  
  8. Thanks, that makes sense. I guess my eyes and counting skills aren't as good as yours
    Quote Quote  
  9. 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:

    Click image for larger version

Name:	myrestore.jpg
Views:	439
Size:	47.7 KB
ID:	514

    The same restored frame from manono's srestore video:

    Click image for larger version

Name:	srestore.jpg
Views:	421
Size:	40.5 KB
ID:	515

    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.
    Quote Quote  
  10. 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
    Quote Quote  
  11. 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.
    Image Attached Files
    Quote Quote  
  12. I used to get very good results with SRestore() but lately, after updating some of my AviSynth filters, I'm getting stuttering like you are. I suspect it's a version issue with MvTools.
    Quote Quote  
  13. 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
    Image Attached Files
    Quote Quote  
  14. 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.
    Quote Quote  
  15. 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()
    instead of this

    DirectShowSource("C:\workspace\video.mp4", fps=29.970, audio=false, convertfps=true)
    SRestore(omode="pp3")
    TDecimate()
    #crop
    #resize
    #denoise
    Also I get a warning popup when I queue up the conversion, I'm not sure if it means it will be a problem or not though. Screenshot attached
    Image Attached Thumbnails Click image for larger version

Name:	warning.png
Views:	335
Size:	30.1 KB
ID:	522  

    Quote Quote  
  16. Originally Posted by poisondeathray View 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 was using DirectShowSource() at first. I thought that might have been the problem so I converted to lagarith AVI. I verified the lagarith AVI had no problems with frame order. I then used AviSource("lagarith.avi") but still had problems with misplaced frames.
    Quote Quote  
  17. Thanks again, the FFmpegSource2 worked much better, no jitters, shudders or flickers
    Quote Quote  
  18. 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
    Quote Quote  
  19. Originally Posted by poisondeathray View Post
    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
    I think my problem is with mvtools. I have the same version of average.dll. I'll have to look into cleaning up my AviSynth plugins. Thanks anyway...

    <edit>

    Got a new version of SRestore.avsi. Works now!

    </edit>
    Quote Quote  



Similar Threads

Visit our sponsor! Try DVDFab and backup Blu-rays!