This is giving me good results converting full-range (8-bit 0 - 255) video to "limited" (8-bit 16 - 235) video.
Note the use of ffv1 version 3 codec.
Code:ffmpeg -y -hide_banner -i "C0042.mp4" -vf scale=w=1280:h=720,lutyuv=y='clip(val,16,235)',lutyuv=u='clip(val,16,240)',lutyuv=v='clip(val,16,240)',setparams=range="tv" -codec:v ffv1 -level 3 -pix_fmt:v yuv422p -color_range "tv" -vb 50M -color_primaries bt709 -color_trc bt709 -colorspace bt709 -c:a pcm_s16be clipped.mov
+ Reply to Thread
Results 1 to 6 of 6
-
Last edited by chris319; 27th Jul 2023 at 08:07.
-
1080i version:
Code:ffmpeg -y -hide_banner -i "C0015.mp4" -vf tinterlace=4:vlpf,scale=w=1920:h=1080,lutyuv=y='clip(val,20,223)',lutyuv=u='clip(val,16,240)',lutyuv=v='clip(val,16,240)',setparams=range="tv" -codec:v ffv1 -level 3 -pix_fmt:v yuv422p -color_range "tv" -vb 50M -color_primaries bt709 -color_trc bt709 -colorspace bt709 -flags +ilme+ildct -movflags +write_colr -c:a pcm_s16be clipped.mov
Last edited by chris319; 27th Jul 2023 at 12:13.
-
You're not converting full range to limited range. You're clamping full range to limited range, losing dark and bright details.
-
That 1st command will work ok if the input video is flagged full range and it's read as full range. The clipping will occur after the full to limited scaling which occurs automatically if flagged full .
The default behaviour of swscale if it encounters a full range flag is to scale to limited range. In other words, the hidden commands are
Code:in_range=full:out_range=limited
-vb 50M will do nothing with ffv1 is the video codec ; ffv1 will always use the bitrate required to achieve losslessness
Why is the 1080i version different for lutyuv ? lutyuv=y='clip(val,20,223)' , not 16-235 ? -
I discovered a flaw in the program I was using to check video levels. It has now been fixed.
Bandwidth command removed. Changed video range. The input files are flagged as "limited". I have no control over that. The range of values is actually 0 - 255 despite being flagged as "limited". Using limiter instead of clipper.
How's this?
Code:ffmpeg -y -hide_banner -i "C0015.mp4" -vf scale=w=1280:h=720,setparams=range="tv",limiter=16:235:1,limiter=16:240:6 -codec:v ffv1 -level 3 -pix_fmt:v yuv422p -color_range "tv" -color_primaries bt709 -color_trc bt709 -colorspace bt709 -movflags +write_colr -c:a pcm_s16be limited.mov
Last edited by chris319; 27th Jul 2023 at 22:32.
Similar Threads
-
"code":400,"error":true,"message" on http://getwvkeys.cc
By johnsonkiss in forum Video Streaming DownloadingReplies: 14Last Post: 25th Jul 2024, 21:45 -
{"code": 2048, "message": "Authentication failed"} when getting license
By warmachine in forum Video Streaming DownloadingReplies: 2Last Post: 26th May 2023, 16:34 -
How to change "m3u8" to "json" and "ts" to "js" extension
By wowza in forum Newbie / General discussionsReplies: 6Last Post: 4th Mar 2023, 15:36 -
Will a JVC VCR "Stop" Playback if the video is "too grainy" or degraded?
By timepassenger in forum Capturing and VCRReplies: 8Last Post: 2nd May 2020, 07:17 -
ffmpeg 4.1.4 question regarding "limited color range" output file
By bokeron2020 in forum Newbie / General discussionsReplies: 12Last Post: 1st Aug 2019, 17:28