VideoHelp Forum

Try DVDFab and download streaming video, copy, convert or make Blu-rays,DVDs! Download free trial !
+ Reply to Thread
Results 1 to 9 of 9
Thread
  1. Member
    Join Date
    Mar 2009
    Location
    Vietnam
    Search Comp PM
    Hi there, I have a .mkv clip but it's to large ~1gb so I want to re-encode it to a smaller size. Then I found MeGUI and the soft can convert the Video without jeopardize the quality (>95% of the original). But there's one problem, the original clip is VFR, so the result video is out of synth with it's audio & sub.

    1st try:
    Then I tried insert convertfps=true, fps=29.97 in the avisynth script the video became "jumpy", I found somethreads said that set the fps=119.88 or 120 may help, but when I do that the video became alot slower.

    2nd try:
    I used mkvmerge & mkextract to get the sound, vid (let's say test.mkv because I got it from mkvmerge, not mkvextract since the MeGUI doesnt recognize .264 file) , sub; while mkv2vfr provide me the timecode.

    Again with MeGUI, with the video track I got from demuxing the clip I convert it to mkv file with preset "x264: XDVA Anime-Toon HQ" (or something like that) and got a, let's say test-1.mkv file.

    Back to Mkvmerge, first I used test-1.mkv+timecode and the sound, sub to merge. The result is fine, but somehow mkvmerge "give" me another last 15min of video ??? Its mean the video, sound, sub that should-be-there played perfectly with out errors, but at the last moment of the clip, another last 15min is replayed (without sound & sub).

    Then I tried muxing the "original stream" test.mkv+timecode, sound, sub the result is completely perfect, but that defeat the purpose of what I'm doing, since I want a SMALLER file.



    I'm not too good with coding so I find Avisynth is a pain in the ass. I can do some simple code or let the MeGUI generate them; but I cant deal with complex coding.
    Aside from those method, does anyone know of others ? Or a wasy way to convert VFR to CFR ?

    Thanks you for reading
    Quote Quote  
  2. Banned
    Join Date
    Jun 2007
    Location
    UNREACHABLE
    Search Comp PM
    Please, run Mediainfo and/or Gspot onto the MKV file,
    and then post the results to this forum.

    Need more info!


    +++
    Quote Quote  
  3. Member
    Join Date
    Mar 2009
    Location
    Vietnam
    Search Comp PM
    This is the Original File info:

    Code:
    General
    Complete name                    : E:\El Hazard (Multi-series)\[Exiled-Destiny]_El_Hazard_The_Magnificent_World_1\[Exiled-Destiny]_El_Hazard_The_Magnificent_World_1_Ep01_(787D1A9C).mkv
    Format                           : Matroska
    File size                        : 994 MiB
    Duration                         : 45mn 31s
    Overall bit rate                 : 3 051 Kbps
    Encoded date                     : UTC 2007-08-14 19:11:11
    Writing application              : mkvmerge v2.0.0 ('After The Rain Has Fallen') built on Jan 13 2007 19:58:56
    Writing library                  : libebml v0.7.7 + libmatroska v0.8.0
    
    Video
    ID                               : 1
    Format                           : AVC
    Format/Info                      : Advanced Video Codec
    Format profile                   : High@L5.1
    Format settings, CABAC           : Yes
    Format settings, ReFrames        : 8 frames
    Muxing mode                      : Container profile=Unknown@5.1
    Codec ID                         : V_MPEG4/ISO/AVC
    Duration                         : 45mn 28s
    Bit rate                         : 2 150 Kbps
    Nominal bit rate                 : 2 799 Kbps
    Width                            : 640 pixels
    Height                           : 480 pixels
    Display aspect ratio             : 4/3
    Frame rate                       : 29.970 fps
    Resolution                       : 24 bits
    Colorimetry                      : 4:2:0
    Scan type                        : Progressive
    Bits/(Pixel*Frame)               : 0.234
    Writing library                  : x264 core 56 svn-667C
    Encoding settings                : cabac=1 / ref=5 / deblock=1:-1:-1 / analyse=0x3:0x133 / me=umh / subme=7 / brdo=1 / mixed_ref=1 / me_range=16 / chroma_me=1 / trellis=1 / 8x8dct=1 / cqm=0 / deadzone=21,11 / chroma_qp_offset=0 / threads=1 / nr=0 / decimate=0 / mbaff=0 / bframes=2 / b_pyramid=1 / b_adapt=1 / b_bias=0 / direct=3 / wpredb=1 / bime=1 / keyint=250 / keyint_min=25 / scenecut=40 / rc=2pass / bitrate=2799 / ratetol=1.0 / rceq='blurCplx^(1-qComp)' / qcomp=0.60 / qpmin=10 / qpmax=51 / qpstep=4 / cplxblur=20.0 / qblur=0.5 / ip_ratio=1.40 / pb_ratio=1.30
    
    Audio #1
    ID                               : 2
    Format                           : AC-3
    Format/Info                      : Audio Coding 3
    Codec ID                         : A_AC3
    Duration                         : 45mn 31s
    Bit rate mode                    : Constant
    Bit rate                         : 384 Kbps
    Channel(s)                       : 2 channels
    Channel positions                : L R
    Sampling rate                    : 48.0 KHz
    Language                         : English
    
    Audio #2
    ID                               : 3
    Format                           : AC-3
    Format/Info                      : Audio Coding 3
    Codec ID                         : A_AC3
    Duration                         : 45mn 31s
    Bit rate mode                    : Constant
    Bit rate                         : 384 Kbps
    Channel(s)                       : 6 channels
    Channel positions                : Front: L C R, Surround: L R, LFE
    Sampling rate                    : 48.0 KHz
    Language                         : Japanese
    
    Text #1
    ID                               : 4
    Format                           : UTF-8
    Codec ID                         : S_TEXT/UTF8
    Codec ID/Info                    : UTF-8 Plain Text
    Language                         : Japanese
    
    Text #2
    ID                               : 5
    Format                           : VobSub
    Codec ID                         : S_VOBSUB
    Codec ID/Info                    : The same subtitle format used on DVDs
    Language                         : Japanese
    And this is the muxed test-1 file info (well, the real name is different though)

    Code:
    General
    Complete name                    : E:\El Hazard (Multi-series)\ep01.mkv
    Format                           : Matroska
    File size                        : 431 MiB
    Duration                         : 56mn 7s
    Overall bit rate                 : 1 074 Kbps
    Encoded date                     : UTC 2009-03-16 01:26:49
    Writing application              : mkvmerge v2.5.3 ('Boogie') built on Mar  7 2009 15:00:41
    Writing library                  : libebml v0.7.7 + libmatroska v0.8.1
    
    Video
    ID                               : 1
    Format                           : AVC
    Format/Info                      : Advanced Video Codec
    Format profile                   : High@L4.1
    Format settings, CABAC           : Yes
    Format settings, ReFrames        : 4 frames
    Muxing mode                      : Container profile=Unknown@4.1
    Codec ID                         : V_MPEG4/ISO/AVC
    Duration                         : 56mn 4s
    Bit rate                         : 700 Kbps
    Nominal bit rate                 : 1 000 Kbps
    Width                            : 640 pixels
    Height                           : 480 pixels
    Display aspect ratio             : 4/3
    Frame rate                       : 23.976 fps
    Original frame rate              : 29.970 fps
    Resolution                       : 24 bits
    Colorimetry                      : 4:2:0
    Scan type                        : Progressive
    Bits/(Pixel*Frame)               : 0.095
    Writing library                  : x264 core 67 r1127M 8d82fec
    Encoding settings                : cabac=1 / ref=4 / deblock=1:1:1 / analyse=0x3:0x113 / me=umh / subme=7 / psy_rd=0.6:0.0 / mixed_ref=1 / me_range=16 / chroma_me=1 / trellis=1 / 8x8dct=1 / cqm=0 / deadzone=21,11 / chroma_qp_offset=-2 / threads=3 / nr=0 / decimate=1 / mbaff=0 / bframes=3 / b_pyramid=0 / b_adapt=2 / b_bias=0 / direct=3 / wpredb=0 / keyint=250 / keyint_min=25 / scenecut=40 / rc=2pass / bitrate=1000 / ratetol=1.0 / qcomp=0.60 / qpmin=10 / qpmax=51 / qpstep=4 / cplxblur=20.0 / qblur=0.5 / vbv_maxrate=50000 / vbv_bufsize=50000 / ip_ratio=1.40 / pb_ratio=1.30 / aq=0
    Language                         : English
    
    Audio #1
    ID                               : 2
    Format                           : AC-3
    Format/Info                      : Audio Coding 3
    Codec ID                         : A_AC3
    Duration                         : 56mn 7s
    Bit rate mode                    : Constant
    Bit rate                         : 160 Kbps
    Channel(s)                       : 2 channels
    Channel positions                : L R
    Sampling rate                    : 48.0 KHz
    
    Audio #2
    ID                               : 3
    Format                           : AC-3
    Format/Info                      : Audio Coding 3
    Codec ID                         : A_AC3
    Duration                         : 56mn 7s
    Bit rate mode                    : Constant
    Bit rate                         : 160 Kbps
    Channel(s)                       : 2 channels
    Channel positions                : L R
    Sampling rate                    : 48.0 KHz
    
    Text
    ID                               : 4
    Format                           : UTF-8
    Codec ID                         : S_TEXT/UTF8
    Codec ID/Info                    : UTF-8 Plain Text
    both files are completed clip with sound, vid & sub
    Quote Quote  
  4. Banned
    Join Date
    Jun 2007
    Location
    UNREACHABLE
    Search Comp PM
    I've noticed two things:

    --- the framerate of the original file = 29.970fps, whereas the framerate of the
    reencoded mkv = 23.976fps;

    --- did the audio tracks need to be reencoded

    What about the Avisynth script(s) used by MeGUI ?
    Quote Quote  
  5. Member
    Join Date
    Mar 2009
    Location
    Vietnam
    Search Comp PM
    This is the info of the video stream before muxed (with timecode) by mkvmerge, as you can see, the framerate is still 29.970.

    Code:
    General
    Complete name                    : E:\El Hazard (Multi-series)\ep01v.mkv
    Format                           : Matroska
    File size                        : 327 MiB
    Duration                         : 45mn 31s
    Overall bit rate                 : 1 003 Kbps
    Writing application              : x264
    Writing library                  : Haali Matroska Writer b0
    
    Video
    ID                               : 1
    Format                           : AVC
    Format/Info                      : Advanced Video Codec
    Format profile                   : High@L4.1
    Format settings, CABAC           : Yes
    Format settings, ReFrames        : 4 frames
    Muxing mode                      : Container profile=Unknown@4.1
    Codec ID                         : V_MPEG4/ISO/AVC
    Duration                         : 45mn 28s
    Bit rate                         : 957 Kbps
    Nominal bit rate                 : 1 000 Kbps
    Width                            : 640 pixels
    Height                           : 480 pixels
    Display aspect ratio             : 4/3
    Frame rate                       : 29.970 fps
    Resolution                       : 24 bits
    Colorimetry                      : 4:2:0
    Scan type                        : Progressive
    Bits/(Pixel*Frame)               : 0.104
    Writing library                  : x264 core 67 r1127M 8d82fec
    Encoding settings                : cabac=1 / ref=4 / deblock=1:1:1 / analyse=0x3:0x113 / me=umh / subme=7 / psy_rd=0.6:0.0 / mixed_ref=1 / me_range=16 / chroma_me=1 / trellis=1 / 8x8dct=1 / cqm=0 / deadzone=21,11 / chroma_qp_offset=-2 / threads=3 / nr=0 / decimate=1 / mbaff=0 / bframes=3 / b_pyramid=0 / b_adapt=2 / b_bias=0 / direct=3 / wpredb=0 / keyint=250 / keyint_min=25 / scenecut=40 / rc=2pass / bitrate=1000 / ratetol=1.0 / qcomp=0.60 / qpmin=10 / qpmax=51 / qpstep=4 / cplxblur=20.0 / qblur=0.5 / vbv_maxrate=50000 / vbv_bufsize=50000 / ip_ratio=1.40 / pb_ratio=1.30 / aq=0

    This is the MeGUI's Avisynth Script for the re-encoded file:
    Code:
    LoadPlugin("C:\Program Files\Common Files\Common Share\plugins\VSFilter.dll")
    DirectShowSource("E:\El Hazard (Multi-series)\test\[Exiled-Destiny]_El_Hazard_The_Magnificent_World_1_Ep01.mkv", fps=29.970, audio=false)
    #deinterlace
    #crop
    #resize
    #denoise
    Ah, one more thing: if I change the framerate in the script to 23.976; mkvmerge will "eat" about ~1min of clip instead "give" me ~15min when I choose 29.970.

    For the audio, since I want the file to be small as much as possible, I shrank it to 160kbps



    //One more question, in the x264 dialog box (MeGUI), the AVC Profile combo box show some value like "High Profile", "Baseline Profile", "Main Profile". While AVC Level show "Level1" to "Level 5.1" and "unrestricted". Can you explain what these mean to me ?
    Quote Quote  
  6. The profile levels specific restrictions on some of the options of the encoder. They are meant for device compatibility. e.g. an ipod is restricted to baseline profile and cannot use certain options like I8x8 or b-pyramid. Just because you choose a higher level or profile doesn't mean you get higher quality - the options aren't automatically selected; they just impose a maximum restriction.

    I would leave it VFR. If you examine the timecodes, and you see many transitions, there is no way you will get it smooth by converting to CFR - it will become "jumpy" as you've experienced

    To re-encode use AVCSource() and DGAVCIndex to get frame accuracy (DirectShowSource isn't necessarily frame accurate), then re-mux with the timecodes. DSS2() or FFMpegSource or FFVideoSource() are other source filter options that are frame accurate. If you don't have the same framecount, you risk getting a/v sync issues.
    Quote Quote  
  7. Member
    Join Date
    Mar 2009
    Location
    Vietnam
    Search Comp PM
    Originally Posted by poisondeathray
    The profile levels specific restrictions on some of the options of the encoder. They are meant for device compatibility. e.g. an ipod is restricted to baseline profile and cannot use certain options like I8x8 or b-pyramid. Just because you choose a higher level or profile doesn't mean you get higher quality - the options aren't automatically selected; they just impose a maximum restriction.

    I would leave it VFR. If you examine the timecodes, and you see many transitions, there is no way you will get it smooth by converting to CFR - it will become "jumpy" as you've experienced

    To re-encode use AVCSource() and DGAVCIndex to get frame accuracy (DirectShowSource isn't necessarily frame accurate), then re-mux with the timecodes. DSS2() or FFMpegSource or FFVideoSource() are other source filter options that are frame accurate. If you don't have the same framecount, you risk getting a/v sync issues.
    If it is not too much trouble, could you give me some example code line ? Im prettry bad with coding and all
    Quote Quote  
  8. FFMpegSource("video.mkv")

    or

    FFVideoSource("video.mkv")

    or

    DSS2("video.mkv")

    AVCSource takes a few extra steps, you can use it to index the raw avc stream and generate a .dga file then use AVCSource("file.dga") - it comes with good documentation and a 1-page quickstart manual

    You need to download the plugins, they don't come with the standard avisynth install.

    Don't forget to re-mux with the timecodes sheet.
    Quote Quote  
  9. Member
    Join Date
    Mar 2009
    Location
    Vietnam
    Search Comp PM
    Originally Posted by poisondeathray
    FFMpegSource("video.mkv")

    or

    FFVideoSource("video.mkv")

    or

    DSS2("video.mkv")

    AVCSource takes a few extra steps, you can use it to index the raw avc stream and generate a .dga file then use AVCSource("file.dga") - it comes with good documentation and a 1-page quickstart manual

    You need to download the plugins, they don't come with the standard avisynth install.

    Don't forget to re-mux with the timecodes sheet.


    thanks, Im going to try them now.

    @update: AVCSource works perfect ! now trying with FFvideosource. And where do you find DSS2 ?
    Quote Quote  



Similar Threads