VideoHelp Forum
+ Reply to Thread
Results 1 to 12 of 12

Thread: Encoding Errors

Thread
  1. Member
    Join Date: Jan 2008
    Location: New Zealand
    Search Comp PM
    I think I probably need someone with a big stick and a signpost saying "Go That Way". I have pondered and played so much that I can no longer see the wood for the trees. (I am probably not alone).

    The objective of the exercise is to clean up the family videos and put them up on a private channel on You Tube. I used to work in a video shop once upon a time supplying pro and semi-pro kit in the early days of NL editing, and I have had to beat myself on the back to get it into my head that availability to the intended audience is probably more important than quality, and to stop stuffing around and get the job done!

    I have capitulated. However there are a few things that I am struggling to let past the changed mindset.

    My original material is all S-VHS, some on C tapes and some full size. All tapes are original masters and have been well stored. Problem was that when I came to do the encoding a few years back, my old HS-950 had become very tired, and although I tweaked it as best as I could, and captured through a brand new ADVC unit; I had cause to be very disappointed in the result. To make it worse, I only had access to the ADVC for a limited time, and in my hurry to get done, forgot rule1 and stupidly used a washed out monitor; with the result that all the captures are also over saturated. I am on a time limit (a natural one) and I don't have the time to gather and attend to the kit to recapture so will have to just go with what I have.

    I am using a newly acquired Adobe Premiere Pro CC for editing, and whilst it seems to have all sorts of wonderful tools for colour correction, I don't have the time to do the degree and the hard yards to get to know them, I will use the simple tools for basic correction only. So I intend doing pre-processing with AviSynth and VirtualDub. A single pass through QTGMC on very slow (nothing tweaked) yields a reasonable result, but there are two issues that I am going to allow myself to address (my consolation prize!!).

    The bad recorder has dished up variances between frames which yields a nasty comb effect. QTGMC does not successfully deal with this, even with two passes (although there may be tweaks that could do a better job that I don't know about). I have a notion that it is something that I should address with a decent comb filter before QTGMC get its chance.

    The second issue is a Chroma Shift to the left, mostly blue. I have played with a few of both VirtualDub and AVIsynth filters with varying degrees of success, but I am thinking that it would be better to get some advice on which does the best job from the experienced experts rather than bash my bruised head any further.

    The attached clip demonstrates the worst case of both the Chroma Shift and the Combing (on the combing girls back - excuse the pun). (raw capture in YV12)

    The sample video is in post 3

    These images demonstrate further - Oh Dear after QTGMC single pass, Oh Dear1 raw encode, Oh Dear2 after QTGMC - Very slow

    Name:  Oh dear.jpg
Views: 157
Size:  238.1 KB
    Name:  Oh Dear1.jpg
Views: 148
Size:  184.9 KB
    Name:  Oh Dear2.jpg
Views: 144
Size:  186.1 KB

    I know about the vertical ghost bars on the left, I am going to ignore them however as I am probably the only one that will ever see them, and they only show up in certain shots - they would probably also be impossible to cure anyway.

    So, would really appreciate some advice (and the big stick) so that I can go to my box feeling at least a little smug!!
    Last edited by KevinL; 22nd Jan 2014 at 07:17.
    Quote Quote  
  2. Member
    Join Date: Sep 2007
    Location: Canada
    Search Comp PM
    If the "bad recorder" is the culprit for at least some of the issues - is doing another capture on some different hardware an option for you?

    Can you fix the video sample link ?
    Quote Quote  
  3. Member
    Join Date: Jan 2008
    Location: New Zealand
    Search Comp PM
    I seemed to have messed up the video upload - second attempt.

    Had a few thoughts whilst waiting for the video to upload.

    I am not too concerned with repairing the girls back in the clip. its so bad that it has actually burnt into the Luma. There are only a handfull that are that bad in the total set, and I don't mind letting those through. But curing the fundamental chroma shift is the overall objective. Just thinking that perhaps this is the wrong clip, and I should find a clip with a basic blue and red shift that is not burnt to hell like this is.
    Attached Files
    Quote Quote  
  4. Member
    Join Date: Jan 2008
    Location: New Zealand
    Search Comp PM
    Sorry poisondeathray - my wobbly old head letting me down. Video is in a following post. Great many thanks for the interest!

    As much as I would dearly love to re-encode all 70 hours, I have had to declare it not possible. The old HS-950 needs a major overhaul: - new bits for the deck, a new head and total re-alignment (electronic and mechanical). I have burnt my fingers trying to find a replacement and its pretty much a given that anything else that is available will be in similar condition. I am also on a time limit and need to get the whole thing finished within the next month or so.

    At the end of the day I have had to be realistic and accept that I am probably the only one that's going to notice the flaws. I am going to put the end product up on You Tube in a private channel, and the average expectation of anyone watching something on Youtube is not particularly high.

    Having said that, I am hoping that curing the combing and chroma shift will be mostly achievable as part of the pre-processing run, in which case the rest is not that bad and quite watchable for non quality mad family members.
    Quote Quote  
  5. The horizontal stripes in colored areas are Hanover Bars. That is common with PAL video captured without the proper chroma filtering. You need to blur pairs of scan lines of each field together. Something like SeparateFields().Blur(0,1.0).Sharpen(0,0.7).Weave( ). Chroma can be shifted with ChromaShift(c=6), sharpened with MergeChroma(aWarpSharp2(depth=30)).

    Code:
    AviSource("S1.avi") 
    AssumeBFF()
    ColorYUV(cont_y=-12, off_y=-12) # a little brightness/contrast adjustment
    SeparateFields()
    Blur(0, 1.0) # blur pairs of scan lines together
    Sharpen(0, 0.7) # re-sharpen edges
    Weave()
    QTGMC() # deinterlace
    MergeChroma(aWarpSharp2(depth=30)) # sharpen chroma
    ChromaShift(c=6) # shift chroma right by 6 pixels
    Tune to your liking. I think the saturation needs to go up a bit too. Maybe add cont_u=50 and cont_v=50 to ColorYUV().
    Last edited by jagabo; 22nd Jan 2014 at 06:56.
    Quote Quote  
  6. Member
    Join Date: Jan 2008
    Location: New Zealand
    Search Comp PM
    All hail jagebo!!

    You just hit God status! I would never have believed that it could be improved to that extent.

    The combing girl (combed no longer)
    Name:  Snip1.jpg
Views: 112
Size:  245.3 KB

    ZsaZsa (colour corrected slightly to try and highlight the leftovers)
    Name:  Snip4.jpg
Views: 104
Size:  177.0 KB

    Before and after on a red

    Name:  snip2.jpg
Views: 105
Size:  240.4 KB
    Name:  Snip3.jpg
Views: 110
Size:  240.3 KB

    Mergechroma seems to be quite a gentle filter, and I found better results by progressively applying the Chroma shift followed by mergechroma with diminishing values. I used mergechroma_Sp for the final shift as it needed to be a little finer. Following this I was till getting some temporal bleeding of the blue following motion, so I used another pass of QTGMC set to progressive and slow and that seemed to have knocked the last little problem on the head.

    I know I am bumbling along here, and my vandalisation of jagebo's masterpiece thus far is probably a comedy item: nevertheless, any comments on improvements would be welcome. This "script" runs at just over 5 frames per second on my old Quad core, although it is only using 1 core. I must have a look and see if I can get it to be a bit more intelligent.


    Code:
     
     AVISource("C:\Users\Kevin\Videos\ZsaZsaYu12.avi") 
     AssumeBFF()
     ColorYUV(cont_y=-12,off_y=-12)
     SeparateFields()
     Blur(0,1.0)
     Sharpen(0,0.7)
     Weave()
     QTGMC("Slow")
     MergeChroma(aWarpSharp2(depth=30))
     Chromashift(c=4)
     MergeChroma(aWarpSharp2(depth=25))
     function ChromaShiftSP (clip clp, float "X",float "Y") {
     X = default(X, -1.75) # positive values shift the chroma to left, negative values to right
     Y = default(Y, 0) # positive values shift the chroma upwards, negative values downwards
     w = clp.Width()
     h = clp.Height()
     clp.MergeChroma(clp.Spline16Resize(w, h, X, Y, w+X, h+Y)) }
     MergeChroma(aWarpSharp2(depth=10))
     QTGMC(Preset="Slow",InputType=1)
    Jagebo, I cant thank you enough for your golden advice. I may even be able to get some sleep tonight!
    Last edited by KevinL; 22nd Jan 2014 at 07:10. Reason: Pictures in wrong place
    Quote Quote  
  7. Regarding temporal bleeding of the colors, make sure your interlaced video wasn't treated as progressive YV12 somewhere earlier -- like during capture. That would cause the colors of the two fields to blend together, resulting in temporal shifts in the colors.
    Quote Quote  
  8. Member
    Join Date: Jan 2008
    Location: New Zealand
    Search Comp PM
    Thanks for the hint. I will investigate that tomorrow (bedtime now - 3am). All material was encoded directly from the VCR through a Canopus ADVC110 ( I may have the model number wrong) using its own software. The saved AVI's are definitely interlaced, and I assume that Canopus used a codec that was installed with its software. I honestly cannot remember offhand, but I will check up tomorrow. I cant imagine that there would be any de-interlacing going on in the ADVC's processes.

    I am opening those interlaced files in VirtualDub and extracting clips that I save as interlaced YV12 (with no filters active at all). These clips are then the input files to AViSynth. The only question may be the codec that Vdub is using to read the files.

    I shall investigate.

    Thanks for that, and thanks again for the super advice.
    Quote Quote  
  9. Member 2Bdecided's Avatar
    Join Date: Nov 2007
    Location: United Kingdom
    Search Comp PM
    Originally Posted by jagabo View Post
    Regarding temporal bleeding of the colors, make sure your interlaced video wasn't treated as progressive YV12 somewhere earlier -- like during capture.
    An ADVC won't do that, but a poor or misconfigured DV codec during playback/restoration might. Install Cedocida, make sure it's at the top of the codec list, and make sure it's outputting MPEG-2 interlaced chroma.

    Cheers,
    David.
    Quote Quote  
  10. Originally Posted by 2Bdecided View Post
    Originally Posted by jagabo View Post
    Regarding temporal bleeding of the colors, make sure your interlaced video wasn't treated as progressive YV12 somewhere earlier -- like during capture.
    An ADVC won't do that
    If he's using an ADVC he should be uploading the original DV clips, not uncompressed YV12.

    The S1 clip doesn't have much motion (making it hard to tell for sure) but it looks to me like the chroma channels have been blended together.
    Last edited by jagabo; 22nd Jan 2014 at 09:16.
    Quote Quote  
  11. Member
    Join Date: Jan 2008
    Location: New Zealand
    Search Comp PM
    Thanks for the input David. I was using the Canopus Codec, I eventually recalled (memory interface in my head runs at 1Hz) that my logic was to use the same Codec that had been used for capture; before that it was at default in Vdub ("use internal codecs") so would have been using the Windows Dvsd codec. I took your advice and installed Cedocidia. It has had no noticeable impact on the colour shift/bleeding issue, but I am pretty sure that this is courtesy of the wobbly old HS-950, over saturation on capture and some other issues mentioned later in this post. It is only blatantly evident in extreme conditions.

    jagebo, your (invaluable) comment on uploading the original DV clips: When you pointed that out I realised that I am stupidly hanging on to some past history. In the beginning, I was unknowingly using the default Windows codec. I was converting to YV12 as there were filters that would not work with RGB, which I should not have been using anyway. I am on PAL standard, and given that I am now using a proper codec, I guess my little pre-conversions are probably not in fact converting anything at all. I will cease forthwith.

    Further investigation has come up with some other anomalies that I should have taken into account before hitting the panic button. These samples (the S1 clip) were taken from the very first shots with a brand new camera that I had not gotten to grips with yet. Lighting conditions on the day were very bad as there was a really severe storm building up. The cameras auto exposure was not quite on the money, and light areas were too overexposed, which further highlights the encoding issues. In subsequent use I would have compensated manually in those conditions. Added to that, the tape used was that which "came with" the camera. Apart from this original tape, I only ever used master quality tape, and all masters are record-once originals. There is a decided difference in the colour registration between this tape and subsequent recordings. The overall problem is therefore not as extensive as imagined. The Hanover bars are still evident to varying degrees, but I have managed to ease up on the settings to an extent where the repair is almost completely non destructive.

    In the end I have decided to be a bit more rational. There is no point in exerting sledgehammer effort to cure a problem that is worth less than 5 minutes in 70 hours. The overall objective is still achieved, and in fact the target audience rate the end result as excellent despite my concerns. Time for me to stiff the pedantics, sit down, shut up and get on with it!

    Final decision: I have some material that was shot under perfect light conditions with a pro camera and recorded directly to a brand new FS200 using broadcast master tape. I am using that material as the reference to set the cure for the encoding maladies, as I know that the only anomalies present are those introduced by the playback of the HS-950. I will then apply those fixes across the board to all material. Done.

    I will post the final working script when I am happy with it (hopefully without any more stupid questions). Thanks again for the most invaluable advice.
    Quote Quote  
  12. Originally Posted by KevinL View Post
    I was using the Canopus Codec, I eventually recalled (memory interface in my head runs at 1Hz) that my logic was to use the same Codec that had been used for capture;
    The camera uses a hardware DV encoder. There's no reason to believe Canopus's software decoder will work any better than any other, really. One DV decoder that should be avoided is Panasonic DV codec. It's full of bugs and only outputs RGB.

    Originally Posted by KevinL View Post
    before that it was at default in Vdub ("use internal codecs") so would have been using the Windows Dvsd codec.
    If you were using VirtalDub's internal decoder you were not using Windows' decoder. You can switch between VirtualDub's internal decoder and the system installed VFW decoder by setting VirtualDub's "Prefer internal video decoders..." setting (I don't remember if you need to restart VirtualDub for the change to take effect).

    Originally Posted by KevinL View Post
    I took your advice and installed Cedocidia. It has had no noticeable impact on the colour shift/bleeding issue,
    I like to use Cedocida myself (because you have control over exactly what it does) but I didn't expect to see it make much difference here. VirtualDub doesn't handle interlaced YV12 well so I would force Cidocida to output YUY2.

    Originally Posted by KevinL View Post
    The cameras auto exposure was not quite on the money, and light areas were too overexposed
    That's very common with DV camcorders. You can alleviate that a bit by reducing the brightness while the video is still in YUV. You can do that with AviSynth and something like ColorYUV(gain_y=-25) or in VirtualDub by applying the Brightness/Contrast filter before any other filters (that filter can work in YUV, most others will convert to RGB and lose bright detail). Totally blown out brights won't be restored but those between Y=235 and Y=255 will be.
    Quote Quote  



Similar Threads