Welcome to Doom9's Forum, THE in-place to be for everyone interested in DVD conversion.

Before you start posting please read the forum rules. By posting to this forum you agree to abide by the rules.

 

Go Back   Doom9's Forum > Capturing and Editing Video > VirtualDub, VDubMod & AviDemux

Reply
 
Thread Tools Search this Thread Display Modes
Old 14th February 2016, 17:02   #1  |  Link
asaleo
Registered User
 
Join Date: Mar 2013
Posts: 27
FFmpeg with VirtualDub gives low contrast, why

Can anyone here explain following problem:
mp4 videos opened with ffmpeg plugin in virtualdub shows low contrast. When I exported frames from virtualdub and opened them in Photoshop Elements I could see that the histogram on frames from a "ffmpeg video" didnīt show any pixels in the beginning and in the end of the diagram. After adjusting end trianges to the actual start and end I got a better picture.
What is wrong with my ffmpeg installation? I have tried all alternatives in option before opening av mp4 file.
"Tateau-videos" do not show this type of histogram.

Added later: When I engaged a filter in Virtualdub called AutoLevels v1.2
I got correct colours and a full histogram.
Why is that needed?
Regards
asaleo is offline   Reply With Quote
Old 14th February 2016, 18:52   #2  |  Link
shekh
Registered User
 
Join Date: Mar 2015
Posts: 733
This is a common issue: color range hell.
For example maybe you file is encoded as full range but there is no color range tag in the file. In this case you may use alias format filter to overcome this problem.
Or it is possible there is some error in ffmpeg plugin. You can try my plugin https://sourceforge.net/projects/vdcachingdriver/, in this case make sure to select "default" as input pixel format.
shekh is offline   Reply With Quote
Old 15th February 2016, 08:45   #3  |  Link
asaleo
Registered User
 
Join Date: Mar 2013
Posts: 27
ffmpeg, virtualdub and histogram

Thanks shekh for rapid answer.
It felt like the "Virtualdub forum time"

My mp4 files comes from GoPro Hero 4 and Canon G9x.

I downloaded the bin_win32.zip and added files to the virtualdub folders.
Histogram is still compressed in "loaded ffmpeg-mp4"-files.

Working with levels (histograms) has shown another thing for me.
Adjusting brightness with the brightness/contrast plugin in Virtualdub changes the histogram. Since "ffmpeg video" is slightly darker than original I increased brightness +5. The result was that the histogram shrinked in one end. The "tateau-video" needed darkening with brightness +10 which shrinked the histogram in the other end.

I will now continue using ffmpeg together with AutoLevel v1,2 and skip the brightness/contrast plugin for my mp4 files.

Regards
asaleo is offline   Reply With Quote
Old 15th February 2016, 10:41   #4  |  Link
shekh
Registered User
 
Join Date: Mar 2015
Posts: 733
I made my plugin because I have hero 3 and nothing was interpreting it right out of the box.
It is hard to tell whether you have issue from description. If you want, upload video fragment and pick specific frame.

Tateu quicktime plugin itself does not decode video, so it must be something else involved, like ffdshow. ffdshow has various settings for video levels in many places so it is hard to expect consistent result this way.
shekh is offline   Reply With Quote
Old 15th February 2016, 12:17   #5  |  Link
asaleo
Registered User
 
Join Date: Mar 2013
Posts: 27
ffmpeg, virtualdub and histogram

Thanks shekh
I donīt have ffdshow.
Play everything with VLC.
Used Tateau plugin for opening mp4 files in Virtualdub from 2010.
Changed to ffmpeg plugin some years ago.
Discovered after saving, that video quality was not good.
Returned to the Tateauplugin then because of better quality.
Tried the ffmpeg plugin some times but it never gave me good quality.
I guess that the virtualdub forum has closed at that time when I needed help with this matter.
Regards
asaleo is offline   Reply With Quote
Old 15th February 2016, 14:00   #6  |  Link
shekh
Registered User
 
Join Date: Mar 2015
Posts: 733
Ffmpeg decoder itself is ok for quality, gives identical picture as vlc (it too uses ffmpeg).
It is "original ffmpeg plugin" was adding distortions (not sure if they are fixed now). But my plugin must be fine, I fixed everything I could notice.
shekh is offline   Reply With Quote
Old 15th February 2016, 14:11   #7  |  Link
raffriff42
Retried Guesser
 
