ultravideo / kvazaar

An open-source HEVC encoder
BSD 3-Clause "New" or "Revised" License
838 stars 181 forks source link

How to skip fames when encoding? #248

Open chamaraManoj opened 5 years ago

chamaraManoj commented 5 years ago

I know this is not an issue with a library, but I need some help with following task.

I am trying to encode file, while skipping frame number by 4. i.e. frames read are, frame 0 frame 4 frame 8 ....

I tried with "lp-g" but it did not work. Is Kvazaar encoder is capable of doing that? Are there any more comprehensive guidance for your encoder?

fador commented 5 years ago

Hi, At the moment I don't think it's possible to read every Nth frame in kvazaar, but it would be a relatively easy change to do in the reading loop of the CLI: https://github.com/ultravideo/kvazaar/blob/master/src/encmain.c#L198 For example by adding a loop from line 197 to line 238

#define EVERY_Nth_FRAME 4
static int internal_frames_read = 0;
197 do {
internal_frames_read++;
...
238 } while((internal_frames_read-1)%EVERY_Nth_FRAME ==0)

(Code not tested, just as an example and does not work if using as a library)

We can consider adding a commandline parameter for that, but I'll have to ask the other guys if they have time to implement and test ;)

The README.md is the best "guide" at the moment, but you can always ask us for help!