<p>Use</p>

<pre><code>ffmpeg -framerate 500/21 -i %d.png -i audio.wav -c:v libx265 -x265-params lossless=1 -pix_fmt yuv422p12le -c:a copy output.mkv
</code></pre>

<p>You'll need a ffmpg with a libx265 that supports a bit depth of 12. At this time, I can't find such a precompiled binary so you'll have to compile ffmpeg using the auto-build script at <a href="https://github.com/jb-alvarado/media-autobuild_suite" rel="nofollow noreferrer">https://github.com/jb-alvarado/media-autobuild_suite</a></p>

CC BY-SA 4.0
2018-11-17T05:49:14.503Z
Why is it like -x265-params lossless=1? Can I use -crf 0 instead? or is h.265 a bit different? also i was always told to use -c copy instead of -c:a or any of the other copy audio variants.
kite
CC BY-SA 4.0
2018-11-17T05:50:20.623Z
For x265, this is the syntax for lossless encoding.
Gyan
CC BY-SA 4.0
2018-11-17T06:51:25.727Z
I'm getting an error and its changing to 10bit: Incompatible pixel format 'yuv422p12le' for codec 'libx265', auto-selecting form at 'yuv422p10le
kite
CC BY-SA 4.0
2018-11-17T06:59:27.697Z
Get the latest ffmpeg binary from https://ffmpeg.zeranoe.com/builds/
Gyan
CC BY-SA 4.0
2018-11-17T07:32:32.297Z
Getting same problem unfortunately. Testing on a sequence of seven 16 bit png numbered 1.png...etc without the audio bit: ffmpeg -framerate 24 -i %d.png -c:v libx265 -x265-params lossless=1 -pix_fmt yuv422p12le test.mkv
kite
CC BY-SA 4.0
2021-02-09T04:35:57.753Z
Is this easier now?
David Jonsson
CC BY-SA 4.0
2021-02-09T04:53:00.733Z
My builds include libx265 with 12-bit support.
Gyan
CC BY-SA 4.0
2019-01-19T10:55:04.537Z
is there possibly another way at this time to get 12 bit h.265? I'm having a hard time going through the process linked. Or if there is any other documentation you could recommend or just recommendations on how to go about figuring the prescribed method out. Anything like that would be appreciated.
kite
CC BY-SA 4.0
2018-11-17T05:43:28.060Z
2018-11-17T07:41:21.443Z
2018-11-17T07:41:21.443Z
Gyan
<pre><code>ffmpeg -framerate 500/21 -i %d.png -i audio.wav -c:v libx264 -crf 0 -pix_fmt yuv422p10le -c copy output.mkv
</code></pre>
<p>I have the above command for converting a PNG sequence of images into 10 bit h.264 video file.</p>
<p>I want to know: how do I modify it to render my PNG sequences as a 12 bit h.265 video? Or do I need a completely different command and what would that be?</p>
<p>Aside:
I noticed it in Handbrake, but I see a lot of complaints that Handbrake isn't as clean an encode as raw ffmpeg? I don't know if there's any basis to that or if I should just do it in Handbrake instead.</p>

CC BY-SA 4.0
2018-11-17T05:49:46.930Z
BTW your command, as written, isn't converting the images to H264 but simply storing them in the MKV. This is due to the `-c copy` at the end. Place it immediately after `audio.wav`
Gyan
CC BY-SA 4.0
2018-11-17T05:52:31.223Z
oh okay I guess that makes sense. There any drawback to storing the images in the mkv? is it just large file size?
kite
CC BY-SA 4.0
2018-11-17T05:53:23.973Z
File size and playability on some players.
Gyan
<ffmpeg><h.265>
How to render png's as h.265 12 bit video?
kite
# How to render png's as h.265 12 bit video?

(Asked by: username_0 on 2018-11-17)

ffmpeg -framerate 500/21 -i %d.png -i audio.wav -c:v libx264 -crf 0 -pix_fmt yuv422p10le -c copy output.mkv

I have the above command for converting a PNG sequence of images into 10 bit h.264 video file.
I want to know: how do I modify it to render my PNG sequences as a 12 bit h.265 video? Or do I need a completely different command and what would that be?
Aside:
I noticed it in Handbrake, but I see a lot of complaints that Handbrake isn't as clean an encode as raw ffmpeg? I don't know if there's any basis to that or if I should just do it in Handbrake instead.

**Tags:** ffmpeg, h.265

> **Comments:**
> **username_1**: BTW your command, as written, isn't converting the images to H264 but simply storing them in the MKV. This is due to the `-c copy` at the end. Place it immediately after `audio.wav`  
> **username_0**: oh okay I guess that makes sense. There any drawback to storing the images in the mkv? is it just large file size?  
> **username_1**: File size and playability on some players.  

---

## 1 answers

### Answer by username_1 on 2018-11-17. Score: 0 | Accepted answer

Use
ffmpeg -framerate 500/21 -i %d.png -i audio.wav -c:v libx265 -x265-params lossless=1 -pix_fmt yuv422p12le -c:a copy output.mkv

You'll need a ffmpg with a libx265 that supports a bit depth of 12. At this time, I can't find such a precompiled binary so you'll have to compile ffmpeg using the auto-build script at https://github.com/jb-alvarado/media-autobuild_suite

> **Comments:**
> **username_0**: Why is it like -x265-params lossless=1? Can I use -crf 0 instead? or is h.265 a bit different? also i was always told to use -c copy instead of -c:a or any of the other copy audio variants.  
> **username_1**: For x265, this is the syntax for lossless encoding.  
> **username_0**: I'm getting an error and its changing to 10bit: Incompatible pixel format 'yuv422p12le' for codec 'libx265', auto-selecting form at 'yuv422p10le  
> **username_1**: Get the latest ffmpeg binary from https://ffmpeg.zeranoe.com/builds/  
> **username_0**: Getting same problem unfortunately. Testing on a sequence of seven 16 bit png numbered 1.png...etc without the audio bit: ffmpeg -framerate 24 -i %d.png -c:v libx265 -x265-params lossless=1 -pix_fmt yuv422p12le test.mkv  
> **username_0**: is there possibly another way at this time to get 12 bit h.265? I'm having a hard time going through the process linked. Or if there is any other documentation you could recommend or just recommendations on how to go about figuring the prescribed method out. Anything like that would be appreciated.  
> **username_2**: Is this easier now?  
> **username_1**: My builds include libx265 with 12-bit support.  

---

