VideoHelp Forum
+ Reply to Thread
Results 1 to 25 of 25
Thread
  1. Member
    Join Date: Dec 2007
    Location: United States
    Search Comp PM
    Hi. I'll start with what I am trying to accomplish. I want to put my digital tv caps of a tv show onto bluray using AVCHD. The files were all 704 x 480 transport streams captured with hauppauge tuner. All were 29.97 fps. Interlaced tff. I created a disc and burned it only to find the combing effect was bad. I Decided I needed to deinterlace the video and since I had to reencode now anyway, convert to h264.
    After some reading here I decided to use Megui. My scripting skills are not good so I started one with megui's script creator and pasted in some lines i found in the forum. I read about avisynth batch scipter so I made a template using the script I had made then made all the avs files. After converting some files I found that the aspect ratio seemed to have changed from 4 by 3 to 16 by 9. Did some more reading and added some lines to define the aspect ratio. Somehow I am causing severe audio sync issues. I think it has to do with megui changing the frame rate but I am not sure how to control it. I converted about 60 files and only about 10 had the 29.97 frame rate i was expecting. Most were 23.97 and some were 19.
    I used 2 different scripts.
    Here is one of the template scripts I used
    Clip="%CLIP%"

    LoadPlugin("C:\Users\Gerald\Downloads\Blueray tools\MeGUI_2418_x86\tools\dgindex\DGDecode.dll")
    DGDecode_mpeg2source(Clip+".d2v")
    LoadPlugin("C:\Users\Gerald\Downloads\Blueray tools\MeGUI_2418_x86\tools\avisynth_plugin\TIVTC.d ll")
    tfm(order=1).tdecimate(hybrid=1)
    #crop
    LanczosResize(720,480) # Lanczos (Sharp)
    # Set DAR in encoder to 4 : 3. The following lines are for automatic signalling
    global MeGUI_darx = 4
    global MeGUI_dary = 3
    #denoise
    TTempSmooth()

    Here is the other
    Clip="%CLIP%"


    LoadPlugin("C:\Users\Gerald\Downloads\Blueray tools\MeGUI_2418_x86\tools\dgindex\DGDecode.dll")
    DGDecode_mpeg2source(Clip+".d2v")
    #QTGMC( Preset="Slow" )
    QTGMC( Preset="Slow", Sharpness=1.2, SLMode=1 )
    SelectEven()
    #LoadPlugin("C:\Users\Gerald\Downloads\Blueray tools\MeGUI_2418_x86\tools\avisynth_plugin\ColorMa trix.dll")
    #ColorMatrix(hints=true, threads=0)
    #deinterlace
    #crop
    LanczosResize(720,480)
    global MeGUI_darx = 4
    global MeGUI_dary = 3
    TTempSmooth
    #Lanczos (Sharp)
    #denoise
    #TemporalSoften(4,4,8,15,2)

    Is there a way to tell megui what frame rate to use in the script? I tried to read about assume frame rate but didnt get how to use it and the syntax. My goal here is to put the entire series on bluray without the combing. I don't really care if it is in mpg2 or mp4 so long as I can keep the original frame rate and the audio sync

    thanks
    Jerry
    Quote Quote  
  2. Member
    Join Date: Feb 2008
    Location: India
    Search Comp PM
    u need to change audio framerate too to get proper syncronization. Use tfm audio tools for converting ur audio to ur desired framerate.
    Quote Quote  
  3. Member
    Join Date: Sep 2012
    Location: Australia
    Search Comp PM
    I want to put my digital tv caps of a tv show onto bluray
    Do you mean you want to store them on a disc or do you want an ACTUAL Blu Ray compatible disc?

    If you want full blu ray compatibility with SD you need either to keep the interlacing or upsize to 720p.

    The Framerate issue is being caused by tdecimate, TFM is an IVTC function that produces progressive frames from telecined with a few duplicate frames, tdecimate then removes the duplicate frames to restore the video to the assumed original framerate of 23.976. I'm not sure where the 19's came from because I've never done anything that dumb. The rest would be from the second script and it's doubtful they'll be all that much use for Blu Ray anyway. I won't say any more until you can tell us if you want actual blu ray compatible files.
    Quote Quote  
  4. Member
    Join Date: Dec 2007
    Location: United States
    Search Comp PM
    I want compatibility. The only reason I am trying blu ray is to keep the number of discs down. The unconverted files work and play in my player but the combing is really annoying. All I really want to do is deinterlace and resize to 720p. However Multi Avchd accepts the files without that by changing detected properties from 704 to 720. I have 120 episodes of the original Batman tv series that i am trying to work with. The 2 scripts are from my search to deinterlace. I just found parts of scripts for deinterlacing and patched these together. Obviously not the right way to go about it but I don't do scripts very well. I did not fully understand what I was putting together. Just trying to make something work.
    This is the output from Media info on one of the files I am working on

    General
    Complete name : X:\batman\Bluray disc 2\061 The Penguin's Nest.mpg
    Format : MPEG-PS
    File size : 384 MiB
    Duration : 22mn 56s
    Overall bit rate mode : Variable
    Overall bit rate : 2 342 Kbps

    Video
    ID : 224 (0xE0)
    Format : MPEG Video
    Format version : Version 2
    Format profile : Main@Main
    Format settings, BVOP : Yes
    Format settings, Matrix : Custom
    Format settings, GOP : Variable
    Duration : 22mn 56s
    Bit rate mode : Variable
    Bit rate : 1 912 Kbps
    Maximum bit rate : 15.0 Mbps
    Width : 704 pixels
    Height : 480 pixels
    Display aspect ratio : 4:3
    Frame rate : 29.970 fps
    Standard : NTSC
    Color space : YUV
    Chroma subsampling : 4:2:0
    Bit depth : 8 bits
    Compression mode : Lossy
    Bits/(Pixel*Frame) : 0.189
    Time code of first frame : 00:00:00;00
    Time code source : Group of pictures header
    Stream size : 314 MiB (82%)

    Audio
    ID : 189 (0xBD)-128 (0x80)
    Format : AC-3
    Format/Info : Audio Coding 3
    Mode extension : CM (complete main)
    Format settings, Endianness : Big
    Muxing mode : DVD-Video
    Duration : 22mn 56s
    Bit rate mode : Constant
    Bit rate : 384 Kbps
    Channel(s) : 2 channels
    Channel positions : Front: L R
    Sampling rate : 48.0 KHz
    Bit depth : 16 bits
    Compression mode : Lossy
    Stream size : 63.0 MiB (16%)

    Text
    ID : 224 (0xE0)-CC1
    Format : EIA-608
    Muxing mode : A/53 / DTVCC Transport
    Muxing mode, more info : Muxed in Video #1
    Bit rate mode : Constant
    Stream size : 0.00 Byte (0%)


    Thanks
    Quote Quote  
  5. Member
    Join Date: Sep 2012
    Location: Australia
    Search Comp PM
    If you want blu ray comatiblilty it needs to be interlaced (or fake interlaced) and it needs to be 720x480, blu ray only supports specific resolutions and frame rates. The media info on your video doesn't mention Scan type, I'm not sure what that means, but if you say it's interlaced then hopefully it's proper interlacing. I've never used MEGUI, but I know handbrake doesn't support interlaced encodes, if MEGUI is the same then you'll have to find anthoer way. It would be best to use x264 directly anyway just so you know nothing untoward is being done to the video before encoding. If you really need it progressive then you'll have to upscale to 720p because that's the only resolution Blu Ray supports at 59.94fps.

    Here's what you need to know:
    http://www.x264bluray.com/

    Code:
    MPEG2Source(*.d2v")
    #insert filters here
    AddBorders(8,0,8,0)
    #or here
    Quote Quote  
  6. Member
    Join Date: Sep 2012
    Location: Australia
    Search Comp PM
    You can just copy the audio as is but I think you'll need ccextractor to extract the captions from the video, then you can convert them to PGS with Subtitle Edit.
    Quote Quote  
  7. Member
    Join Date: Dec 2007
    Location: United States
    Search Comp PM
    So, I need to upscale to 720, leave it interlaced and change the frame rate to 59.94fps? Would doubling the frame rate this way help or eliminate the combing issue? If I am understanding this correctly what would be the code to change the frame rate from 29.97 to 59.94?Thanks for that information about ccextractor. I hadn't even thought about using subtitles till now.
    Quote Quote  
  8. Going by the scripts you used, the length of none of your files was changed and that's not the reason for the audio being out of synch. addu is dead wrong. You got 19.98fps for one (some?) because DGIndex was used in ForcedFilm mode with an IVTC thrown in afterwards. Very bad.

    Your interlacing issues could maybe be caused by using TTempSmooth as if the source was progressive. From the TTempSmooth doc:

    interlaced - (interlaced yv12 input)

    Set this to true if you are using ttempsmooth on a YV12 interlaced clip... otherwise set it to
    false.
    So, I need to upscale to 720, leave it interlaced and change the frame rate to 59.94fps?
    720 for Blu-Ray is, by definition, progressive. It can be 720p at 23.976fps, 24fps, or 59.94fps, all progressive. If you want to make it 720p (I wouldn't) and if your source can and should be IVTC'd, I'd make it 720p 23.976fps.

    If you make them 720x480 (by adding borders as suggested by ndjamena), they have to be interlaced 29.97fps, just as the source. Perhaps a short sample of your Batmans would say if they should be IVTC'd, or maybe bobbed to 59.94fps for 720p.

    Edit later: I decided that ndjamena is probably right in thinking your interlaced material for Blu-Ray was encoded as progressive and that's the reason your player isn't deinterlacing. And if they can be IVTC'd back to 23.976fps, maybe 720p at 23.976fps isn't so bad after all.
    Last edited by manono; 1st Feb 2014 at 01:52.
    Quote Quote  
  9. Member
    Join Date: Sep 2012
    Location: Australia
    Search Comp PM
    Batman WAS shot on film rather than video tape, so it's possible it may be able to be ITVC'd. It depends on what's been done to it during post-processing. But, yes, ITVCing would require up-scaling. (Unless someone knows how to apply soft pull-down to the stream???? if that's even possible.)
    Quote Quote  
  10. Member
    Join Date: Sep 2012
    Location: Australia
    Search Comp PM
    By the way, 720p is 1280720.

    720x480 is 480i.

    Just making sure we're aware of that, since they both contain the number 720.
    Quote Quote  
  11. Member
    Join Date: Sep 2012
    Location: Australia
    Search Comp PM
    Originally Posted by manono View Post
    You got 19.98fps for one (some?) because DGIndex was used in ForcedFilm mode with an IVTC thrown in afterwards. Very bad.
    Me thinkth some of the episodes have already been ITVC'd, OP didn't notice the different frame rate and that's where the 19fps came from.


    --pulldown 32

    is an x264 setting for soft telecining, I'm not sure BD authoring tools will accept it but you can try it out for us

    Sort the files, find any with a 23.976 frame rate and put them aside.

    Code:
    MPEG2Source(*.d2v")
    TFM(slow=2)
    TDecimate()
    AddBorders(8,0,8,0)
    if that leaves interlacing artefacts try

    Code:
    SetMemoryMax(1024)
    MPEG2Source(*.d2v")
    QTGMC()
    RequestLinear(13, 26, 8, false, false)
    SRestore(speed=-1, frate=23.976, thresh=12)
    AddBorders(8,0,8,0)
    (I don't think many encoders need SRestore to cache it's results, if you're using X264 maybe someone can comment on how well it caches it's look-a-head and whether it's worth adding the setting in. Since I use UT, for me at least, it's not necessary. TDecimate may be sufficient instead of srestore but QTGMC does tend to blend frames so srestore may be the better option)

    Just to see what it looks like and we can find a way to iron out any artefacts once we know what we're dealing with.
    Last edited by ndjamena; 1st Feb 2014 at 05:57.
    Quote Quote  
  12. Originally Posted by ndjamena View Post
    Originally Posted by manono View Post
    You got 19.98fps for one (some?) because DGIndex was used in ForcedFilm mode with an IVTC thrown in afterwards. Very bad.
    Me thinkth some of the episodes have already been ITVC'd, OP didn't notice the different frame rate and that's where the 19fps came from.
    I don't. He said these are TV caps and that all are interlaced 29.97fps.

    But with a sample to check we could quickly figure it out, even if fazerpileit can't.
    Quote Quote  
  13. Member
    Join Date: Sep 2012
    Location: Australia
    Search Comp PM
    Hmmmm, according to Wikipedia digital TV in America allows content to be streamed as 23.976 fps, soft pull-down is only mentioned in the DVD category but I suppose it's possible it's used on TV as well.

    Um, there are 120 episodes of Batman, you're going to have to be more specific about what exactly you want a sample of. Remember, he used two different scripts and got 3 different results...
    Quote Quote  
  14. Member
    Join Date: Dec 2007
    Location: United States
    Search Comp PM
    Well, it's obvious I know even less about this than I thought. I thought 720 was 720x480. Not 1280x720, so thanks for that. I was letting what I thought I knew get in the way while trying to read the forum before posting. Several other bits of "knowledge" were also in the way. I am uploading a short clip. The clip is an action sequence that I cut out using Videoredo tv suite. All videos were edited with videoredo plus. Editing was simply removing commercials. I used Batchdemux overnight to demux 60 files. All that I have looked at with Medinfo show the video to be 704*480 29.970 fps ntsc. I have made a few blu ray test discs using multiAvchd,and rewritable media, that played fine except for the combing effect

    Thanks
    Attached Files
    Quote Quote  
  15. Even your capture is out of synch by something like -150ms. You can easily tell when Catwoman claps her hands at 16 seconds in. Maybe you dropped frames when capping, maybe cutting it caused it (not likely). Is your final result more noticeable than that? Is the delay greater?

    The episode(s) has/have been time-compressed. The complete unedited episodes are longer but had fields removed to make them shorter so more ads could be inserted. The 'effective' framerate is greater than 23.976fps, to make it play faster and make the total length less. I didn't bother trying to figure it out as Blu-Ray makes no allowances for that. A simple IVTC:

    TFM().TDecimate()

    deinterlaces a ton of frames but might be OK if you're not too picky. This is a good reason to bob it to 59.94fps for 720p and Blu-Ray - you won't have to do anything really difficult. Maybe a script something like this:

    Yadif(Mode=1)#or the better and slower QTGMC
    Lanczos4Resize(960,720)#or the better and slower nnedi3_rpow2
    AddBorders(160,0,160,0)


    Or keep it interlaced 29.97fps and add borders for 720x480 Blu-Ray. And if you can't use interlaced encoding for x264, you could keep it MPEG-2 which is allowed for Blu-Ray. It's easy to encode interlaced for MPEG-2. Unfortunately, for Blu-Ray it has to be 720x480 and:

    AddBorders(8,0,8,0)

    forces a reencode of the entire thing. If you're willing to make it DVD rather than Blue-Ray, you wouldn't have to do anything but author it. 704x480 is perfectly legal for NTSC DVD.
    Last edited by manono; 1st Feb 2014 at 18:52.
    Quote Quote  
  16. Member
    Join Date: Dec 2007
    Location: United States
    Search Comp PM
    The bad files were minutes off by the end. Before Posting I had demuxed several and found that the audio would be say apx 23 minutes and the video would be about 19. But if I demuxed the original file the times would be the same. I intend to use your script examples and see how it goes. I have 2 methods for creating d2v files. Megui has its file indexer and I also have dgmpgdec158 dgindex. does it matter which one I use? I have done many dvds with similar material and not had these problems, but I want to learn to do blu ray. Thanks to all for the input and help. I will post results when I have time to get some results.
    Thanks
    Quote Quote  
  17. Member
    Join Date: Sep 2012
    Location: Australia
    Search Comp PM
    Don't bother with my scripts, as manono said, the TV station sped the video by removing fields, meaning IVTCing them won't achieve much and there's no original frame-rate to return it to. You said there was still interlacing in your original encodes and that's most likely why. I tried using TFM on the buffy episodes I'm currently working on and it's deinterlacing abilities aren't anything to speak about, I've had to resort to QTGMC'ing them to get the progressive frames back. The best options you have left are to encode them as they are, ie 480i or run them through QTGMC and encode as 1024x720, 59.94fps. There are always other options of course, but no one who cares about quality will help you with them, it's a matter of pride.
    Quote Quote  
  18. Originally Posted by fazerpileit View Post
    I have 2 methods for creating d2v files. Megui has its file indexer and I also have dgmpgdec158 dgindex. does it matter which one I use?
    I don't use MeGUI and always use DGIndex for MPEG sources. You also get the audio and if it was in synch before, it should be afterwards as well. Unless there's some VFR funny business going on.
    Quote Quote  
  19. Member
    Join Date: Sep 2012
    Location: Australia
    Search Comp PM
    Demuxed timings are meaningless. Unless it stays like that once it's been muxed again, it's not a problem.

    See:

    http://forum.videohelp.com/threads/362079-Demuxed-video-showing-wrong-timing
    Quote Quote  
  20. Member
    Join Date: Feb 2008
    Location: India
    Search Comp PM
    tfm means the film machine a software a freeware in which there is chance to convert the framerate of an audio to the desired framerate.
    Quote Quote  
  21. Originally Posted by addu View Post
    It means tritical's field matcher, part of the TIVTC (tritical's inverse telecine).
    Quote Quote  
  22. Member
    Join Date: Dec 2007
    Location: United States
    Search Comp PM
    Update. I have finished encoding half of the files using hcencoder and this template script

    Clip="%CLIP%"


    DGDecode_mpeg2source(Clip+".d2v")
    global MeGUI_darx = 4
    global MeGUI_dary = 3
    QTGMC( Preset="fast", Sharpness=1.2, SLMode=1 )
    SelectEven()

    AddBorders(8,0,8,0)

    Actual Scripts were written using Avisynth batch Scripter
    Muxing the files into m2ts format using Tsmuxergui and playing with vlc to check sync. There is some small amount of audio sync issues as in the uploaded clip but nowhere near what I was experiencing before. I have to pay attention to notice it. I found that in the megui settings force film was checked for the included file indexer. That was how I was creating the .d2v files on the files that I was having trouble with. I used this version of Dgindex to make the latest d2v files. dgmpgdec158. Now everything is 720x480 29.97 fps mpeg2 and I am satisfied with the results. I still cant script very good but seem to have this project in hand now.
    Thanks to all for the help and advice.

    Jerry
    Quote Quote  
  23. Originally Posted by fazerpileit View Post
    There is some small amount of audio sync issues as in the uploaded clip but nowhere near what I was experiencing before.
    If the audio is off by the same amount all the way through, it's a simple matter to either remove the delay in the audio before muxing or to set a delay when muxing.
    Quote Quote  



Similar Threads