raffriff42's Avatar
 
Join Date: Jun 2012
Posts: 1,377
What is this "Tateau-plugin" and where can I get it? It looks interesting.


Did you try VirtualDub's Alias Format filter, Color space=(same), Range=Limited.
This tells VirtualDub to expand the range when converting to RGB internally, without an extra levels conversion step.

Use VirtualDub's Levels filter, Show preview, Sample frame to view a histogram within VirtualDub.

How are you exporting frames - with PNG or TIFF images I assume?

Last edited by raffriff42; 16th March 2017 at 23:23. Reason: (fixed image link)
raffriff42 is offline   Reply With Quote
Old 15th February 2016, 15:41   #8  |  Link
shekh
Registered User
 
Join Date: Mar 2015
Posts: 733
http://www.tateu.net/software/
shekh is offline   Reply With Quote
Old 15th February 2016, 15:51   #9  |  Link
shekh
Registered User
 
Join Date: Mar 2015
Posts: 733
Hero files are always tagged "709 FR" (never seen otherwise) and may contain levels below 16 and above 235. So if using straight YUV data as input, Alias Format should be "709, full".
shekh is offline   Reply With Quote
Old 15th February 2016, 21:19   #10  |  Link
asaleo
Registered User
 
Join Date: Mar 2013
Posts: 27
ffmpeg, virtualdub and histogram

Quote:
Originally Posted by shekh View Post
Ffmpeg decoder itself is ok for quality, gives identical picture as vlc (it too uses ffmpeg).
It is "original ffmpeg plugin" was adding distortions (not sure if they are fixed now). But my plugin must be fine, I fixed everything I could notice.
Good to hear from you again.
I got an idea.
Can you open a mp4 file with the ffmpeg plugin in Virtualdub and use the Autolevel v1.2 filter?
Do you then have the same video quality in window 2 as in window 1?
I see a noticeable increase in quality in window 2, using the autolevel v1.2
If you donīt see any difference then I get that have an own problem.
Regards
asaleo is offline   Reply With Quote
Old 15th February 2016, 21:39   #11  |  Link
shekh
Registered User
 
Join Date: Mar 2015
Posts: 733
Maybe I get you wrong, but for me the process is two steps like this:
1) Get picture (this is the work for input driver). Here its enough that picture is preserved without any extra loss
2) Improve picture with filters

So yes having (1) done right does not mean it cannot benefit from levels and other filters. What problem do you want to solve?

Normally without any filters applied both panes must be identical.
shekh is offline   Reply With Quote
Old 15th February 2016, 22:18   #12  |  Link
asaleo
Registered User
 
Join Date: Mar 2013
Posts: 27
ffmpeg, virtualdub and histogram

Quote:
Originally Posted by raffriff42 View Post
What is this "Tateau-plugin" and where can I get it? It looks interesting.


Did you try VirtualDub's Alias Format filter, Color space=(same), Range=Limited.
This tells VirtualDub to expand the range when converting to RGB internally, without an extra levels conversion step.

Use VirtualDub's Levels filter, Show preview, Sample frame to view a histogram within VirtualDub.

How are you exporting frames - with PNG or TIFF images I assume?
Nice to hear from you raffriff.
I didnīt know of the filters that you proposed.
You are wright of course. I found them and tested them.
Nice to be able to see the histogram within Virtualdub, thanks for that.
I have up till now exported a frame from virtualdub to jpg and opened it in Photoshop Element 12.
I tried your suggested settings but did not get a better video in window 2. I also tried other combinations without getting a better video in window 2
Now it was easier to check the histogram within virtualdub.
Whatever setting I used together with alias format, I did not get a histogram which filled the whole span from 0 to 255.

Histogram for AutoLevel v1.2 however showed a full histogram.
Video in window 2 was also different from window 1
I used another video this time and the difference between window 1 and 2 are too much in this case I think. Have to consider what has happen.
Regards
asaleo is offline   Reply With Quote
Old 15th February 2016, 22:30   #13  |  Link
asaleo
Registered User
 
Join Date: Mar 2013
Posts: 27
ffmpeg, virtualdub and histogram

Quote:
Originally Posted by shekh View Post
Maybe I get you wrong, but for me the process is two steps like this:
1) Get picture (this is the work for input driver). Here its enough that picture is preserved without any extra loss
2) Improve picture with filters

So yes having (1) done right does not mean it cannot benefit from levels and other filters. What problem do you want to solve?

