VideoHelp Forum

Try DVDFab and download streaming video, copy, convert or make Blu-rays,DVDs! Download free trial !
+ Reply to Thread
Results 1 to 7 of 7
Thread
  1. I appologise in advance if I posted this in the wrong place, it is my first post.

    I am trying to convert a 1080i ts video file to 720p/50fps mkv and experiencing some difficulties. The following tools are used:

    AviSynth, MeGUI and QTGMC

    Due to some difficulties while indexing the ts file directly in MeGUI, I re-packaged the video and audio streams from the ts file into a new
    mkv container. This made MeGUI open and index the file correctly. The following is the MediaInfo summary for the resulting mkv file:

    Code:
    General
    Count                                    : 284
    Count of stream of this kind             : 1
    Kind of stream                           : General
    Stream identifier                        : 0
    Unique ID                                : 256936589638131642969903378674789558508
    Unique ID                                : 256936589638131642969903378674789558508 (0xC14C2FEAFB3BA2BEE5F090440A42A8EC)
    Count of video streams                   : 1
    Count of audio streams                   : 1
    Video_Format_List                        : AVC
    Video_Format_WithHint_List               : AVC
    Codecs Video                             : AVC
    Video_Language_List                      : English
    Audio_Format_List                        : MPEG Audio
    Audio_Format_WithHint_List               : MPEG Audio (MP2)
    Audio codecs                             : MPEG-1 Audio layer 2
    Audio_Language_List                      : English
    Complete name                            : Recording.HD.1080i.x264.English.mkv
    File name                                : Recording.HD.1080i.x264.English
    File extension                           : mkv
    Format                                   : Matroska
    Format/Url                               : http://packs.matroska.org/
    Format/Extensions usually used           : mkv mk3d mka mks
    Commercial name                          : Matroska
    Format version                           : Version 4 / Version 2
    Codec                                    : Matroska
    Codec/Url                                : http://packs.matroska.org/
    Codec/Extensions usually used            : mkv mk3d mka mks
    File size                                : 6666203983
    File size                                : 6.21 GiB
    File size                                : 6 GiB
    File size                                : 6.2 GiB
    File size                                : 6.21 GiB
    File size                                : 6.208 GiB
    Duration                                 : 5785560
    Duration                                 : 1h 36mn
    Duration                                 : 1h 36mn 25s 560ms
    Duration                                 : 1h 36mn
    Duration                                 : 01:36:25.560
    Overall bit rate                         : 9217713
    Overall bit rate                         : 9 218 Kbps
    Stream size                              : 132657489
    Stream size                              : 127 MiB (2%)
    Stream size                              : 127 MiB
    Stream size                              : 127 MiB
    Stream size                              : 127 MiB
    Stream size                              : 126.5 MiB
    Stream size                              : 127 MiB (2%)
    Proportion of this stream                : 0.01990
    Encoded date                             : UTC 2014-08-16 15:44:48
    File last modification date              : UTC 2014-08-16 15:52:53
    File last modification date (local)      : 2014-08-16 17:52:53
    Writing application                      : mkvmerge v6.7.0 ('Back to the Ground') 64bit built on Jan  9 2014 18:03:17
    Writing library                          : libebml v1.3.0 + libmatroska v1.4.1
    
    Video
    Count                                    : 272
    Count of stream of this kind             : 1
    Kind of stream                           : Video
    Stream identifier                        : 0
    StreamOrder                              : 0
    ID                                       : 1
    Unique ID                                : 6290042216038998922
    Format                                   : AVC
    Format/Info                              : Advanced Video Codec
    Format/Url                               : http://developers.videolan.org/x264.html
    Commercial name                          : AVC
    Format profile                           : Main@L4.0
    Format settings                          : CABAC / 4 Ref Frames
    Format settings, CABAC                   : Yes
    Format settings, ReFrames                : 4
    Format settings, ReFrames                : 4 frames
    Internet media type                      : video/H264
    Codec ID                                 : V_MPEG4/ISO/AVC
    Codec ID/Url                             : http://ffdshow-tryout.sourceforge.net/
    Codec                                    : V_MPEG4/ISO/AVC
    Codec                                    : AVC
    Codec/Family                             : AVC
    Codec/Info                               : Advanced Video Codec
    Codec/Url                                : http://ffdshow-tryout.sourceforge.net/
    Codec profile                            : Main@L4.0
    Codec settings                           : CABAC / 4 Ref Frames
    Codec settings, CABAC                    : Yes
    Codec_Settings_RefFrames                 : 4
    Duration                                 : 5785560
    Duration                                 : 1h 36mn
    Duration                                 : 1h 36mn 25s 560ms
    Duration                                 : 1h 36mn
    Duration                                 : 01:36:25.560
    Bit rate                                 : 8842281
    Bit rate                                 : 8 842 Kbps
    Width                                    : 1920
    Width                                    : 1 920 pixels
    Height                                   : 1080
    Height                                   : 1 080 pixels
    Pixel aspect ratio                       : 1.000
    Display aspect ratio                     : 1.778
    Display aspect ratio                     : 16:9
    Frame rate mode                          : CFR
    Frame rate mode                          : Constant
    Frame rate                               : 25.000
    Frame rate                               : 25.000 fps
    Frame count                              : 144639
    Standard                                 : Component
    Resolution                               : 8
    Resolution                               : 8 bits
    Colorimetry                              : 4:2:0
    Color space                              : YUV
    Chroma subsampling                       : 4:2:0
    Bit depth                                : 8
    Bit depth                                : 8 bits
    Scan type                                : MBAFF
    Scan type                                : MBAFF
    Interlacement                            : MBAFF
    Interlacement                            : MBAFF
    Bits/(Pixel*Frame)                       : 0.171
    Delay                                    : 560
    Delay                                    : 560ms
    Delay                                    : 560ms
    Delay                                    : 560ms
    Delay                                    : 00:00:00.560
    Delay, origin                            : Container
    Delay, origin                            : Container
    Stream size                              : 6394693054
    Stream size                              : 5.96 GiB (96%)
    Stream size                              : 6 GiB
    Stream size                              : 6.0 GiB
    Stream size                              : 5.96 GiB
    Stream size                              : 5.956 GiB
    Stream size                              : 5.96 GiB (96%)
    Proportion of this stream                : 0.95927
    Default                                  : Yes
    Default                                  : Yes
    Forced                                   : No
    Forced                                   : No
    colour_description_present               : Yes
    Color primaries                          : BT.709
    Transfer characteristics                 : BT.709
    Matrix coefficients                      : BT.709
    
    Audio
    Count                                    : 222
    Count of stream of this kind             : 1
    Kind of stream                           : Audio
    Kind of stream                           : Audio
    Stream identifier                        : 0
    StreamOrder                              : 1
    ID                                       : 2
    ID                                       : 2
    Unique ID                                : 9237990321784341080
    Format                                   : MPEG Audio
    Commercial name                          : MPEG Audio
    Format version                           : Version 1
    Format profile                           : Layer 2
    Internet media type                      : audio/mpeg
    Codec ID                                 : A_MPEG/L2
    Codec ID/Hint                            : MP2
    Codec ID/Url                             : http://www.iis.fraunhofer.de/amm/index.html
    Codec                                    : MPA1L2
    Codec                                    : MPEG-1 Audio layer 2
    Codec/Family                             : MPEG-A
    Codec/Info                               : MPEG1 or 2 Audio layer 2
    Codec/Url                                : http://www.iis.fraunhofer.de/amm/index.html
    Duration                                 : 5785560
    Duration                                 : 1h 36mn
    Duration                                 : 1h 36mn 25s 560ms
    Duration                                 : 1h 36mn
    Duration                                 : 01:36:25.560
    Bit rate mode                            : CBR
    Bit rate mode                            : Constant
    Bit rate                                 : 192000
    Bit rate                                 : 192 Kbps
    Channel(s)                               : 2
    Channel(s)                               : 2 channels
    Sampling rate                            : 48000
    Sampling rate                            : 48.0 KHz
    Samples count                            : 277706880
    Compression mode                         : Lossy
    Compression mode                         : Lossy
    Delay                                    : 0
    Delay                                    : 00:00:00.000
    Delay, origin                            : Container
    Delay, origin                            : Container
    Delay relative to video                  : -560
    Delay relative to video                  : -560ms
    Delay relative to video                  : -560ms
    Delay relative to video                  : -560ms
    Delay relative to video                  : -00:00:00.560
    Video0 delay                             : -560
    Video0 delay                             : -560ms
    Video0 delay                             : -560ms
    Video0 delay                             : -560ms
    Video0 delay                             : -00:00:00.560
    Stream size                              : 138853440
    Stream size                              : 132 MiB (2%)
    Stream size                              : 132 MiB
    Stream size                              : 132 MiB
    Stream size                              : 132 MiB
    Stream size                              : 132.4 MiB
    Stream size                              : 132 MiB (2%)
    Proportion of this stream                : 0.02083
    Default                                  : Yes
    Default                                  : Yes
    Forced                                   : No
    Forced                                   : No
    Here is the the AviSynth file I've come up with:

    Code:
    # Set DAR in encoder to 123 : 94. The following line is for automatic signalling
    global MeGUI_darx = 123
    global MeGUI_dary = 94
    LoadPlugin("C:\Users\user\Desktop\x264_encoding\MeGUI\tools\ffms\ffms2.dll")
    FFVideoSource("C:\Users\user\Videos\Recording.HD.1080i.x264.English.mkv", fpsnum=25000, fpsden=1000, threads=1)
    AssumeTFF()
    crop(178, 4, -174, 0)
    Spline36Resize(1280,height)
    QTGMC(Preset="Fast")
    #SelectEven()
    Spline36Resize(width,720)
    LoadPlugin("C:\Users\user\Desktop\x264_encoding\MeGUI\tools\avisynth_plugin\UnDot.dll")
    Undot() # Minimal Noise
    __film = last
    __t0 = __film.trim(598, 289150)
    __t0
    Basically I am loading the repackaged mkv, croping out the black border, resizing to 720p (deinterlacing with QTGMC and doubling the fps to
    50fps), trim the clip and perform minimal noise removal. I am unsure about AssumeTFF() as I've read that MBAFF is neither BFF nor TFF so that got me confused.

    The real problem is that the encoded video stutters and jumps forward and backward, especially during the fast moving scenes. Also, the
    original mkv video has some "water ripple" effects during the same fast moving scenes. These are the ones I was hoping QTGMC would remove.

    I am a real noob when it comes to QTGMC, AviSynth and MeGUI. Could anyone with more experience have a look at my script and check what I did
    wrong? As I've said, what I would like to do is to have a smooth 720p/50fps playback but I am not even sure whether I have deinterlaced or some other
    kind of video. Any tips are more than welcome!

    Kind Regards
    Quote Quote  
  2. Preview the script in vdub or megui and go to one the stuttery sections. If you change the script to AssumeBFF() , the preview it and that fixes it, then you have a rare example of the <0.0001% of HD content that is actually BFF . (By convention, all interlaced HD is TFF)

    The other possiblilty is that you had problems decoding the file with ffms2 . It still has problems with some PAFF and MBAFF AVC streams and can sometimes decode frames out of order along with other issues

    If you can't figure it out, cut a section of the original that corresponds to a resulting stuttery section with tsmuxer and post a sample
    Quote Quote  
  3. Regardless of how they're encoded, if the frames are interlaced they have a field order and will either be TFF or BFF. Playing them with the wrong field order will result in fast jerky motion.
    Quote Quote  
  4. I've been playing with Assume[T|B]FF() and some other parameters and it appears that the video is definately interlaced.
    However, neither TFF nor BFF produce a smooth playback when previewing the script (in both cases the video jumps
    back and forward on each next frame selection).

    Also, leaving out the QTGMC() call makes the script preview manifest typical interlacing lines on fast movements, that is why I think the video
    indeed is interlaced.

    What seem to give the best results is excluding AssumeXFF() alltogether. When previewing the script in this case, the
    playback is smooth for at least 15-20 frames, when it jumps forward, back, and then forward again, and then the smooth
    part repeats again. Below is the script I'm currently using:

    Code:
    # Set DAR in encoder to 121 : 93. The following line is for automatic signalling
    global MeGUI_darx = 121
    global MeGUI_dary = 93
    
    LoadPlugin("C:\Users\user\Desktop\x264_encoding\MeGUI\tools\ffms\ffms2.dll")
    FFVideoSource("C:\Users\user\Videos\Recording.HD.1080i.x264.English.mkv", fpsnum=25000, fpsden=1000, threads=1)
    #AssumeTFF()
    
    crop(272, 10, -264, -6)
    
    QTGMC(Preset="Fast")
    #SelectEven()
    
    #resize
    #Spline36Resize(1280,720)
    
    LoadPlugin("C:\Users\user\Desktop\x264_encoding\MeGUI\tools\avisynth_plugin\UnDot.dll")
    Undot() # Minimal Noise
    Are there any other Assume()-functions or similar I could test with? I should state that the video has been recorded
    of a Spanish channel Movistar (perhaps that makes it easier to determine what kind of video signal has been used?).

    Also, I am starting to suspect that what poisondeathray said about ffms2 decoding issue to be possible. Are there
    any other options I could use instead of FFVideoSource() in order to read in the file?

    Thanks again.
    Quote Quote  
  5. Sound like decoding issue

    Other options:
    DGNV Tools, but requires a compatible Nvidia card and a license (not free) . You can use it in megui if you have active license and enable in the preferences

    You can try l-smash to index it (if using it in megui I think you have to enable it in the preferences as well).

    The other option is to decode to a lossless intermediate first, using ffmbc. ffmbc seems to be able to handle interlaced AVC streams without problems. Lossless intermediate will be several times times larger than the original



    If you still can't figure it out, post a native sample of the transport stream
    Quote Quote  
  6. Thank you for your reply poisondeathray.

    I will try out some of the suggestions you mentioned, if they fail, I will upload a sample of the original ts-file.

    Kind Regards
    Quote Quote  
  7. Hi and sorry for somewhat late reply. I did try out some of the options poisondeathray recommended and I
    managed to get it to work with DGNV Tools in a following fashion:

    Code:
    # Set DAR in encoder to 38 : 29. The following line is for automatic signalling
    global MeGUI_darx = 38
    global MeGUI_dary = 29
    LoadPlugin("C:\Users\user\Desktop\x264_encoding\MeGUI\tools\dgindexnv\DGDecodeNV.dll")
    DGSource("C:\Users\user\Videos\footage.HD.1080i.x264.English.dgi",fieldop=0)
    crop(272, 10, -264, -14)
    Spline36Resize(1280,height)
    QTGMC(Preset="Fast")
    Spline36Resize(width,720)
    LoadPlugin("C:\Users\user\Desktop\x264_encoding\MeGUI\tools\avisynth_plugin\UnDot.dll")
    Undot() # Minimal Noise
    I haven't noticed any frame jumping in the resulting mkv and the playback is butter smooth.
    Thank you very much for suggesting the DGNV tools, it solved my problem.

    Kind Regards
    Quote Quote