VideoHelp Forum
+ Reply to Thread
Page 1 of 2
1 2 LastLast
Results 1 to 30 of 31
Thread
  1. Member
    Join Date
    Jan 2010
    Location
    United States
    Search Comp PM
    This is a sister thread to this post: https://forum.videohelp.com/threads/366835-AVCHD-1080-60p-from-camcorder-to-Blu-ray

    I have two of these mastered .m2ts files that are intended to be two chapters on a DVD that can be played back on a typical regular DVD player.

    Here is the MediaInfo for one of the .m2ts files, for reference.
    Code:
    General
    ID                                       : 1 (0x1)
    Complete name                            : D:\Infinity Showcase - Summer 2014 - Snow White.m2ts
    Format                                   : BDAV
    Format/Info                              : Blu-ray Video
    File size                                : 7.22 GiB
    Duration                                 : 41mn 52s
    Overall bit rate mode                    : Variable
    Overall bit rate                         : 24.7 Mbps
    Maximum Overall bit rate                 : 35.5 Mbps
    
    Video
    ID                                       : 4113 (0x1011)
    Menu ID                                  : 1 (0x1)
    Format                                   : AVC
    Format/Info                              : Advanced Video Codec
    Format profile                           : High@L4.2
    Format settings, CABAC                   : Yes
    Format settings, ReFrames                : 4 frames
    Format settings, GOP                     : M=3, N=30
    Codec ID                                 : 27
    Duration                                 : 41mn 52s
    Bit rate mode                            : Variable
    Bit rate                                 : 23.5 Mbps
    Maximum bit rate                         : 26.0 Mbps
    Width                                    : 1 920 pixels
    Height                                   : 1 080 pixels
    Display aspect ratio                     : 16:9
    Frame rate                               : 59.940 fps
    Color space                              : YUV
    Chroma subsampling                       : 4:2:0
    Bit depth                                : 8 bits
    Scan type                                : Progressive
    Bits/(Pixel*Frame)                       : 0.189
    Stream size                              : 6.86 GiB (95%)
    
    Audio
    ID                                       : 4352 (0x1100)
    Menu ID                                  : 1 (0x1)
    Format                                   : AC-3
    Format/Info                              : Audio Coding 3
    Mode extension                           : CM (complete main)
    Format settings, Endianness              : Big
    Codec ID                                 : 129
    Duration                                 : 41mn 52s
    Bit rate mode                            : Constant
    Bit rate                                 : 256 Kbps
    Channel(s)                               : 2 channels
    Channel positions                        : Front: L R
    Sampling rate                            : 48.0 KHz
    Bit depth                                : 16 bits
    Compression mode                         : Lossy
    Delay relative to video                  : -33ms
    Stream size                              : 76.7 MiB (1%)
    I am using Encore CS6 for the authoring but TMPGEnc Video Mastering Works 5 for transcoding.

    As I understand it, the DVD-Video compliant spec would be 720x480, 29.97 interlaced, and there no provision to do progressive on a DVD.

    TVMW5 lets me change display mode to Progressive, 3:2 pulldown, Inverse 3:2 pulldown, and Progressive (2:2 pulldown) but I take it I don't want to use any of these and I should just leave the default, correct?

    If so, then there doesn't appear to be really anything I need to change from the default settings.

    The default DC component precision TVWM5 uses is 9bit, would there be any reason to change this to 10bit?
    Quote Quote  
  2. Member Cornucopia's Avatar
    Join Date
    Oct 2001
    Location
    Deep in the Heart of Texas
    Search PM
    Ok, now you want to go to DVD-Video?
    You now don't have the 720p60 option, but still have the 24p, 30p and 30i options (all actually slightly less due to NTSC stuff). As mentioned before, if you still are wanting fluidity of motion, you should go with 30i. You would already be losing something by going from 1920x1080(HD) to 720x480(SD), so I don't think losing 1/2 the fields would make all that much difference now.

    If by some chance you are still referring to AVCHD structure on DVD media, you should be able to build an AVCHD disc the same as before, just understand that the max bitrate constraint is now 18Mbps (due to limitations of DVD disc readout speed).

    Scott
    Quote Quote  
  3. Member
    Join Date
    Jan 2010
    Location
    United States
    Search Comp PM
    I'm offering people choice of DVD or BD, so that's why I am doing two sets of encodes. This will be DVD-Video, not AVCHD on DVD media.

    How would you get 30p on DVD-Video? Are you referring to doing MPEG-1 352x240/30p, or is there a DVD-Video compliant format using MPEG-2 720x480/30p ?
    Quote Quote  
  4. Member
    Join Date
    May 2014
    Location
    Memphis TN, US
    Search PM
    AVCHD would work also, but probably not on many DVD players.

    Originally Posted by HDClown View Post
    As I understand it, the DVD-Video compliant spec would be 720x480, 29.97 interlaced, and there no provision to do progressive on a DVD.
    You could, but you'd have to discard every other frame if starting with 60p. Resolution would suffer seriously and motion would look weird. Some players or TVs will treat it as interlaced anyway if they see "DVD".

    Originally Posted by HDClown View Post
    TVMW5 lets me change display mode to Progressive, 3:2 pulldown, Inverse 3:2 pulldown, and Progressive (2:2 pulldown) but I take it I don't want to use any of these and I should just leave the default, correct?
    Correct.

    Originally Posted by HDClown View Post
    The default DC component precision TVWM5 uses is 9bit, would there be any reason to change this to 10bit?
    Take the default. 9-bit processing often used to help prevent banding, but the output will be 8-bit YV12.
    - My sister Ann's brother
    Quote Quote  
  5. Member
    Join Date
    May 2014
    Location
    Memphis TN, US
    Search PM
    Originally Posted by HDClown View Post
    How would you get 30p on DVD-Video?
    Discard every 2nd frame. No one would recommend it.

    Originally Posted by HDClown View Post
    Are you referring to doing MPEG-1 352x240/30p, or is there a DVD-Video compliant format using MPEG-2 720x480/30p ?
    What is this problem you seem to have with interlaced video? 352x240 can't be interlaced. It's MPEG-1 only. Throw away every 2nd frame of your 60p and downsample to 352x480. You won't like it.
    Last edited by LMotlow; 3rd Sep 2014 at 14:51.
    - My sister Ann's brother
    Quote Quote  
  6. Member
    Join Date
    Jan 2010
    Location
    United States
    Search Comp PM
    No problem with interlaced video, just want to understand all the options. I agree that throwing away every second frame doesn't make any sense. The DVD quality is poor enough as it is (compared to the BD encodes)
    Quote Quote  
  7. Member
    Join Date
    May 2014
    Location
    Memphis TN, US
    Search PM
    1080p and 1080i don't translate well to SD much of the time. I've done it using Spline36Resize on progressive video, then interlacing and encoding to DVD or BluRay SD. I hear tell there's a problem going from square-pixel HD to non-square pixel SD, but the tech behind that is a big mystery to me. The only 1080 downsampling that worked OK for me was 23.97 telecined HD recordings off cable TV -- but those are resized progressive video, not interlaced for SD, and use 3:2 pulldown to get frame rate up to 29.97. Progressive 23.97 + telecine is valid for SD DVD and BluRay.

    For good ol' MPEG2 I still prefer the ancient TMPGEnc Plus 2.5 or HCenc. TVMW5 or TX264 for everything else.
    Last edited by LMotlow; 3rd Sep 2014 at 18:07.
    - My sister Ann's brother
    Quote Quote  
  8. Member Skiller's Avatar
    Join Date
    Oct 2013
    Location
    Germany
    Search PM
    The downside I see by using TVMW5 for the whole process, including the actual scaling and interlacing rather than just the MPEG2 encoding, is you don't have any control over some critical parameters that make the difference between a perfect and a decent downscale. Such as the resize algorithm and – often forgotten but very important – the vertical low-pass needed for interlaced video not to break up in a mess of twittering jagged lines whenever there is fine horizontal detail in the scene (read: Interline Twitter)

    My advice is therefore, do the scaling and low-pass in AviSynth and let TVMW5 only do the actual MPEG2 encoding.
    Last edited by Skiller; 4th Sep 2014 at 06:41.
    Quote Quote  
  9. Member
    Join Date
    Jan 2010
    Location
    United States
    Search Comp PM
    Originally Posted by Skiller View Post
    The downside I see by using TVMW5 for the whole process, including the actual scaling and interlacing rather than just the MPEG2 encoding, is you don't have any control over some critical parameters that make the difference between a perfect and a decent downscale. Such as the resize algorithm and – often forgotten but very important – the vertical low-pass needed for interlaced video not to break up in a mess of twittering jagged lines whenever there is fine horizontal detail in the scene (read: Interline Twitter)

    My advice is therefore, do the scaling and low-pass in AviSynth and let TVMW5 only do the actual MPEG2 encoding.
    I never really got a grasp on AviSynth. I searched around and found the following steps in a few places that indicate how to be able to open my source .m2ts files in VirtualDub so AviSynth can be run against them:

    Code:
    1. DirectShow input driver, Haali Media Splitter, ffdshow
    2. Open file in VirtualDub using "DirectShow input driver"
    Is this what I want to do to be able to run AviSynth on these files?

    I found recommendations to use ffdshow, ffdshow-tryouts, CoreAVC, and LAV Filters but all are at least 2+ years old. What's the best these days?

    From there, would you be willing to provide the script you would recommend to do the scaling/low pass to go from the source AVCHD 1920x1080/59.940p to get it to 720x480/29.970i ?
    Quote Quote  
  10. You can give it a taste using 60p 50p m2ts to DVD.zip , make sure you have Avisynth 2.5.8 32 bit installed and then drop m2ts onto that BAT. It will make everything to the end, including burning DVD if you set variables right (edit variables at the beginning of that batch file). It creates avisynth script using ffmpegsource and IResize (using low pass filter), encodes mpg using HcEncoder, encodes AC3 using Aften, making Video_TS using Muxman, then making ISO (a choice) using ImgBurn, then it can burn DVD using ImgBurn, all automatically,

    so you can dig up scripts and stuff from temp folder and start from there, it is always better to actually see it. I tried simple vertical blur of video before reinterlacing 60p after resizing it for DVD, I tried smart resize from Donald Graft (based on VD's Lee resizer) but this IResize (with low pass) is not bad at all, or you can use it to compare it with TVMW5.
    Script could be modified to just copy AC3 for example, but maybe later.
    Quote Quote  
  11. avs video script to get 30i for DVD, loading 60p HD m2ts with ffvideosource (progressive only) and ffaudiosource and IResize:
    Code:
    LoadPlugin("C:\ .... path of your dll ...\ffms2.dll")                                                      
    LoadPlugin("C:\ .... path of your dll ...\ColorMatrix.dll")                                                    
    ffvideosource("C:\ .... path of your m2ts ...\your_file.m2ts", cachefile="C:\ ......\something.ffindex")                
    IResize(720,480)                                                        
    function IResize(clip Clip, int NewWidth, int NewHeight) {                  
    Clip                                                                         
    SeparateFields()                                                             
    Shift=(GetParity() ? -0.25 : 0.25) * (Height()/Float(NewHeight/2)-1.0)       
    E  = SelectEven().Spline36resize(NewWidth, NewHeight/2, 0,    Shift)         
    O  = SelectOdd( ).Spline36resize(NewWidth, NewHeight/2, 0,   -Shift)         
    Ec = SelectEven( ).Spline36resize(NewWidth, NewHeight/2, 0,  2*Shift)        
    Oc = SelectOdd( ).Spline36resize(NewWidth, NewHeight/2, 0, -2*shift)         
    Interleave(E, O)                                                             
    IsYV12() ? MergeChroma(Interleave(Ec, Oc)) : Last                            
    Weave()                                                                      
    }                                                                           
    ConvertFPS("ntsc_double")                                                   
    ColorMatrix(mode="Rec.709->Rec.601", clamp=0)                                
    assumetff().SeparateFields().SelectEvery(4,0,3).weave()
    Code:
    LoadPlugin("C:\ .... path of your dll ...\ffms2.dll")       
    ffaudiosource("C:\ .... path of your m2ts ...\your_file.m2ts", cachefile="C:\ ......\something.ffindex")
    ResampleAudio(last,48000)
    script using ffdshow to load m2ts video and simple vertical blur:
    Code:
    LoadPlugin("C:\ .... path of your dll ...\ColorMatrix.dll")    
    DirectShowSource("C:\ .... path of your m2ts ...\your_file.m2ts", audio=false)                                                
    Spline16Resize(720,480)    
    Blur(0,1.0)  # something between 0.5 - 1.5, whatever works                                                  
    ConvertFPS("ntsc_double")                                                   
    ColorMatrix(mode="Rec.709->Rec.601", clamp=0)                                
    assumetff().SeparateFields().SelectEvery(4,0,3).weave()
    to resize to 720p:
    Code:
    DirectShowSource("C:\ .... path of your m2ts ...\your_file.m2ts", audio=false)                                                
    Spline36Resize(1280,720)
    Last edited by _Al_; 4th Sep 2014 at 11:15.
    Quote Quote  
  12. Member
    Join Date
    Jan 2010
    Location
    United States
    Search Comp PM
    _Al_,

    I ran a sample through with the script package you reference. I played back my full TVMW5 encode and the encode from your script side-by-side in VLC. I am using deinterlacing in VLC with mode of "Blend".

    The audio is way out of sync on the .VOB file created from the scripts, not sure why.

    There is one very obvious thing that is different between the two video files. I'm not sure of the correct name for it but basically what I see is in the TVMW5 during motion, I can see the interlacing more than in the video created from the scripts. It's much more apparent that the video is interlaced (again, deinterlacing is enabled) in the TVMW5 file.

    I am not seeing interline twitter, I am just seeing the interlacing be more evident.

    So, does this have to do with down scaling and/or the interlacing process (which I understand is all handled by AviSynth in the scripts) or an encoder issue (TMPGEnc vs. HCenc)
    Quote Quote  
  13. audio not in sync, I thought of something like that might happen, try to get rid of that line that resamples to 48000 in avisynth audio script, then maybe it is a good idea to input fps in scripts as well like:
    ffvideosource("C:\ .... path of your m2ts ...\your_file.m2ts", fpsnum = 60000, fpsden =1001, cachefile="C:\ ......\something.ffindex")

    and better to just copy original audio, it should be DVD compliant, 48000, and stereo or something

    yes , those artifacts, that what it is about, it is introduced while re-interlacing progressive footage, that script tries to take care of it (low pass filter), not sure if TMPGEnc treats that as well, perhaps not
    Quote Quote  
  14. Member
    Join Date
    May 2014
    Location
    Memphis TN, US
    Search PM
    Originally Posted by HDClown View Post
    I ran a sample through with the script package you reference. I played back my full TVMW5 encode and the encode from your script side-by-side in VLC. I am using deinterlacing in VLC with mode of "Blend".
    Don't use field blending. Select bob or yadif.

    Originally Posted by HDClown View Post
    The audio is way out of sync on the .VOB file created from the scripts, not sure why.
    Because the script apparently made no audio adjustment for the new frame rate. That can be done in Avisynth, too.

    What we really need is a sample cut from this mts video. You can do that without processing using something free such as DGAVCIndex, or maybe you already have software that can use smart-rendering to cut a few seconds of sample video. I don't use much free stuff any more, but maybe those who do can suggest a freebie that lets you make a short edit sample without damaging anything.

    Originally Posted by HDClown View Post
    So, does this have to do with down scaling and/or the interlacing process (which I understand is all handled by AviSynth in the scripts) or an encoder issue (TMPGEnc vs. HCenc)
    HCenc won't resize. Looks to me as if TVMW is using Bicubic, but don't quote me there. I usually resize in Avisynth anyway using one of the Spline varieties (Spline16Resize, Spline36Resize, etc). You'll also find a problem with banding effects from this kind of downscaling, and a few other things, but all that junk can be tweaked. One problem no one mentioned: you're working with different color matrices. HD uses rec709, SD uses rec601. Avisynth has a plugin for that.
    - My sister Ann's brother
    Quote Quote  
  15. Set VLC to "bob" , not "blend" . "bob" is most similar to what most HDTV's will be using . More expensive sets use more processing like adaptive deinterlacing, edge interpolation, and the flickering will be less noticable

    The twittering and flickering will be most evident on certain types of content - thin lines, sharp edges. Obviously test graphics like the one shown on wikipedia will flicker. If you have "organic rounded" edges , you won't notice it as much. Show a pan on something like brick walls, man made buildings, fences, and it will flicker like mad unless it's low passed.

    Low passing reduces the effective resolution, makes everything more blurry. So some people selectively low pass those parts that need it




    The colormatrix line is missing a comma:

    Code:
    ColorMatrix(mode="Rec.709->Rec.601clamp=0)  
    
    should be
    
    ColorMatrix(mode="Rec.709->Rec.601,clamp=0)
    Last edited by poisondeathray; 4th Sep 2014 at 11:47.
    Quote Quote  
  16. I cannot see any missing coma here, not sure.

    I uploaded new make DVD.BAT, so just change it and try if it is still out of sync.
    Quote Quote  
  17. Post 11? Maybe it's a browser / message board issue again ?
    Quote Quote  
  18. Maybe, I can see it in latest Firefox correctly.
    Quote Quote  
  19. Member
    Join Date
    Jan 2010
    Location
    United States
    Search Comp PM
    Originally Posted by LMotlow View Post
    Don't use field blending. Select bob or yadif.
    I don't see any visual difference in quality on the original TVMW5 encode using bob or yadiff compared to blend. Maybe it's a tiny bit better but not like the sample from the scripts form _Al_

    Originally Posted by LMotlow View Post
    What we really need is a sample cut from this mts video. You can do that without processing using something free such as DGAVCIndex, or maybe you already have software that can use smart-rendering to cut a few seconds of sample video. I don't use much free stuff any more, but maybe those who do can suggest a freebie that lets you make a short edit sample without damaging anything.
    Are you looking for a sample from the source file I am feeding into TVMW5/_Al_'s scripts?

    Originally Posted by LMotlow View Post
    HCenc won't resize. Looks to me as if TVMW is using Bicubic, but don't quote me there. I usually resize in Avisynth anyway using one of the Spline varieties (Spline16Resize, Spline36Resize, etc). You'll also find a problem with banding effects from this kind of downscaling, and a few other things, but all that junk can be tweaked. One problem no one mentioned: you're working with different color matrices. HD uses rec709, SD uses rec601. Avisynth has a plugin for that.
    I can control the resize method. The default is lanczos-3 with "output interlace with high quality resize" checked.

    The description for that checkbox is: "When checked, and the Format stage's Display mode is set to "Interlace", performs a high quality resize, slightly slowing the output. Unchecking this option does not cause an interlace picture to have its interlace structure compromised"

    The resize methods available are: normal, nearestneighor, bilinear, triangle, bicubic, lanczos-3.

    Would one of the other resize methods potentially reduce the effects that are more evident in the current TVMW5 encode I am comparing?
    Quote Quote  
  20. I did some tests with longer progressive m2ts and that ffmpegsource might be not reliable for this type of transport stream, I got at least one glitch in video, tried even threads=1 , which gave that glitch also, not sure about that out of sync thing now, my video was not long enough, but that fps should fix it.
    BUT, FFmpegsource seems to be better for progressive MP4 files, but that is not discussed here.
    Code:
    LoadPlugin("C:\ .... path of your dll ...\ffms2.dll")                                                      
    ffvideosource("your_file.m2ts", fpsnum=60000, fpsden=1001, threads=1, cachefile="C:\ ......\something.ffindex")

    But ffdshow and DirectShowSource loading into Avisynth seems to work just fine.
    Code:
    DirectShowSource("your_file.m2ts", fps=59.940, convertfps=true, audio=false)
    for audio avs script there is just video=false

    Also I tried to just copy original AC3 and make DVD with that, and it worked surprisingly , I used eac3to for demuxing
    Code:
    eac3to.exe "your_file.m2ts" 2: "demuxed_file.AC3" -LOG="demux.LOG"
    So I had corrected or made new, together three batch files, one uses ffmpegsource, other ffdshow and third uses ffdshow plus copies original Ac3 audio, 60p 50p m2ts to DVD.zip
    Last edited by _Al_; 5th Sep 2014 at 00:01.
    Quote Quote  
  21. Member Skiller's Avatar
    Join Date
    Oct 2013
    Location
    Germany
    Search PM
    Like others have mentioned, you cannot judge much if you use Blend deinterlace in VLC because the blending hides any potential artefacts by halving both the temporal and spatial resolution.


    Originally Posted by _Al_ View Post
    script using ffdshow to load m2ts video and simple vertical blur:
    Code:
    LoadPlugin("C:\ .... path of your dll ...\ColorMatrix.dll")    
    DirectShowSource("C:\ .... path of your m2ts ...\your_file.m2ts", audio=false)                                                
    Spline16Resize(720,480)    
    Blur(0,1.0)  # something between 0.5 - 1.5, whatever works                                                  
    ConvertFPS("ntsc_double")                                                   
    ColorMatrix(mode="Rec.709->Rec.601", clamp=0)                                
    assumetff().SeparateFields().SelectEvery(4,0,3).weave()
    I have to disagree with the Blur part. A vertical Blur of 1.0 will effectively average the fields, leaving a video with halved vertical resolution. You can actually use Blur(0, 1) as a blend-deinterlacer because of that.
    The point is, this may eliminate Interline Twitter pretty much completely but interlaced video is simply never meant to be completely free of it. If you watch footage shot with a high quality 3CCD native SD video camera you will find that there is some Interline Twitter because the effective vertical resolution is bigger than half the lines count. That's the sole reason interlace provides an advantage over 288p/240p. Trying to completely eliminate Interline Twitter would also eliminate that advantage.

    Coming from an HD source, after resizing we might end up with a video whose effective vertical resolution approaches the lines count and will therefore show excessive Interline Twitter upon display through a deinterlacer or a CRT. So the goal is to limit the effective vertical resolution to about 0.7 times the lines count (see Kell factor).

    For a low-pass you basically want Blur to be followed by Sharpen. After many subjective tests in past years I came up with these and prefer them over IResize.

    Code:
    #pick a line
    Blur(0, 0.6).Sharpen(0, 0.4) #mild, not for very detailed sources
    Blur(0, 0.7).Sharpen(0, 0.4) #sufficient for many sources
    Blur(0, 0.9).Sharpen(0, 0.5) #stronger
    Last edited by Skiller; 6th Sep 2014 at 09:05.
    Quote Quote  
  22. Member
    Join Date
    Jan 2010
    Location
    United States
    Search Comp PM
    So I'm trying to piece together all the various AviSynth stuff in the thread and understand everything, breaking out the portions to separate scripts to dealing with down sampling/interlacing the video and extracting the audio to use as-is, with the goal of coming out with a video file and an audio file I can load into TVMW5 so that it can do the straight MPEG-2 Encode to DVD-Video format, without having to process any of it's internal filters against the source files.

    AUDIO
    The audio in the m2ts file is 2 channel AC3 48Khz/16bit 256k CBR, which is DVD-Video complaint, so there is no reason to have to do any conversion on the format there. So I can just extract the AC3 stream from the source file using:

    Code:
    eac3to.exe "source.m2ts" "output.ac3" -LOG="extract_AC3.log"
    VIDEO
    On the video, it looks like I am best to use DirectShowSource to open the m2ts file, which means I need to make sure the correct DirectShow codec is used.
    • Does anyone have a recommendation on the best DirectShow codec to use: ffdshow, ffdshow-tryouts, CoreAVC, LAV
    • Once I choose a codec, how do I make sure this is the codec being used by AVISynth?
    • Do I need to install Haali Media Splitter?
    ==================================================

    For processing the video, here's each step of the script, in order of execuation with what I understand them to do. I also have questions in bold:

    Code:
    LoadPlugin("C:\AviSynth\ColorMatrix.dll")
    Load ColorMatrix plugin

    Code:
    DirectShowSource("C:\source.m2ts", audio=false)
    Load .m2ts file using system level defined DirectShow codec without processing audio.

    Should I be using convertfps=true?

    Code:
    Spline36Resize(720,480)
    Alternative to using IResize function. Resize to DVD-Video resolution

    Code:
    Blur(0, 0.7).Sharpen(0, 0.4)
    What is the point of the vertical blur and sharpen after resize? Is this a requirement because of not using IResize function or could you also run this if using IResize function instead of a straight Splice36Resize?

    Code:
    ConvertFPS("ntsc_double")
    What does this do?

    Code:
    ColorMatrix(mode="Rec.709->Rec.601,clamp=0)
    Correct color matrix due to difference in source file and destination desired

    Code:
    assumetff().SeparateFields().SelectEvery(4,0,3).weave()
    What does this do?

    ==================================================

    Additional questions:
    • Are the above steps in the correct order?
    • Is anything wrong and should be removed or changed?
    Quote Quote  
  23. Member Skiller's Avatar
    Join Date
    Oct 2013
    Location
    Germany
    Search PM
    Originally Posted by HDClown View Post
    What is the point of the vertical blur and sharpen after resize?
    See the 3rd paragraph of post #21 ("Coming from an HD Source..."). Simply spoken, you need this for interlaced video to look good.

    Except if you use IResize which does this "automatically". So either use Spline36resize + Blur().Sharpen() or just IResize.



    Originally Posted by HDClown View Post
    Code:
    ConvertFPS("ntsc_double")
    What does this do?
    It ensures the frame rate is exactly at NTSC field rate. Should not be necessary actually, but directshowsource may report a frame rate slightly off of that. If they match this does nothing. You can check what frame rate you get by using info() and commenting out ConvertFPS. You can look at the script's result in VirtualDub or any video player.



    Originally Posted by HDClown View Post
    Code:
    assumetff().SeparateFields().SelectEvery(4,0,3).weave()
    What does this do?
    This finally creates 29.97 fps interlaced video from your 59.94 fps (60p) video with "Top Field First" field order.


    Originally Posted by HDClown View Post
    • Are the above steps in the correct order?
    • Is anything wrong and should be removed or changed?
    Order is correct and everything is covered.


    Edit: Regarding DirectShowSource, yes, Haali Media Splitter is recommended and I would try ffdshow. If I'm not mistaken an icon will pop up in the tray whenever ffdshow is decoding something.
    Last edited by Skiller; 6th Sep 2014 at 10:32.
    Quote Quote  
  24. Member
    Join Date
    Jan 2010
    Location
    United States
    Search Comp PM
    Running this script:

    Code:
    DirectShowSource("D:\source.m2ts")
    Info()
    It shows FPS = 59.9402 (10000000/166833).

    Note that I am using LAV Splitter and that I get the same FPS if I use LAV Video Decoder or Microsoft DTV-DVD Video Decoder that is included with Windows 8.1

    If I add in ConvertFPS("ntsc_double") then FPS = 59.9401 (60000/1001), as expected.

    So, do I need to use ConvertFPS("ntsc_double") ?

    In regards to DirectShowSource, should I set convertfps=true or does it not matter here? I'm just not sure my source file is considered cfr or vfr.
    Quote Quote  
  25. Originally Posted by HDClown View Post
    Code:
    ColorMatrix(mode="Rec.709->Rec.601,clamp=0)
    Correct color matrix due to difference in source file and destination desired
    What does this do?
    It changes color space from BT.709 to BT.601. High definition video is BT.709, standard definition video is BT.601. If you do not do that, colors might be slightly off, especially skin tone, that is most striking visible part, it becomes more orange or red, not sure now.
    Clamp=0 causes not to change levels for highlights in video.

    To use direct show, just install latest ffdshow, 32 bit (even if you have 64bit OS mind you), use Avisynth is 32 bit also. But installing that ffdshow, you can use that DirectShowSource (...) line right away. ffdshow is not a codec these are filters.

    There is also possibility to use DGavcindex for loading avc video. I use it without problems also. It can load elementary avc stream into Avisynth. For example backing up BD's, (BD's video stream is transport stream, almost the same like avchd stream) I demux BD to hardisk, streams that are of some interest, then it is encoded and muxed into mkv. So you see, there could be more ways to get to destination. But in this case, ffdshow seems to be better choice.

    About making separate streams, m2v and AC3 (just demuxed if you want) using it for TVWM5, you can do it with that batch file also,
    1.just add one line: pause, just before muxing and script would stop, you can use those elementary streams from temp folder
    or 2. set delete_temp_folder=no, then temp folder would not be deleted, so you can copy those m2v and AC3 into TVWM5.
    or 3. you modify script where eac3to demux line would be:
    Code:
    %eac3to% "%name_input%" 2: "%destination_adr%.AC3" -LOG="%temp_adr%_eac3to_demux.LOG"
    that stores audio into destination folder, and then you change line :
    Code:
    call %create_m2v_video%
    for :

    Code:
    call %calculate_mpeg_bitrate%
    echo.
    echo HC.ini at: %~dp0tools\HcEncoder\HC.ini
    echo log file at: %temp_adr%_hc.encoder.log
    echo encoding: %destination_adr%.m2v
    echo.
    echo encoding started at: %date%  %time%
    echo encoding ...
    echo.
    if %pass_two% ==no   %Hcenc% -i "%temp_adr%.avs" -o "%destination_adr%.m2v" %pass_one_variables% -logfile "%temp_adr%_hc.encoder.log" 
    if %pass_two% ==yes  %Hcenc% -i "%temp_adr%.avs" -o "%destination_adr%.m2v" %pass_two_variables% -logfile "%temp_adr%_hc.encoder.log"  
    if %pass_two% NEQ no if %pass_two% NEQ yes (echo check variable pass_two , should be yes or no
    pause
    exit )
    echo.
    echo end of encoding video: %date%  %time%
    goto :deleting_temp
    simply to change destination for AC3 and m2v. Script ends by jumping to :delete_temp line, temps are deleted, script ends then ...
    Last edited by _Al_; 6th Sep 2014 at 13:33.
    Quote Quote  
  26. Member
    Join Date
    Jan 2010
    Location
    United States
    Search Comp PM
    What should I expect to see in regards to aspect ratios after I run the .m2ts file through AviSynth to resize and interlace?

    When I load the AVI into TVMW5 it's detecting aspect ratio as Pixel 10:11 (NTSC 4:3), is this the correctly detected aspect ratio? I can change this, other options are Pixel 1:1 (square), Pixel 40:33 (NTSC 16:9).

    When I go to encode in TVMW5, I can set a aspect ratio of 4:3 or 16:9 only. The default DVD-Video preset is choosing 16:9. TVMW5 will run a resize filter based on this setting and the source video setting and a "picture position" setting. It looks like if I use the picture position setting of "center", it will keep the source/target aspect ratios the same and add black bars or crop as necessary. Goal I'm trying to achieve is to not have TVMW5 have to run it's resize/interlace filters. The interlace is covered because the source file is no interlaced, so now I'm just trying to cover it not running another resize.

    For reference, the original source .m2ts file gets detected as Pixel 1:1 (square pixel)
    Last edited by HDClown; 7th Sep 2014 at 09:42.
    Quote Quote  
  27. Your avi, coming out of Avisynth, does not have aspect ratio, it is just uncompressed avi, not sure why TVMW5 is guessing this and how it influences output.

    Your input should be 720x480, interlaced, tff (or bff if you set bff in avisynth), square pixel 1:1, ..., then just set 16:9 flag as you did, that would not work?
    Quote Quote  
  28. Originally Posted by HDClown View Post
    Goal I'm trying to achieve is to not have TVMW5 have to run it's resize/interlace filters. The interlace is covered because the source file is no interlaced, so now I'm just trying to cover it not running another resize.
    AS long as your source is 720x480, TVMW5 will not resize, just reflag for correct display.
    Quote Quote  
  29. Member
    Join Date
    Jan 2010
    Location
    United States
    Search Comp PM
    Mediainfo shows the display aspect ratio on the AVI that came out after running AviSynth as 720x480, with 3:2 display aspect ratio. Using this .AVI file in TVMW5:

    Output aspect ratio is always set to 16:9
    • Input video set to Pixel 1:1 (Square) aspect ratio, the output file shows 720x480 16:9 in media info but it's squished horizontal. Not sure if it's adding vertical bars or not due to aspect ratio differences, or something is off with a display flag
    • Input video set to Pixel 10:11 (NTSC 4:3) aspect ratio, the output file is just like above when using Pixel 1:1 (Square). Squished horizontally.
    • Input video set to Pixel 40:33 (NTSC 16:9) aspect ratio, the output file shows 720x480 16:9 in media info and it displays correctly
    NOTE: There are also settings for just "Display 4:3" and "Display 16:9" and the output results are the same. I'm not sure how these differ than the "Pixel" settings.

    Using the video created using Pixel 40:33 (NTSC 16:9) setting, I compare this to the file created by HCenc, and unfortunately, the TVMW5 video is not that much better having been run through AviSynth first. The HCenc video still looks a little betterr when it comes to deinterlacing "artifacts". (Again, not sure of correct term, but when using Bob or Yadiff for deinterlacing in VLC, the TVMW5 video shows much more evidence of it being interlaced than the HCend video) I used the exact same AviSynth settings for both encoders.

    So, if TVMW5 is truly not running a resize filter again, then could it simply be a matter of quality of MPEG-2 encode itself between TVMW5 and HCenc as it relates to the deinterlacing "artifacts"? I have TVMW5 set with the highest possible quality settings.

    I see that per Al's script, HCenc is doing 1 pass with flags of -AUTOGOP 15 -CQ_MAXBITRATE 3 -AQ 2 -MAXBITRATE 8500. TVMW5 is set to 2 pass VBR with a max birate of 9200. TVMW5 is creating a 650 meg file vs a 450 meg file HCenc (this is just video streams in these test). In theory, the TVMW5 file should be better overall, but in this particular area of deinterlacing, the HCenc file views better to my eyes.

    I have not yet watched any of these samples through my DVD/BD player (Sony) or XBMC to see if I see similar results between TVMW5. Perhaps it's simply more evident on a computer with VLC than it would be through other players that people are more likely to use?

    Maybe I'm just looking at this too "closely" (no literal close) and no one is really going to see the differences and I should just pick something and be done with it.
    Last edited by HDClown; 7th Sep 2014 at 16:43.
    Quote Quote  
  30. Member
    Join Date
    Jan 2010
    Location
    United States
    Search Comp PM
    _Al_,

    I noticed that when using your ffdshow scripts to create the m2v via HCenc, the output m2v file has no time code. I can jump back/forward in the video but there is no time coding through the timeline.
    Last edited by HDClown; 7th Sep 2014 at 17:05.
    Quote Quote  
Visit our sponsor! Try DVDFab and backup Blu-rays!