I kindly request some assistance encoding an image sequence. The source file is a 1920x1080, 10-bit 4:2:0 MKV file, ripped to a 16-bit PNG sequence, enhanced and upscaled to a 16-bit 3840x2160 png sequence. I am using ffmpeg and would like to retain a bit depth of 10 whilst encoding via nvenc (or other GPU acceleration).
An example of what I've tried ".\ffmpeg.exe -r 24000/1001 -i image-%05d.png -map 0:v:0 -c:v h264_nvenc -preset slow -bf 4 -rc-lookahead 32 -rc:v vbr_hq -qmin:v 15 -qmax:v 19 -b:v 4000k -maxrate:v 9000k -profile:v high -pix_fmt p010le"
What I need: 10-bit mkv sequenced to png (preferred), tiff or bmp without reducing bit depth. I will then process the sequence to a second directory with no changes to the file names. The second directory containing the entire sequence must then be encoded via nvenc (or other GPU acceleration) whilst retaining 10-bit color. I require GPU based encoding due to time constraints.
Bit rate, final file size and device compatibility are irrelevant. Quality needs to be near lossless.
What I've tried: Source file ~> Virtualdub ~> Export Image Sequence = 8-bit png (10-bit dithered to 8-bit, encodes fine). Source file ~> proprietary software = 10-bit DPX (not supported in my workflow). Source file ~> ffmpeg = 16-bit png (gives an error during encode).
What I'm using: Windows 10 x64 build 1709, i7-3930K, GTX 1080, GTX 970 and 16GB RAM. Most recent generic ffmpeg (no configurations). I use PowerShell instead of CMD.
More info: I have no experience with ffmpeg, or transcoding in general. I have run some tests to understand ffmpeg by using arguments found on multiple forums with unrelated test files. My goal is to use the GPUs in my home system to accelerate the encode, as my 3930K would not complete the transcode on time. However when I attempt the encode of the 16-bit png files to h264 via nvenc I receive the error "No NVENC capable devices found -- Error initializing output stream 0:0 -- Error while opening encoder for output stream #0:0 - maybe incorrect parameters such as bit_rate, rate, width or height" unless I change arguments to proceed with 8-bit encoding. I am open to suggestions of other methods or applications. If you know of a better way to accomplish this task, please share.
Any assistance will be greatly appreciated.
+ Reply to Thread
Results 1 to 9 of 9
Why the intermediate PNG step ?
What does the "upscale and enhance" step entail ?
ffmpeg showed the following pixel formats as available with nvenc based h264 encoding "yuv420p nv12 p010le yuv444p p016le yuv444p16le bgr0 rgb0 cuda d3d11".
That said, I've found a new issue that's unlikely to be solved in software. The upscaled 16-bit png's come out to 40MB each, maxing out my 900MB/s M.2 and throttling ffmpeg performance to 20 fps. On top of that theres nearly 2 million frames which would, when upscaled, consume the HDD's I purchased out of pocket for this project.
"file size is irrelevant"
What are you using to upscale 1920x1080 to 3840x2160 ? The in house software / neural network ?
If so, what types of inputs does it take ? Because you might be able to avoid PNG intermediates and extra HDD space by piping / sdtin . (Technically, there is avoidable quality loss from the color space conversions and rounding errors)
If not the custom software, then why not just use ffmpeg in 1 step ?
Also, 4000k seems rather low bitrate for UHD . It's upscaled content, but even that is low for 1920x1080, unless the content was very "simple" . You said bitrate is irrelevant, but that is not consistent with "near lossless"
NVEnc HEVC does not use b frames , so the -bf argument will not get passed
Is the quality loss caused by color space conversion purely mathematical or would it be noticeable to the human eye?
The ffmpeg string given in the first post was only used to test methods of getting 10-bit encode. My comment on irrelevancy was meant to convey that I don't mind excessively high bit rates. That opinion has changed, slightly. I did notice hevc failing to encode with the argument for b frames and have removed it, thank you.
For the actual encode I'm thinking of using: ".\ffmpeg.exe -r 24000/1001 -start_number 431149 -i %07d.png -map 0:v:0 -c:v hevc_nvenc -preset slow -rc-lookahead 32 -cq 10 -qmin:v 12 -qmax:v 15 -weighted_pred 1 test.mkv"
In my testing this has resulted in an average bit rate of 40.1Mb/s. Is that an acceptable bit rate for fast moving, high quality content at 3840x2160? 40.1Mb/s will result in an approximate completed file size of 410GB, which is acceptable. A colleague suggested using various png optimization utilities, which I tried, though they have all reduced bit depth from 16 ~> 8.
In my testing this has resulted in an average bit rate of 40.1Mb/s. Is that an acceptable bit rate for fast moving, high quality content at 3840x2160? 40.1Mb/s will result in an approximate completed file size of 410GB, which is acceptable.
I work for a small studio that uses neural network patterns for various types of image processing. Most of our work deals with 8192×4320 image sequences. A recent fire resulted in the loss of our blade servers and accompanying raid array. More than 400TB of data was lost including a project for a local group comprising 60%~ of our business, which is due to be presented in 5 weeks. The 1920x1080 10-bit 4:2:0 file was only created to be an in-house preview. Fortunately we have multiple patterns designed specifically for restorative work, so I'm aiming for a near lossless 3840x2160 upscale, or half the resolution of the original source content. It has never been my job to transcode a project to video before.
You claim that your biggest client by far, gave your firm 400TB 8K image sequences, your firm created a 1080p file for "in-house previewing", a fire destroyed your servers and array, but because of some magical "patterns" your firm has you think you can upscale the 1080p preview to 4k, losslessly mind you, in relation I'm assuming to the original 8k sequence, if said sequence had been resized to 4k. That about the long and short of it?
Oh, and you seem to think that your client won't notice.
I don't know if you're trolling, serious or what, but I'm having trouble decide just where to begin mocking you.
Yes, from 1920x1080 we can upscale to 3840x2160 with quality near lossless using our magical patterns in relation to the 1920x1080 preview.
I never stated I don't believe our client will notice, or imply anything about our clients knowledge of the fire or current state of the project? Failing to notify a client in such an event would be completely unprofessional. If I was such an unprofessional person I would have quit the moment I was saddled with so much work outside of my job description.
I don't know if you're trolling, serious or what, but I'm having trouble gauging your ability to comprehend what you read.
Originally Posted by poisondeathray