VideoHelp Forum
+ Reply to Thread
Results 1 to 10 of 10
Thread
  1. I have a 720p H.264 MKV with a frame rate of 23.976 fps (only video) that I want to downscale to 480p using MeGUI. Normally, I would use Handbrake, but Handbrake stops encoding this particular video partway through (I wouldn't mind getting a solution to that problem, either, but that's another topic).

    So, when I opened this video in MeGUI, the video player that automatically opens showed that the video has 25244 frames, which is equivalent to a frame rate of 17.843 fps -- but every other video player I've opened it with shows a frame rate of 23.976 fps, which is so much more logical anyway. I looked for frame rate options in the AviSynth script creator, and this is what I found:



    The FPS option is greyed out no matter what. What's the issue here? Thanks in advance!
    Quote Quote  
  2. Member
    Join Date
    Mar 2008
    Location
    United States
    Search Comp PM
    Open the file in Mediainfo. Put it in "text" mode and copy the info into this thread.
    Quote Quote  
  3. Here's the MediaInfo output from the video in my first post:

    Code:
    General
    Unique ID                                : 176241134147725643450174896860604446584 (0x8496CEC9EF6C0552999A9388B750B778)
    Complete name                            : G:\2.mkv
    Format                                   : Matroska
    Format version                           : Version 2
    File size                                : 201 MiB
    Duration                                 : 23mn 44s
    Overall bit rate                         : 1 183 Kbps
    Movie name                               : Spice & Wolf OVA
    Encoded date                             : UTC 2012-03-20 05:23:33
    Writing application                      : mkvmerge v5.3.0 ('I could have danced') built on Feb  9 2012 10:38:07
    Writing library                          : libebml v1.2.3 + libmatroska v1.3.0
    Attachment                               : Yes
    
    Video
    ID                                       : 1
    Format                                   : AVC
    Format/Info                              : Advanced Video Codec
    Format profile                           : High@L4.0
    Format settings, CABAC                   : Yes
    Format settings, ReFrames                : 8 frames
    Muxing mode                              : Header stripping
    Codec ID                                 : V_MPEG4/ISO/AVC
    Duration                                 : 23mn 44s
    Bit rate                                 : 1 181 Kbps
    Width                                    : 1 280 pixels
    Height                                   : 720 pixels
    Display aspect ratio                     : 16:9
    Frame rate                               : 23.976 fps
    Color space                              : YUV
    Chroma subsampling                       : 4:2:0
    Bit depth                                : 8 bits
    Scan type                                : Progressive
    Bits/(Pixel*Frame)                       : 0.053
    Stream size                              : 197 MiB (98%)
    Title                                    : Video (H.264)
    Writing library                          : x264 core 68 r1195 5d75a9b
    Encoding settings                        : cabac=1 / ref=8 / deblock=1:-1:-1 / analyse=0x3:0x113 / me=umh / subme=9 / psy_rd=0.7:0.0 / mixed_ref=1 / me_range=24 / chroma_me=1 / trellis=2 / 8x8dct=1 / cqm=0 / deadzone=21,11 / chroma_qp_offset=-2 / threads=1 / nr=0 / decimate=1 / mbaff=0 / bframes=6 / b_pyramid=1 / b_adapt=2 / b_bias=0 / direct=3 / wpredb=1 / keyint=250 / keyint_min=25 / scenecut=40 / rc=2pass / bitrate=1181 / ratetol=1.0 / qcomp=0.60 / qpmin=10 / qpmax=51 / qpstep=4 / cplxblur=20.0 / qblur=0.5 / ip_ratio=1.40 / pb_ratio=1.30 / aq=0
    Language                                 : Japanese
    Default                                  : Yes
    Forced                                   : No
    I went through every video from the same season as that video, and found that some encode properly in Handbrake and others don't -- and the ones that do encode properly in Handbrake have frame rates of 23.976 fps in MeGUI while the ones that don't encode properly in Handbrake have different frame rates (everything from 17.843 to 4.060). So it seems that the issue is tied to the video and not either of the encoders. But Handbrake and MeGUI seem to handle the problem differently: in the case of the example video above, Handbrake encodes the first 6:12 with a frame rate of 23.976 fps and then suddenly stops, while MeGUI encodes the full 23:45 but at a frame rate of 17.843 fps.

    And MediaInfo says all of these videos have frame rates of 23.976, too.
    Quote Quote  
  4. post your script (go the the script tab)
    Quote Quote  
  5. Code:
    #deinterlaceLoadPlugin("G:\MeGUI\tools\ffms\ffms2.dll")
    FFVideoSource("G:\2.mkv", threads=1)#deinterlaceLoadPlugin("G:\MeGUI\tools\ffms\ffms2.dll")
    FFVideoSource("G:\2.mkv", threads=1)
    #deinterlace
    #crop
    LanczosResize(848,480) # Lanczos (Sharp)
    #denoise
    Thank you both!
    Quote Quote  
  6. Add AssumeFPS(24000,1001)

    Code:
    LoadPlugin("G:\MeGUI\tools\ffms\ffms2.dll") 
    FFVideoSource("G:\2.mkv", threads=1) 
    AssumeFPS(24000,1001) 
    LanczosResize(848,480) # Lanczos (Sharp) #denoise
    Save the .avs script and reload it
    Quote Quote  
  7. With the old script, the video output was 23:45 long (the correct length) and had a frame rate of 17.843 fps. With the script you recommended, poisondeathray, the video output was 17:40 long and had a frame rate of 23.976 fps (the correct frame rate). MeGUI still treated the video input as though it had 25424 frames, so the video output ran faster than it should when it was forced to 23.976 fps. In reality, the video should have 34162 frames, but I don't know where these missing frames are -- the video input is 200 MB large, which is the same size as the video stream in the original MKV that I demuxed the video from, so I feel like the frames are there. Is this file corrupt somehow?

    Thank you again for your time.
    Quote Quote  
  8. Source may be VFR.....
    Open the video directly through AVS Creator, script should be using DirectShowSource.
    The duration of the video should be correct now.
    Quote Quote  
  9. Anonymous847344
    Guest
    Create a script like this in a notepad changing .txt to .avs:

    DirectShowSource("2.mkv", fps=23.976, video=true, convertfps=true)

    save

    and the script must be in the same directory of the video file.

    Later, you must to open this script in Megui in AVS Script Creator...

    If you continue having problems, you must to extract the h264 file from the MKV with MKV extract.

    Regards
    Quote Quote  
  10. MeGUI doesn't add frame rate conversion when you open a video for indexing/decoding with ffmsindex, hence the option being greyed out. It only adds it when opening a video via DirectShowSource (and maybe AVISource). I asked the developer at one stage why it doesn't because to me it'd be a good idea if it did. I can't remember why he said he wouldn't add it for ffmsindex. Apparently it had the potential to cause some sort of problem. Anyway.... after you open the video in the usual manner and set up the encoding job you can add the frame rate conversion stuff to the script manually. To get ffmsindex to do the frame rate conversion you'd change the script to look something like this:

    LoadPlugin("G:\MeGUI\tools\ffms\ffms2.dll")
    FFVideoSource("G:\2.mkv", threads=1, fpsnum=24000, fpsden=1001)
    LanczosResize(848,480) # Lanczos (Sharp) #denoise

    The above should convert the video to a 23.976 fps constant frame rate.

    Another option might be to encode it "as-is" (as you've been doing). That should effectively encode the same number of frames as the original video using a constant frame rate, but if the frame rate of the original video varies, the duration will be wrong or the audio sync will drift in places etc. To fix that you can use MKVCleaver to extract the video timecodes from the original MKV as a text file. You can then remux the MKV which MeGUI produces while adding the extracted timecodes file which should change the encoded video to the same variable frame rate as the original.

    On the odd occasion I've had similar frame rate issues where the video appears to be constant frame rate but duplicate frames (or frames with twice the normal duration) effectively make the video variable frame rate. For some reason those duplicate frames don't get encoded. Adding the frame rate conversion to the script should fix that. If you extract the video timecodes from the original MKV and open it with notepad, every frame should have the same duration if the video is constant frame rate.
    Quote Quote  



Similar Threads

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