Normally without any filters applied both panes must be identical.
You talk about pictures, I do not understand.
I open a mp4-file with virtualdub and get it in two windows.
Comparing the videos in window 1 and 2 shows the same video as long as no filter is applied.
When I apply AutoLevel v1.2 filter I can see that my video in window 2 changes. I my case the window 2 then shows better quality, fresher and better colours.
What effect can you see applying the AutoLevel v1.2 filter.
Regards
asaleo is offline   Reply With Quote
Old 15th February 2016, 23:01   #14  |  Link
asaleo
Registered User
 
Join Date: Mar 2013
Posts: 27
ffmpeg, virtualdub and histogram

I mentioned to you raffriff42 that I had to consider why there was such a big difference between window 1 and window 2 for this second video that I have loaded and applied AutoLevel1.2 to.
After checking with a frame in PE12 I see that this particular video was taken a very cloudy day with my GoProHD4. Histogram did not go from 0 to 255. Using AutoLevel v1.2 on that video improved quality comparing with original video.
Now I see that that filter can be very useful.
Regards
asaleo is offline   Reply With Quote
Old 16th February 2016, 08:42   #15  |  Link
asaleo
Registered User
 
Join Date: Mar 2013
Posts: 27
ffmpeg, virtualdub and histogram

Something more about the level filter.
The level filter suggested by you riffraff42 can be used instead of AutoLevels v1.2. Since autolevels may give color cast in video with bad histogram, manual adjustment is better.
I also found your site where you show how to use the level filter.
Thanks.

My original problem however was that original video has a good histogram which after loading in virtualdub with ffmpeg plugin showed a histogram not starting from 0 and ending at 255.
In this case the AutoLevel v1.2 filter restores original videos histogram.
Did you shekh see any difference between window 1 and 2 using the AutoLevel filter?
Regards
asaleo is offline   Reply With Quote
Old 16th February 2016, 10:26   #16  |  Link
shekh
Registered User
 
Join Date: Mar 2015
Posts: 733
I can have video fragment where autolevels will not do anything and video fragment where it will crop half the range. So this is absolutely pointless.
And you are not specific about ffmpeg. If it is "virtualdubffmpeginputplugin" please mention its version too.

Show your pictures. If you dont know how, postimage.org is very simple way.
Upload frame as decoded, screenshot of histograms, screenshot of file->information, screenshot of video->color depth.

Do not export frames from VD as jpeg. This is pointless way to lose quality. VD jpegs are quite poor compared to "typical jpeg".
shekh is offline   Reply With Quote
Old 16th February 2016, 17:46   #17  |  Link
asaleo
Registered User
 
Join Date: Mar 2013
Posts: 27
ffmpeg, virtualdub and histogram

I will upload three pictures. All is taken from VLC
"ffmpeg-files" are in two versions, taken from videos with and without AutoLevel 1.2
One file is a picture from VLC and original file.
Picture ffmpeg.jpg does not have a proper histogram, the other two has a "full histogram"

Deshaker now crashes everytime I run it on ffmpeg-loaded files.
Error processing frame." Out of memory."
Works perfect with tateau-loaded files.
That problem is of course outside this thread but still annoying.
If you have any idea. please help.
Regards
Attached Images
   
asaleo is offline   Reply With Quote
Old 16th February 2016, 17:56   #18  |  Link
shekh
Registered User
 
Join Date: Mar 2015
Posts: 733
Attachments on this forum are premoderated, nobody except you can see them. So can you reload them to postimage.org.
And please make screenshots of file->information, video->color depth.
shekh is offline   Reply With Quote
Old 16th February 2016, 18:49   #19  |  Link
asaleo
Registered User
 
Join Date: Mar 2013
Posts: 27
ffmpeg, virtualdub and histogram

Mediainfo screen shoots to be loaded
Attached Images
   
asaleo is offline   Reply With Quote
Old 16th February 2016, 23:31   #20  |  Link
asaleo
Registered User
 
Join Date: Mar 2013
Posts: 27
ffmpeg, virtualdub and histogram

Problem running deshaker with ffmpeg solved.
Last update of ffmpegplugin 1841 was the cause for crashes.
Runs fine with v 1836
Regards
asaleo is offline   Reply With Quote
Reply

Tags
ffmpeg mp4, virtualdub

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 18:09.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2020, vBulletin Solutions Inc.