VideoHelp Forum
+ Reply to Thread
Results 1 to 14 of 14
Thread
  1. Member
    Join Date
    May 2004
    Location
    Brazil
    Search Comp PM
    I need some help to correct contrast down in an H264, if possible using Avisynth.

    Not willing to extend the story behind this file, this is a HD video of mine that I edited in Avid, exported as HD mov and used Carboncoder to convert it to H264, flat, with no corrections of any kind.

    The problem is the converted file ended up more considerably more contrasty than the original. Please take a look at this image captured from the film:

    http://www.mediafire.com/file/n4w5zu5ezjl/contrast#1.jpg

    There others, but this is the most critical one because of the contrast latitude. It was adjusted within Avid to a very natural looking image, so you can see the black musician on the right quite well. Now it's only a black figure.

    Now I wish to convert this H264 file to DVD with Avisynth, so I wonder what filter would more effective for what I intend to do.

    Feel free to try different filters on that image to see which works best in getting out the musician's features.

    Thanks!



    Carlos
    Quote Quote  
  2. Member
    Join Date
    Feb 2008
    Location
    Twin Peaks
    Search Comp PM
    Carlos, download the demo version of Vegas Movie Studio+DVD Platinum and use the contrast filters there.
    Quote Quote  
  3. Member
    Join Date
    May 2004
    Location
    Brazil
    Search Comp PM
    I am not sure that might be a practical option. That's why I suggested doing it within Avisynth.

    Even if I have never tried Sony's Vegas programs, the ones I did try along the years have been a long bunch. They are not as transparent as Avisynth by far, any of them.

    The other fact is that demo versions usually have restrictions that might not allow me get a finished product free of water-marks, if it does get such a thing. Are you familiar with this demo?
    Quote Quote  
  4. Member
    Join Date
    Feb 2008
    Location
    Twin Peaks
    Search Comp PM
    When I tried the demo it were fully functional, I liked it so much I bought it.
    Quote Quote  
  5. I'd say it's too late already. Here's a pic showing in red what's below 16 and in green what's above 235. Try as I might, I couldn't get the black man back. Maybe others will have more luck. Start all over again:

    http://www.mediafire.com/file/d0volngmznk/Ruined.jpg
    Quote Quote  
  6. Originally Posted by manono View Post
    I'd say it's too late already. Here's a pic showing in red what's below 16 and in green what's above 235.
    That may not make any difference. It depends on how the JPG was produced. Most programs perform the rec.601 or rec.709 contrast stretch when saving JPG images so it's likely he has a lot to work with in the video. There are very few pixels that are totally black (RGB=0) or white (RGB=255) in the image. There's too much lot of macroblocking in the JPG image. A PNG would be much better. A short video clip even better.
    Last edited by jagabo; 17th Jun 2010 at 22:01.
    Quote Quote  
  7. Member
    Join Date
    May 2004
    Location
    Brazil
    Search Comp PM
    In fact both may be right: the jpg capture might have limited latitude to work with; the video being "unrecoverable". Unfortunately I can't go backl to the original editing for now, because I had some HDD crashing that will need re-capture several shots. It will take me too long for what I need to do right away.

    What I do know is this:

    1) If I play this file on my plasma, I can adjust levels and get a lot of detail back. What I would like to know is to be able to build that into the video and play it anywhere with no monitor adjustments.

    2) I loaded the file in TMPGEnc 4.0 Express and played with luminance and gamma, getting back almost to the original contrast in all the video. How can I work that within Avisynth? As I said I believe Avisynth conversions can be much cleaner than TMPGEnc.
    Quote Quote  
  8. You can use Levels() or ColorYUV() in AviSynth. Both have brightness, contrast, and gamma controls.
    Quote Quote  
  9. I use Tweak and YLevelsS for that sort of thing:

    http://avisynth.org/mediawiki/Ylevels

    A lot of people have switched to using SmoothAdjust to handle everything with one filter:

    http://forum.doom9.org/showthread.php?t=154971
    Quote Quote  
  10. Member
    Join Date
    May 2004
    Location
    Brazil
    Search Comp PM
    OK. Things are starting to show promise.

    YLevels(gamma=1.3) is getting me similar results to what I get tweaking gamma in TMPGEnc.

    Details in the shadow begin to show.

    SmoothAdjust seems to allow several adjustments at the same time. Though there's no similarity of what you get from it and other filters. E.g.: gamma=1.3 is weaker on SmoothLevels than on Ylevels.

    I'm not familiar with how to write the adjustments though. How do I combine different filters within SmoothAdjust and how do you adjust limiters?
    Quote Quote  
  11. I recommend you use VideoScope() or the internal Histogram() filter to see the levels graphically.
    Quote Quote  
  12. Though there's no similarity of what you get from it and other filters
    Part of the reason is that ylevels adjusts luma only

    for smoothlevels, chroma=50 by default, this is intermediate and adjusts chroma and luma. chroma=0 will make it act more like ylevels. chroma=100 will make it act more like the original levels()

    the documentation explains how to use the LModes, and strengths DarkSTR and BrightSTR

    You might try different gamma curves to boost dark areas, without affecting or blowing out bright areas. Harder to do in avisynth, than in vdub or other program where you can see the graph
    Quote Quote  
  13. Member
    Join Date
    May 2004
    Location
    Brazil
    Search Comp PM
    Originally Posted by jagabo View Post
    I recommend you use VideoScope() or the internal Histogram() filter to see the levels graphically.
    That sounds interesting, but will I understand what they show me?
    Quote Quote  
  14. ImageSource("contrast#1.jpg", start=0, end=23, fps=23.976)
    Crop(0,0,-4,-3) #image must be at least mod8 for DeBlock
    ConvertToYV12() # must be YV12 for DeBlock
    v2=Deblock().Levels(11,1.4,255,0,249, coring=false).Tweak(sat=1.2)
    Interleave(last,v2) # easy before/after comparison
    Histogram()
    All I had was your JPG image so I had to DeBlock() first. Deblocking is a normal part of h.264 decoding so you shouldn't need to deblock your video source. Levels() is very sensitive with a gamma adjustment this large so you'll probably have to fine tune the values when working with the video. With Histogram() keep the video out of the amber bars (black level at the left, bright level at the right).
    Click image for larger version

Name:	sample.jpg
Views:	168
Size:	47.0 KB
ID:	2356
    Last edited by jagabo; 19th Jun 2010 at 08:45.
    Quote Quote  



Similar Threads

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