VideoHelp Forum
+ Reply to Thread
Results 1 to 9 of 9
Thread
  1. I'm curious how audio encoding works with the script below? Ideally I just want to copy the audio track into the new MKV file. Does this script do that? I'm having a hard time understanding how it works. Also, Do I need use AssumeTFF/BFF with QTGMC?

    SetFilterMTMode("FFMPEGSource2", 3)
    SetFilterMTMode("DEFAULT_MT_MODE", 2)
    SetFilterMTMode ("QTGMC", 2)
    FFMPEGSource2("name.mkv", atrack=1)
    AssumeTFF()
    QTGMC(preset="Placebo", EdiThreads=3, NoiseProcess=0)
    BicubicResize(768,576,0,0.75)
    Crop(0, 4, 0, 570)
    Quote Quote  
  2. Originally Posted by LaserBones View Post
    Ideally I just want to copy the audio track into the new MKV file.
    You can do this with MkvToolNix, without scripts or encodings.
    Quote Quote  
  3. Whenever you process video or audio with Avisynth, it gets decompressed "on-the-fly", then transmitted as-is (as "virtual" uncompressed data) to whatever program does the editing / encoding. So the audio that comes out of Avisynth is uncompressed PCM, it's no longer the compressed format which was in the source, even if no audio processing was done, so it would have to be re-compressed at the encoding stage (which degrades the quality).
    But as mentioned above, you can process the video as required, then mux the untouched audio with the processed video output. In which case you can use FFVideoSource() which only processes the video stream. If you don't use any filter that changes the framerate or removes frames, it should stay synchronized.

    As far as I know (never actually tested it) the "Placebo" preset is very intensive / slow and barely better than the one before, "Very slow", which already yields a very high quality deinterlacing (even at "Medium" preset QTGMC is much better than the likes of Yadif, albeit slower). Someone may chime in to provide a more in-depth explanation.

    If it's a straight rip from a standard PAL DVD in 720x576, then there's little point in resizing to 768x576, unless the output has to be played on a device which doesn't support anamorphic encoding / non-square pixels. The resizing causes a loss of sharpness (which can be visually compensated by using a "sharp" resizer like BicubicResize) and a higher bitrate requirement to get a similar subjective quality.

    Also, I don't quite understand what "Crop(0, 4, 0, 570)" is supposed to accomplish...
    Did you RTFM, and/or preview the result with VirtualDub2 or AVSPMod ?
    Quote Quote  
  4. Originally Posted by abolibibelot View Post
    If it's a straight rip from a standard PAL DVD in 720x576, then there's little point in resizing to 768x576, unless the output has to be played on a device which doesn't support anamorphic encoding / non-square pixels. The resizing causes a loss of sharpness (which can be visually compensated by using a "sharp" resizer like BicubicResize) and a higher bitrate requirement to get a similar subjective quality.
    The video off the DVD is at 720x576 and you're right it is anamorphic as it plays at 768x576. However if I don't add the BicubicResize(768,576,0,0.75) the end result is square pixels at 720x576. again, that is using this script:

    SetFilterMTMode("FFMPEGSource2", 3)
    SetFilterMTMode("DEFAULT_MT_MODE", 2)
    SetFilterMTMode ("QTGMC", 2)
    FFMPEGSource2("name.mkv", atrack=1)
    AssumeTFF()
    QTGMC(preset="Placebo", EdiThreads=3, NoiseProcess=0)
    BicubicResize(768,576,0,0.75)
    Crop(0, 4, 0, 570)

    Am I doing something wrong? Is there a way to keep the non-square pixels while encoding?

    P.S. To answer your question about the cropping. It's to trim some artifacts out of the video. I also am using Placebo as I'm using Topaz Video Enhance to upscale after I QTGMC.
    Quote Quote  
  5. Member Cornucopia's Avatar
    Join Date
    Oct 2001
    Location
    Deep in the Heart of Texas
    Search PM
    Since avisynth works only with the raw pixels, it is ignorant of the aspect ratio. Pass it through, aka do NOTHING to the scale/size or cropping. Then use an encoder that supports anamorphic encoding (many do), and explicitly tell it to encode with the AR of the source (in this case, sounds like that would be 4:3).
    No need to resize & crop something you are going to be resizing again later, that just compounds the error.


    Scott
    Quote Quote  
  6. Would setting the proper aspect ration in mkvtoolnix be the same thing?
    Quote Quote  
  7. Member Cornucopia's Avatar
    Join Date
    Oct 2001
    Location
    Deep in the Heart of Texas
    Search PM
    Depends. Some encoders set the AR flag in the video stream (when applicable to format). But one can also set an AR flag in the container (depending on format). This last is what MKVtoolnix is doing.

    Some players respond to one, or to the other, or to both, or to neither. And if both, they may not be consistent as to which takes priority (likely should be the video stream).

    Scott
    Quote Quote  
  8. Originally Posted by LaserBones View Post
    Would setting the proper aspect ration in mkvtoolnix be the same thing?
    If your video is x264 encoded then you can change the DAR (Display Aspect Ratio) lossless without reencoding:
    Code:
    ffmpeg -i input.mp4(mkv) -aspect 4:3 -c copy output.mp4(mkv)
    Aspect could be any value g.e. 16:9, 1.666, 1.85, 2.35 and so on.
    Quote Quote  



Similar Threads

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