mustardman
18th January 2015, 03:36
I have searched aplenty, on this forum and others, and found nothing - so please don't flame me (too bad) if this has been previously discussed!
I know there are issues around multithreading an encode as things have to happen in a very specific order for anything other than straight I-frames (eg: DV, MJPEG). However, a lot of CPUs now have multiple cores, and effectively, all but one remains idle for an encode task. It bugs me that video encoding is performed using just a single core. (Although each 'core' of the CPU varies its' load, the total always remains at about "1").
Now, perhaps others far cleverer than I have already thought of this, but what if an encode task is broken down into really large chunks, rather than the appraoch that people seen to be stuck at - encoding a stream with multiiple threads/cores (admittedly, an insolvable problem).
A lot of encoding tasks are done on an existing, and complete, file - not a stream (unless you are into live broadcasting, in which case encoding at more than real time is not necessary anyway). What if the file is broken into peieces? Say, for a quad-core CPU, the file is broken into four pieces. Each piece is encoded separately, and encoding the file becomes four times faster.
The rub? Where on earth would you cut the file so the GOPs align when the task is complete? What about the cuts are done completely arbitarily. Since every encoding 'engine' is working to the same algorithm, a scene cut that forces a new GOP occuring close to the start of 'block 2' can be matched with a GOP that occurs from an over-run of 'block 1' into 'block 2'.
IE: There will be some overlaps between each block, but the overlaps should be small, particulary if the file to be encoded is large.
Is something like this possible, or am I delusional?
Cheers,
MM.
I know there are issues around multithreading an encode as things have to happen in a very specific order for anything other than straight I-frames (eg: DV, MJPEG). However, a lot of CPUs now have multiple cores, and effectively, all but one remains idle for an encode task. It bugs me that video encoding is performed using just a single core. (Although each 'core' of the CPU varies its' load, the total always remains at about "1").
Now, perhaps others far cleverer than I have already thought of this, but what if an encode task is broken down into really large chunks, rather than the appraoch that people seen to be stuck at - encoding a stream with multiiple threads/cores (admittedly, an insolvable problem).
A lot of encoding tasks are done on an existing, and complete, file - not a stream (unless you are into live broadcasting, in which case encoding at more than real time is not necessary anyway). What if the file is broken into peieces? Say, for a quad-core CPU, the file is broken into four pieces. Each piece is encoded separately, and encoding the file becomes four times faster.
The rub? Where on earth would you cut the file so the GOPs align when the task is complete? What about the cuts are done completely arbitarily. Since every encoding 'engine' is working to the same algorithm, a scene cut that forces a new GOP occuring close to the start of 'block 2' can be matched with a GOP that occurs from an over-run of 'block 1' into 'block 2'.
IE: There will be some overlaps between each block, but the overlaps should be small, particulary if the file to be encoded is large.
Is something like this possible, or am I delusional?
Cheers,
MM.