After I released the early beta I received a couple of messages. Most of them to be fair something like: “80fps I`m not impressed…”
But there was one message from a company which as well work on GPU optimized decoder/encoder. And to be fair it’s good to know someone else works on it as probably at some point I hope to have a chance to compare performance/quality.
I don’t have much info on what exactly they try to do (most probably just optimize FFmpeg version) but as far as I know, their initial goals to be able to decode/encode 1000 fps ProRes 4:2:2 HD.
As my decoder is in the early-stage and the encoder way behind of decoder, I still not sure if 1000 is a limit, but I guess it will be the first goal I will try to achieve.
Even though I didn’t have much time last weeks I was inspired but the fact someone else works on it, so today I ready to release a new version of the decoder.
V0.2b is still early beta it still decodes only Progressive frames, but it’s twice faster than the previous version. (~150fps 4K and ~ 610fps HD)
API was not changed
Tag Archives: ProRes
Cuda optimized ProRes decoder
I don’t have a lot of free time last months, so really struggle to release a new Version of AMCDX Video Patcher. And to be fair when the main challenges solved I don’t have that much motivation.
I still interested in the performance part of the project what was to be fair the main goal.
There is though not really much left to optimize on CPU size (Prores Encoder/Decoder overperforms FFmpeg implementation, Frame Editor and File To File are fast enough)…
So I finally found some time to start the part of the project I was dreaming of during last year – GPU optimization.
So today I officially release ProRes Cuda optimized decoder. Its early beta: It doesn’t support interlaced frames yet, there plenty of room for extra optimizations, but it’s still good enough to show it.
So what supported in v0.1b?
1) Decoding of progressive ProRes frames on GPU (both 444 and 422 supported)
2) Always decodes to 12 bit
API
amcdx_cu_prores_decoder.dll exports functions:
1) void * amcdx_cupr_decoder_create() – creates decoder instance allocates memory so on.
Returns decoder handle.
2) int amcdx_cupr_decoder_decode(void * decoder, void * buffer, int size) – decodes passed frame
decoder – decoder handle returned by amcdx_cupr_decoder_create
buffer – encoded ProRes frame
size – frame size
Returns 0 if success, otherwise returns error code.
3) unsigned int amcdx_cupr_get_pitch(void * decoder) – returns plane line size. in 444 case line size same for all 3 planes, in 422 case line size of chroma planes equals amcdx_cupr_get_pitch / 2
decoder – decoder handle returned by amcdx_cupr_decoder_create
4) unsigned int amcdx_cupr_get_width(void * decoder) – returns width of decoded frame
decoder – decoder handle returned by amcdx_cupr_decoder_create
5) unsigned int amcdx_cupr_get_height(void * decoder) – returns height of decoded frame
decoder – decoder handle returned by amcdx_cupr_decoder_create
6) int amcdx_cupr_is_444(void * decoder) – returns 1 if we have 444 chroma subsampling, otherwise returns 0
decoder – decoder handle returned by amcdx_cupr_decoder_create
7) void amcdx_cupr_decoder_read(void * decoder, void ** buffer) – copies decoded frame from GPU to CPU. this function should be called if you frame buffer line sizes equals to amcdx_cupr_get_pitch
decoder – decoder handle returned by amcdx_cupr_decoder_create
buffer – output frame plane buffers
8) void amcdx_cupr_decoder_read_pitch(void * decoder, void ** buffer, int * pitch) – copies decoded frame from GPU to CPU. this function should be called if you frame buffer line sizes are not equal to amcdx_cupr_get_pitch
decoder – decoder handle returned by amcdx_cupr_decoder_create
buffer – output frame plane buffers
pitch – output frame plane line sizes
9) void amcdx_cupr_decoder_destroy(void * decoder) – destroys decoder instance
decoder – decoder handle returned by amcdx_cupr_decoder_create
10) const char * amcdx_cupr_version() – returns library version string
I added a simple wrapper so it could be used with FFmpeg
Pre-built Binaries
P.S. As I mentioned before it’s an early beta, so I didn’t do a lot of benchmarking. Currently, I have ~80 FPS decoding ProRes XQ 4444, 4K on Quadro P4000
AMCDX Video Patcher V0.6.0
Version 0.6.0 Released:
1) VC3 support (works only VC3 to VC3 profiles should be identical)
2) Added command-line version
3) File To File improved performance on Windows
4) Blur functionality was disabled
Windows Installer
Mac OS Installer
Linux Build available upon request
AMCDX Video Patcher CLI
Starting v0.6.0 you can run AMCDX Video Patcher without UI, in other words, you can run it as a command-line app. AMCDX Video Patcher accept as a parameter JSON (it could be JSON string or path to JSON file) for example:AMCDXVideoPathcer /Users/test/test.json
orAMCDXVideoPathcer "{ "processor": "f2f", "params": {...}}"
there are 2 fields: “processor” and “params”
a) processor defines what processor do you want to run. The value should be a String and should have one of 3 values:
1) “f2f” – run File To File processor
2) “frame” – run Frame Editor
3) “mov_meta” – run MOV/MP4 Metadata Editor
b) params define processor parameters. The value should be a JSON object each processor has a different structure.
f2f params
{
"src_file": String,
"dst_file": String,
"src_in_frame": Integer,
"dst_in_frame": Integer,
"duration": Integer,
"src_rect": {
"x": Integer,
"y": Integer,
"width": Integer,
"height": Integer
},
"dst_rect": {
"x": Integer,
"y": Integer,
"width": Integer,
"height": Integer
}
}
src_file | path to the source file (String) |
dst_file | path to the target file (String) |
src_in_frame | Source file IN Point (Integer, frame number) |
dst_in_frame | Target file IN Point (Integer, frame number) |
duration | Number of frames to insert from the Source to the Target file (Integer) |
src_rect | A rectangle of the Source file frame that should be inserted to the Target file frame (*), (**) |
dst_rect | Rectangle of Target file frame where should be inserted rectangle from the Source file (*), (**) |
(*) rect fields are optional if these fields are not set – the full-frame will be processed
(**) rect fields work only for ProRes codec, in VC3/AVCI/XAVC case these properties will be ignored
Frame Editor params
{
"video_file": String,
"png_path": String,
"in_point": Integer,
"duration": Integer,
"mode": String,
"rect": {
"x": Integer,
"y": Integer,
"width": Integer,
"height": Integer,
}
}
video_file | path to the source video file (String) |
png_path | path to png file to apply or a folder where to save PNGs (String) |
in_point | Video file IN Point (Integer, frame number) |
duration | Number of frames to modify with PNG image or Number of frames to save to png (Integer) |
mode | Can be one of 2 values “to_png” or “from_png”(String) to_png means we save selected rectangle to PNG files to the folder set by “png_path” from_png means we modify the selected rectangle by PNG files set by “png_path” |
rect | A rectangle of the Video file that should be modified or saved to PNG |
MOV/MP4 Metadata Editor Params
{
"video_file": String,
"headers_to_the_end": Boolean,
"timecode": {
"in_file": Boolean,
"tc": String,
"drop_flag": Boolean,
"reel": {
"in_file": Boolean,
"text": String
},
},
"nclc": {
"in_file": Boolean,
"primaries": Integer,
"transfer": Integer,
"matrix": Integer
},
"gama": {
"in_file": Boolean,
"gamma": Float
}
"pasp": {
"in_file": Boolean,
"h_spacing": Integer,
"v_spacing": Integer
}
"fiel": {
"in_file": Boolean,
"order": Integer
}
"mdcv": {
"in_file": Boolean,
"preset": Integer,
"max_lum": Float,
"min_lum": Float
}
"clli": {
"in_file": Boolean,
"max_cll": Integer,
"max_fall": Integer
}
}
*All fields are optional
*“in_file” is a Boolean field if it set to false it means Atom will be removed and other fields will be ignored. if “in_file” set to true it means we modify existing atom or add and modify newly added atom
headers_to_the_end | Defines if we should move headers to the end of the file or leave it as it (Boolean, Optional) |
timecode | in_file: if set to true Timecode track will be added (Boolean, Optional) tc: timecode in format “hh:mm:ss:frame” (String, Optional) drop_flag: set DF/NDF (Boolean, Optional) reel: { in_file: if set to false atom will be deleted otherwise added or edited existing (Boolean, Optional) text: Reel name (String, Optional) } |
nclc | in_file: if set to false atom will be deleted otherwise added or edited existing (Boolean, Optional) primaries: Color Primaries (Integer, Optional) transfer: Transfer Function (Integer, Optional) matrix: Color Matrix (Integer, Optional) |
gama | in_file: if set to false atom will be deleted otherwise added or edited existing (Boolean, Optional) gamma: Gamma value (Float, Optional) |
pasp | in_file: if set to false atom will be deleted otherwise added or edited existing (Boolean, Optional) h_spacing: Pixel width (Integer, Optional) v_spacing: Pixel height (Integer, Optional) |
fiel | in_file: if set to false atom will be deleted otherwise added or edited existing (Boolean, Optional) order: Field Order (Integer, Optional) |
mdcv | in_file: if set to false atom will be deleted otherwise added or edited existing (Boolean, Optional) preset: MDCV Presets (Integer, Optional) max_lum: Max display mastering luminance (Float, Optional) min_lum: Min display mastering luminance (Float, Optional) |
clli | in_file: if set to false atom will be deleted otherwise added or edited existing (Boolean, Optional) max_cll: Max content light level (Integer, Optional) max_fall: Max frame average light level (Integer, Optional) |
0 | Unknown |
1 | ITU-R BT.709 |
2 | Unspecified |
3 | Reserved |
4 | ITU-R BT.470M |
5 | ITU-R BT.601 625 |
6 | ITU-R BT.601 525 |
7 | SMPTE 240M |
8 | FILM |
9 | ITU-R BT.2020 |
10 | SMPTE ST 428-1 |
11 | DCI P3 |
12 | P3 D65 |
0 | Unknown |
1 | ITU-R BT.709 |
2 | Unspecified |
3 | Reserved |
4 | Gamma 2.2 |
5 | Gamma 2.8 |
6 | SMPTE 170M |
7 | SMPTE 240M |
8 | Linear |
9 | Logarithmic (100:1 range) |
10 | Logarithmic (316:1 range) |
11 | IEC 61966-2-4 |
12 | ITU-R BT.1361 (Extended Colour Gamut) |
13 | IEC 61966-2-1 |
14 | ITU-R BT.2020 10 bit |
15 | ITU-R BT.2020 12 bit |
16 | SMPTE ST 2084 (PQ) |
17 | SMPTE ST 428-1 |
18 | ARIB STD-B67 (Hybrid Log Gamma) |
0 | Unknown |
1 | ITU-R BT.709 |
2 | Unspecified |
3 | Reserved |
4 | FCC |
5 | BT470BG |
6 | ITU-R BT.601 |
7 | SMPTE 240M |
8 | YCOCG |
9 | ITU-R BT.2020 Non-constant Luminance |
10 | ITU-R BT.2020 Constant Luminance |
0 | Progressive |
1 | Top Field stored first, Top Field displayed first |
2 | Bottom Field stored first, Bottom Field displayed first |
3 | Top Field stored first, Bottom Field displayed first |
4 | Bottom Field stored first, Top Field displayed first |
0 | REC 709 |
1 | REC 601 – 625 |
2 | REC 601 – 525 |
3 | BT 2020 |
4 | DCI P3 |
5 | P3 D65 |
Samples:
File To File
Frame To PNG
Frame From PNG
Mov Metadata (Remove Gama, Edit nclc)
Mov Metadata (Edit Gama)
AMCDX VIDEO PATCHER V0.5.6
This is a minor release to fix App on MacOS without AVX2 Instruction set support.
Windows Installer
MacOS Installer
AMCDX Video Patcher V0.4.3
Version v0.4.3 released
Bugs Fixed:
1) Fixed MDCV Mastering Luma scaling
2) Fixed fl32 audio support
3) Improved ProRes decoder performance
Features:
1) Added DNx specific atoms support (ACLR, APRG, ADHR)
AMCDX Video Patcher v0.4.1
Version v0.4.1 released
Bugs Fixed:
1) Fixed “Frame Editor” Crash if you patch more than 1 frame
2) [Metadata Editor] fixed support of MP4 files from Premiere
3) [Metadata Editor] re-worked “Add timecode” so QuickTime7 accept it
4) [Metadata Editor] Implemented Frame Metadata editor “Cancel”
P.S. I was in rush to release the new version because of some critical bugs and forgot to update the version number, so If you run the latest version and see the title “v0.4.0” so be frustrated it is really 0.4.1 and it has all fixes mentioned
Windows Installer
Osx Installer
AMCDX Video Patcher v0.4.0
AMCDX Video Patcher v0.4.0 released: Picture-In-Picture was never that easy before. Starting version 0.4.0 there is no “Identical resolution” restriction, in other words you can use source and target files with different resolutions and insert only selected rectangle you are interested in.
Features Added:
1) [File to File] Ability select rectangle of interest instead of inserting whole frame
2) [Metadata Editor] Now can open and edit MP4 files
3) [Metadata Editor] CLLI and MDCV atoms edit/add/remove
Bugs Fixed:
1) Fixed support of Interlaced MXF files
2) Fixed playback of MXF files with padded ProRes
AMCDX Video Patcher v0.3.5
The new version is released, most of the efforts were directed to make Patcher available on Linux
Features:
1) Patcher available on Linux starting v0.3.5
2) Allow to Insert into MXF files (op1a and Op-Atom)
Bugs Fixed:
1) Various minor UI bugs
2) Fixed playback crash of files which contains both Progressive and Interlaced frames
3) fixed ProRes frame meta editor for hybrid files with Interlaced and Progressive frames
AMCDX Video Patcher V0.3.2
Version 0.3.2 released.
Features:
1. Added Keyboard shortcuts:
1.1. Space – Play/Pause
1.2. Arrow Left – Go to previous frame (works only if paused)
1.3. Arrow Right – Go to next frame (works only if paused)
1.4. Shift+Arrow Left – Go 15 frames back(works only if paused)
1.5. Shift+Arrow Right – Go 15 frames forward (works only if paused)
1.6. I – Set In Point
1.7. O – Set Out Point
1.8. Shift+I – Go to In Point
1.9. Shift+O – Go to Out Point
1.10. Delete/Backspace – Clear In and Out points
2. Now you can Drag & Drop a file to preview window to open it in application
Bugs Fixed:
1. WIN: fixed open file with a non-English letter in a file path
2. Fixed big-endian audio playback
3. Fixed preview Video <-> Full Range colors