VideoHelp Forum

Our website is made possible by displaying online advertisements to our visitors. Consider supporting us by disable your adblocker or Try ConvertXtoDVD and convert all your movies to DVD. Free trial ! :)
+ Reply to Thread
Results 1 to 17 of 17
Thread
  1. Member
    Join Date
    Aug 2010
    Location
    San Francisco, California
    Search PM
    I encoded SMPTE bars using FFmpeg/libx264 with no special flags. I got a file flagged limited range BT.709. It plays perfectly in VLC Player. But in Win 10 Windows Media Player, and in a MediaElement control in a .NET app, I get hue and saturation shifts as shown below. Most notably, green is too dark. Gray levels are fine. What could be going on? A serious bug in WMF decoder? I have noted the same color shifts on another Win 10 system using a different graphics adapter.

    Image
    [Attachment 49453 - Click to enlarge]
    Quote Quote  
  2. Member
    Join Date
    Nov 2009
    Location
    Germany
    Search PM
    I can't help with Direct Show or Media Foundation as I decided to give it up in favor of libmpv which is an amazing library for embedding video playback, I'm not sure how well it integrates in WPF though, some links:

    https://github.com/stax76/mpv.net

    https://github.com/hudec117/Mpv.NET.lib (this is totally unrelated to my little player)

    https://github.com/mpv-player/mpv-examples/tree/master/libmpv/csharp
    Quote Quote  
  3. Member
    Join Date
    Aug 2010
    Location
    San Francisco, California
    Search PM
    Thanks for the suggestion. Looks like libmpv has to run in a WindowsFormsHost, which is always-on-top and won't work in my app since I have overlays.
    Quote Quote  
  4. Please upload file
    Quote Quote  
  5. Member
    Join Date
    Aug 2010
    Location
    San Francisco, California
    Search PM
    Originally Posted by flashandpan007 View Post
    Please upload file
    This one was done with VidCoder (HandBrake) and has the flagging. Same problem as FFmpeg version.
    https://drive.google.com/open?id=1PoyhBdALaBt2a-pXP0ZW-GdeItorCPo0
    Quote Quote  
  6. Member
    Join Date
    Nov 2009
    Location
    Germany
    Search PM
    Originally Posted by JVRaines View Post
    Thanks for the suggestion. Looks like libmpv has to run in a WindowsFormsHost, which is always-on-top and won't work in my app since I have overlays.
    You might not need a Win32 window handle as you can do your own rendering using OpenGL.

    https://github.com/mpv-player/mpv/blob/master/libmpv/render.h
    Quote Quote  
  7. Member
    Join Date
    Nov 2009
    Location
    Germany
    Search PM
    Maybe update Win 10 to 1903 if you didn't already.
    Quote Quote  
  8. For quick testing I encoded a testvideo, see attached file.
    I used that source pic:
    https://upload.wikimedia.org/wikipedia/commons/thumb/6/66/SMPTE_Color_Bars.svg/2000px-...r_Bars.svg.png

    How is that videofile with your players? I have a thought but need info first.
    Image Attached Files
    Quote Quote  
  9. Originally Posted by JVRaines View Post
    I got a file flagged limited range BT.709. It plays perfectly in VLC Player.
    The sample image indicates a rec.601 video displayed as if it's rec.709. And VLC uses rec.601 -- which is why your video looks correct in VLC.
    Quote Quote  
  10. Member
    Join Date
    Aug 2010
    Location
    San Francisco, California
    Search PM
    Originally Posted by jagabo View Post
    Originally Posted by JVRaines View Post
    I got a file flagged limited range BT.709. It plays perfectly in VLC Player.
    The sample image indicates a rec.601 video displayed as if it's rec.709. And VLC uses rec.601 -- which is why your video looks correct in VLC.
    And yet the stream is flagged 709. Wouldn't this mean that it was encoded 601 and then flagged 709 by FFmpeg/x264?
    Video

    ID : 1
    Format : AVC
    Format/Info : Advanced Video Codec
    Format profile : High@L4.1
    Format settings : CABAC / 4 Ref Frames
    Format settings, CABAC : Yes
    Format settings, RefFrames : 4 frames
    Codec ID : avc1
    Codec ID/Info : Advanced Video Coding
    Duration : 30 s 30 ms
    Bit rate : 18.5 kb/s
    Width : 1 920 pixels
    Height : 1 080 pixels
    Display aspect ratio : 16:9
    Frame rate mode : Constant
    Frame rate : 29.970 (30000/1001) FPS
    Color space : YUV
    Chroma subsampling : 4:2:0
    Bit depth : 8 bits
    Scan type : Progressive
    Bits/(Pixel*Frame) : 0.000
    Stream size : 67.8 KiB (82%)
    Writing library : x264 core 148 r2708 86b7198
    Encoding settings : cabac=1 / ref=4 / deblock=1:0:0 / analyse=0x3:0x113 / me=umh / subme=8 / psy=1 / psy_rd=1.00:0.00 / mixed_ref=1 / me_range=16 / chroma_me=1 / trellis=1 / 8x8dct=1 / cqm=0 / deadzone=21,11 / fast_pskip=1 / chroma_qp_offset=-2 / threads=12 / lookahead_threads=2 / sliced_threads=0 / nr=0 / decimate=1 / interlaced=0 / bluray_compat=0 / constrained_intra=0 / bframes=3 / b_pyramid=2 / b_adapt=2 / b_bias=0 / direct=3 / weightb=1 / open_gop=0 / weightp=2 / keyint=300 / keyint_min=30 / scenecut=40 / intra_refresh=0 / rc_lookahead=50 / rc=crf / mbtree=1 / crf=18.0 / qcomp=0.60 / qpmin=0 / qpmax=69 / qpstep=4 / vbv_maxrate=62500 / vbv_bufsize=78125 / crf_max=0.0 / nal_hrd=none / filler=0 / ip_ratio=1.40 / aq=1:1.00
    Encoded date : UTC 2019-06-23 17:48:18
    Tagged date : UTC 2019-06-23 17:48:18
    Color range : Limited
    Color primaries : BT.709
    Transfer characteristics : BT.709
    Matrix coefficients : BT.709
    Quote Quote  
  11. That was exactly my thought, but I am not a user of VLC, so I didn't want to blame VLC for an error of this extent.

    But this issue in VLC (treats all rec.701 files as rec.601) "solves" the issue for this wrong encoded file (rec.601 color but flagged as rec.709), but any other rec709 is displayed wrong.

    Take a look at MPC-BE or also MPC-HC, life's too short to use *not*good* players

    EDIT:
    What was your source for the file created with ffmpeg?
    How does my file work for you?
    Quote Quote  
  12. Member
    Join Date
    Aug 2010
    Location
    San Francisco, California
    Search PM
    Haven't got to your file yet, but I am now pointing the finger at my source, which is LAGS YUV. If I add a colormatrix filter to convert 601-->709, then FFmpeg produces a file with the right colors in Windows.
    Quote Quote  
  13. The rec.601 problem has been an issue in VLC for years.
    Quote Quote  
  14. Member
    Join Date
    Aug 2010
    Location
    San Francisco, California
    Search PM
    Originally Posted by jagabo View Post
    The rec.601 problem has been an issue in VLC for years.
    Yes, I reviewed some of your old posts and also learned that x264 assumes 601 input. If I tell it to flag the stream 601, then all is well.
    Quote Quote  
  15. Originally Posted by JVRaines View Post
    learned that x264 assumes 601 input.
    With YUV input x264 doesn't assume rec.601. It just encodes what it gets. If you don't tell it to flag the video it doesn't. Then it's up to the player to guess.
    Quote Quote  
  16. Dinosaur Supervisor KarMa's Avatar
    Join Date
    Jul 2015
    Location
    US
    Search Comp PM
    I'm still on Windows 7 and still use Windows Media Center for TV recording. When live viewing or viewing recordings through Media Center, the colors are always wrong with it displaying 709 content as 601. Seems to be a running theme with Windows builtin players.
    Quote Quote  
  17. What colors you get in Windows can depend on the player, the codecs you have installed, other installed video filters, and the graphics driver.
    Quote Quote  



Similar Threads