VideoHelp Forum
+ Reply to Thread
Page 1 of 2
1 2 LastLast
Results 1 to 30 of 34
Thread
  1. Member
    Join Date
    Apr 2012
    Location
    Hungary
    Search PM
    I have a project in Sony Vegas with input files: MTS 1920x1080 50i 24mbps. I rendered them in PAL DVD Widescreen 25p, using interpolation as deinterlace method. Compared to my expectations the outcome is not bad at all. I wonder however if it could be done better then this? As the project is at advanced stage, I would be interested in solutions when the deinterlacing and resizing is done on exporting. So something like leaving the files untouched in Sony Vegas and process the edited material through Debugmode Frameserver. Can AviSynth do it better, or not worth the effort?
    Image Attached Files
    Quote Quote  
  2. QTGMC in AviSynth is a much better deinterlacer than anything in Vegas. Though when downscaling like that it may not worth it. Upload your source video. Someone will do the same with AviSynth.

    Notice how thin horizontal lines are aliased and buzzing in your video -- like the line at the edge of the guitar above the switch. The line will be smooth and the buzzing will be gone with QTGMC.
    Last edited by jagabo; 24th Jul 2018 at 20:17.
    Quote Quote  
  3. Member
    Join Date
    Apr 2012
    Location
    Hungary
    Search PM
    I have attached the original. There is a sharpen effect applied to the video, maybe that also played a role in causing that artifact, I am not sure...
    Image Attached Files
    Quote Quote  
  4. Your source is encoded interlaced but the frames are progressive. So there's no need to deinterlace. I just resized to 720x576 and assumed rec.709 colors. I'm not really set up for MPEG 2 encoding so I'm uploading h.264 in MKV. You should be able to get something similar in Vegas.
    Image Attached Files
    Quote Quote  
  5. Member
    Join Date
    Apr 2012
    Location
    Hungary
    Search PM
    True, when I dismiss all deinterlacing settings the outcome is still okay. However it quite similar to what I originally got and attached in the opening post.

    What was the code you used to make it? Your version seems a bit smoother to me. MKV out put is not good for me though, it would go directly to the DVD creator.
    Quote Quote  
  6. The script I used was:

    Code:
    LWLibavVideoSource("00121_new.ts") 
    AssumeFPS(25)
    Spline36Resize(720,576)
    But I'd recommend using a bilinear resize instead of spline36. The source has some over bright whites that should be pulled down. And assuming the source is rec.709 (usually used for HD video) it should be converted to rec.601 for DVD:

    Code:
    LWLibavVideoSource("00121_new.ts") 
    AssumeFPS(25)
    ColorYUV(gain_y=-25) # a little darker
    ColorMatrix(mode="rec.709->rec.601") # HD colors to SD colors
    BilinearResize(720,576) # softer resize
    Then use any MPEG 2 encoder that supports AviSynth scripts. Like HCGui (it's a good encoder and it's free).
    Quote Quote  
  7. Mpeg2 version with second script in the above post.
    Image Attached Files
    Quote Quote  
  8. Member
    Join Date
    Apr 2012
    Location
    Hungary
    Search PM
    I managed to do something similar by exporting the project through Debugmode Frameserver to HCGui by avi as served file. The smoothness is okay, it looks a bit darker though than yours. One problem, however, is that the TV doesn't play the mpg file. I wonder what causes it? It plays the mpg coming from SonyVegas, but this one, it doesn't. Maybe I set the bitrate too high? I tried to copy the values from the Sony Vegas preset though. These were the settings

    Code:
    AviSource("C:\Users\Bence\Videos\Liberation.avi")
    AssumeFPS(25)
    ColorYUV(gain_y=-25)
    ColorMatrix(mode="rec.709->rec.601") 
    BilinearResize(720,576)
    (Maybe the video would benefit from adding a little sharpening to the code)

    HCGui settings:
    Image
    [Attachment 46186 - Click to enlarge]

    Image
    [Attachment 46187 - Click to enlarge]

    All the other settings are on default

    Then I muxed the video with the audio in ImagoMpeg-Muxer
    Image Attached Files
    Quote Quote  
  9. Member
    Join Date
    Mar 2008
    Location
    United States
    Search Comp PM
    I don't think the Chroma sampling should be 4:2:2 this is not standard for DVD, it should be 4:2:0.

    Not sure where this is coming from, possibly the Avisource codec, or the source file
    You could try adding ConvertToYV12() to the script (perhaps before the resize) and see
    if the ChromaFormat line disappears from the "current HC.ini" on the settings 1 tab
    Quote Quote  
  10. Yes, few devices will support MPEG 2 with 4:2:2 chroma subsampling. Specify 4:2:0. On my computer the source filter was putting out 4:2:0 so I didn't have to specify it. Add ConvertToYV12() to the end of the script. Also check the Settings 3 tab on HCGui. And try pressing the Make DVD Compliant button on the Main tab.
    Last edited by jagabo; 25th Jul 2018 at 19:46.
    Quote Quote  
  11. Member
    Join Date
    Apr 2012
    Location
    Hungary
    Search PM
    I modified the code and set the settings to 4:2:0, and now the video starts without problems on all TVs. However there is still a problem. On computer and on one of my Philips TVs, the file plays perfect and the image is good. However on my other Philips TV the image is bad. That is, the edges, especially the strings on the guitar are jagged, just like in a badly resized interlced video. What can cause this? Isn't it because the HCEnc output file has BFF flag, and the TV interprets it as interlaced, in spite of that it is progressive (I selected it in the settings)?

    The interesting is: I created another file exported directly from Sony Vegas. That file was deinterlaced by Vegas and resized to DVD size. The same source, the same output format, yet, that one plays fine on all the TVs, no jagged edges.

    So what can be the problem here with the HCEnc procedure? Shouldn't I make the encoder to deinterlace the input file instead of just considering it progressive?

    Here is my code again with both files attached:

    Code:
    AviSource("C:\Users\Bence\Videos\Liberation.avi")
    AssumeFPS(25)
    ColorYUV(gain_y=-25)
    ColorMatrix(mode="rec.709->rec.601") 
    BilinearResize(720,576)
    ConvertToYV12()
    Image Attached Files
    Quote Quote  
  12. I am able to duplicate the problem here. MediaInfo reports both your files as progressive. But GSpot reports the HCEnc video is interlaced. The jaggies you are seeing are from the player's deinterlacer. It looks like some programs think HC's output is interlaced for some reason. It has nothing to do with the TFF/BFF flags or the AviSynth handling. You can work around this by using another program (VirtualDub2?) to output a lossless or uncompressed AVI then Vegas to do your encoding from that AVI.
    Quote Quote  
  13. Member
    Join Date
    Apr 2012
    Location
    Hungary
    Search PM
    The problem is that Vegas very often produces videos that has occasional frame drops on computer or TV. That's why I'd prefer having the rendering done with some other tool. I will try to check whether the DVD produced from the HCEnc output files confuses the TV or not, if not, then I will just render the projects this way that I have done it.
    Quote Quote  
  14. Member
    Join Date
    Mar 2008
    Location
    United States
    Search Comp PM
    For HCenc you can set the following flag, here's the excerpt from the pdf:

    *PROG_SEQ
    This command sets the progressive_sequence flag in the sequence extension header, this means
    the encoded stream contains only progressive frames. The *PROGRESSIVE command needs to
    be set also.
    Quote Quote  
  15. Originally Posted by Bencuri View Post
    The problem is that Vegas very often produces videos that has occasional frame drops on computer or TV.
    Not in my experience

    But the one situation where this might occur is VFR source video. But that is an underlying problem with the source.
    Quote Quote  
  16. Originally Posted by davexnet View Post
    For HCenc you can set the following flag, here's the excerpt from the pdf:

    *PROG_SEQ
    This command sets the progressive_sequence flag in the sequence extension header, this means
    the encoded stream contains only progressive frames. The *PROGRESSIVE command needs to
    be set also.
    Thanks for that. In HCGui it can be found on the Settings 2 tab as "progressive sequence". So on the Settings 1 tab set interlacing options to progressive (TFF, BFF don't matter) and on the Settings 2 tab set progressive sequence.
    Quote Quote  
  17. Member
    Join Date
    Apr 2012
    Location
    Hungary
    Search PM
    I ticked progressive sequence on the HCGui settings panel, and now the videos play fine. Thanks for helping!
    Quote Quote  
  18. Member
    Join Date
    Apr 2012
    Location
    Hungary
    Search PM
    Guys! Sorry to bring this up again, but there is still a problem with the HCEnc output mpeg file. The quality now is okay, much better than the file Sony Vegas renders, and plays fine on all devices. Strangely however, when I burn it on DVD, the DVD plays fine on the computer, on the desktop DVD player however, the video and audio is out of sync. First I thought it is a DVD authoring problem, but when I export the mpeg directly from Sony Vegas with its mpeg converter, burn that file onto DVD, the DVD is played fine on the same desktop player.

    I started to examine the mpeg that HCEnc creates. After muxing it, it seems as if the audio was a bit late to the video when played back on any device, however it may be subjective, and not as much late as in case of the burnt DVD played back on the desktop player. In case I import it into Vegas and match it to the project audio, I can see the mpeg audio is a bit late , but only with 5 milliseconds, that should not be visible I think. In the DVD Vob file that is converted from the mpeg, the audio is 20 milliseconds ahead to the project audio. This is strange, because when played back on the desktop player the opposite happens, the audio seems to be late. I experimented with delaycut, and it seems it is late about 2-300 milliseconds. This is strange because as I wrote, compared to the project audio in the Vegas Editor, the waves are only slightly out of sync. Unfortunately it doesn't help setting a delay of -2-300 milliseconds to the mpeg file, because then what happens on the desktop DVD player it is played fine, but on the computer DVD player the audio comes early.

    I tried solving the problem by updating the firmware in the desktop dvd player, it resulted in no change.

    I burnt the DVDs with the newest Corel DVD Movie Factory Pro 8, without reconverting of the mpeg, both the HCEnc mpeg and the Sony Vegas mpeg. As the DVD with the Sony Vegas mpeg plays fine on the desktop player, too, I guess it is not the Corel Software that causes the problems.

    Isn't it possible that the HCEnc output is a kind of file that confuses either the Corel Software or the desktop player? You can see above what settings I used in HCEnc to create the file, anything that might worth to change and try? Of course this time I used 4:2:0, and progressive sequence.

    I add here the two mpeg files I am writing about.
    Image Attached Files
    Quote Quote  
  19. One difference is you're using different audio AC3, MP2 . Not sure if that is a contributing factor; but since this is an audio related issue now, wouldn't it make sense to use the same audio ?
    Quote Quote  
  20. Member
    Join Date
    Apr 2012
    Location
    Hungary
    Search PM
    I tried to mux the audio of the Sony version to the HCEnc version but it makes no difference.

    But I found something about this issue online: "The problem comes along when the Mpeg2 files are authored to the dvd and burning commences. In the authoring, the VOB files which are created, discard the programme time stamp information and this can lead to very small audio and video sync problems. The more edit points there are, the greater the problem will become. Straight cuts are generally not as bad as using transitions at edit points."

    What I don't understand though, why is it that in spite of that it comes from the same project, the Sony version doesn't have playback issue in the end.
    Quote Quote  
  21. Member
    Join Date
    Apr 2012
    Location
    Hungary
    Search PM
    My problem with the audio sync of these files that I mentioned were solved, it was not a problem of Vegas nor HcEnc but TSMuxer that I used to join files.

    The files are now resized fine, but I don't understand now how to process them interlaced? You told me in spite of the TFF flag the frames are progressive. But when I play back the original camcorder files recorded in 50i mode, they look fluent, like 50i, but in case I process these as 25p, they are not as fluent, and I miss that. Not a very big problem, but would be better. How to interlace it in avisynth? Simply adding AssumeTFF to the end of the code, so:

    Code:
    AviSource("C:\Users\Bence\Videos\Liberation.avi")
    AssumeFPS(25)
    ColorYUV(gain_y=-25)
    ColorMatrix(mode="rec.709->rec.601") 
    BilinearResize(720,576)
    AssumeTFF()
    ConvertToYV12(interlaced=true)
    Quote Quote  
  22. First you said Liberation.mpg (720x576 progressive) was your source in post #1. Then you said 00121_new.ts () was your source in post #3. Now you're working liberation.avi. Stop jerking us around and provide a sample of your actual source.

    But guessing liberation.avi is 1920x1080 interlaced you need to double frame rate deinterlace before resizing, then re-interlace before encoding (assuming you're looking for interlaced DVD). Your current code converts 1920x1080i25 to 720x576p25 as a side effect of downscaling.
    Quote Quote  
  23. I think:

    1) 00121_new.ts is the original, just cut with tsmuxer
    2) Liberation.avi is frameserved from vegas with dmfs

    The original, if 00121_new.ts is really representative of the real original , is really 25p . It should not play more fluent , and definitely not like true 25i (or call it 50i if you want)
    Quote Quote  
  24. also Vegas serves project properties, not clip properties, so whatever your clip truly is, you need to have that set in project properties
    Quote Quote  
  25. Member
    Join Date
    Apr 2012
    Location
    Hungary
    Search PM
    Yes, like poisondethray says:

    Liberation.mpg would be the rendered output, in the opening post it comes directly from Vegas
    00121_new.ts is cut from the original by TSMuxer
    Liberation.avi is the frameserved file, that is what I need to add to HCEnc

    So the .ts file has to be considered as original.

    In Vegas, as you said the frames are set progressive, I set project properties to 25 frames progressive, and also clip properties to 25 frames progressive, and this is what will be maintained in the frameserved avi, or at least I guess, because when checking it with Mediainfo, it reports no framerate info for that file, so I can only guess. If I consider what _Al_ says, the project and clip should be set 25 frames TFF though and frameserved like that, so which is the correct way now?

    Why I raised this interlacing idea is because when I watch the interlaced clips from this camcorder they do look different than 25p. They do not have that strobing of high contrast areas like 25p, that's why it's totally strange to me how it can be that the frames are 25p actually (maybe the camcorder only flags the files interlaced and records in 25p actually, and this is the 50i mode of the camcorder???). I would like to preserve that fluent playback on the DVD. I can go on and export in 25p as well, the image is okay and useable, but if the original playback characteristics could be preserved, it would be better. I am just confused how to do it in avisynth, as here I don't need to deinterlace, only interlace.
    Last edited by Bencuri; 1st Sep 2018 at 02:28.
    Quote Quote  
  26. Encoding a 25p video in interlaced mode will not make it play smoother. The picture content will still be 25p. You don't have fluid 25i content to start with. True 25i content has 50 different half picture per second. When you watch that on TV you see 50 different motion increments every second. 00121_new.ts is encoded interlaced but the frames are 25p. It's never going to be smooth. You will always see only 25 motion increments per second on TV. Unless you use some motion interpolating filters to create 50p -- but that type of filter often delivers geometric distortions.
    Last edited by jagabo; 1st Sep 2018 at 09:56.
    Quote Quote  
  27. Originally Posted by Bencuri View Post
    If I consider what _Al_ says, the project and clip should be set 25 frames TFF though and frameserved like that, so which is the correct way now?
    No, if clip is truly progressive (does not matter what mediainfo says) , project properties should be progressive and you should interpret footage as progressive as well in properties for clip - > right click a clip, properties, media , field order - None(progressive).
    Quote Quote  
  28. Member
    Join Date
    Apr 2012
    Location
    Hungary
    Search PM
    Okay so it's better to render it 25p then.

    How did you notice that it is not truly interlaced? Where can you check that? In case I import it to Virtualdub, I see no combs. Is that the sign you are looking for? I don't have interlaced video ferm other camcorders to compare.
    Quote Quote  
  29. Originally Posted by Bencuri View Post
    I import it to Virtualdub, I see no combs. Is that the sign you are looking for?
    In this case, yes. But there are other cases where you will see comb artifacts but the video isn't really interlaced.
    Quote Quote  
  30. Originally Posted by Bencuri View Post
    I don't have interlaced video ferm other camcorders to compare.
    yes you do

    https://forum.videohelp.com/threads/388973-Video-plays-as-if-it-was-accelerated#post2519515
    00027.ts



    Another way to check is import the clip into sony vegas in a 50p timeline project settings (eg. 720p50 , 1080p50) , with deinterlace set to "interpolate" . If you have sequential duplicate frames (every 2 frames are the same), it's 25p . If there is motion every frame (every frame is different during movement) , it's 50p . This is the same procedure people refer to as "bob deinterlacing" it to check. You could do this in vdub or avisynth too . As jagabo alluded to above, there are other types of cadences too, but that's a simple check for 25p vs. 50p content for your camcorder clips
    Quote Quote  



Similar Threads

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