Use DXGI/D3DFMT 16bit pixel format to compatible with 12bit Y212/XV36 since there is no 12bit pixel defined in D3D11/D3D9. Fix cmdline on Windows: $ ffmpeg.exe -hwaccel qsv -init_hw_device qsv:hw,child_device_type= {d3d11, dxva2} -i input_12bit.bin -f null -
Unified · Split
| @@ -104,6 +104,10 @@ static const struct { · 103 unmodified lines | ||
| 104 | 104 | { DXGI_FORMAT_P016, AV_PIX_FMT_P012 }, |
| 105 | 105 | { DXGI_FORMAT_Y216, AV_PIX_FMT_Y216 }, |
| 106 | 106 | { DXGI_FORMAT_Y416, AV_PIX_FMT_XV48 }, |
| 107 | + // There is no 12bit pixel format defined in DXGI_FORMAT*, use 16bit to compatible | |
| 108 | + // with 12 bit AV_PIX_FMT* formats. | |
| 109 | + { DXGI_FORMAT_Y216, AV_PIX_FMT_Y212 }, | |
| 110 | + { DXGI_FORMAT_Y416, AV_PIX_FMT_XV36 }, | |
| 107 | 111 | // Special opaque formats. The pix_fmt is merely a place holder, as the |
| 108 | 112 | // opaque format cannot be accessed directly. |
| 109 | 113 | { DXGI_FORMAT_420_OPAQUE, AV_PIX_FMT_YUV420P }, |
| @@ -95,6 +95,10 @@ static const struct { · 94 unmodified lines | ||
| 95 | 95 | { MKTAG('P', '0', '1', '6'), AV_PIX_FMT_P012 }, |
| 96 | 96 | { MKTAG('Y', '2', '1', '6'), AV_PIX_FMT_Y216 }, |
| 97 | 97 | { MKTAG('Y', '4', '1', '6'), AV_PIX_FMT_XV48 }, |
| 98 | + // There is no 12bit pixel format defined in D3DFMT*, use 16bit to compatible | |
| 99 | + // with 12 bit AV_PIX_FMT* formats. | |
| 100 | + { MKTAG('Y', '2', '1', '6'), AV_PIX_FMT_Y212 }, | |
| 101 | + { MKTAG('Y', '4', '1', '6'), AV_PIX_FMT_XV36 }, | |
| 98 | 102 | { D3DFMT_P8, AV_PIX_FMT_PAL8 }, |
| 99 | 103 | { D3DFMT_A8R8G8B8, AV_PIX_FMT_BGRA }, |
| 100 | 104 | }; |