You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm investigating this and it's going to require something a bit more than just caching in the title. The problem is that all the GUIs use separate hb_handle_t for scan vs. encode vs. live preview. For example, LinGui has 2 global hb_handle_t. One is used for encodes and the other is used for scan and live preview generation. The titles are attached to the hb_handle_t.
This is OK when not using the json APIs as the non-json APIs take a hb_title_t parameter and we pass the title from the other hb_handle_t when initializing the job (I personally think this is bad practice since the other hb_handle_t and it's titles could be freed while the job is still holding a reference to the title. But that's the way it's been done for quite some time now). But the json APIs take only a title index and the job will do a single title scan to fill in it's own title information.
So caching FAS results in the title during live preview generation will not make that information available automatically for encoding when using the json APIs.
But, I've been thinking for some time now that it would be advantageous to somehow include the full title information in the json job rather than just the title index. This would eliminate the need for the extra single title scan that currently happens when performing a json job. This doesn't really solve the problem of communicating the updated title information after the job completes back to the GUI, but it's part of the way there. We would have to add an API to allow the GUI to query results after a job finishes.
So, for the live preview scenario. GUI performs live preview encode (with subtitle scan). GUI uses new API to query job results an update it's own local copy of title information (this means the GUI must keep it's own local copy of titles). hb_json_job_init is changed (or new API created) that accepts a json version of the title rather than a title index. GUI initializes all jobs from it's local updated versions of titles.
This may sound like a bit of overkill, but I'm thinking it could be used for additional analysis that we don't currently do. For example, for certain subtitle types, we don't know the duration until we see the next subtitle. We currently delay the subtitle pipelines and wait for the next subtitle to compute duration. But this results in improperly interleaved output files in some cases. We could cache subtitle durations whenever a scan pass is performed. So my thought is that being able to feed back title related information to the GUI after a job completes is generally useful. We could even have a "full scan" mode that does things like analyze every frame for interlacing, motion, or other types of artefacts and makes suggestions based on the results.
Anyway, not a quick hit solution to this, but it's worth doing IMO.
Activity
jstebbins commentedon Jun 21, 2017
I'm investigating this and it's going to require something a bit more than just caching in the title. The problem is that all the GUIs use separate hb_handle_t for scan vs. encode vs. live preview. For example, LinGui has 2 global hb_handle_t. One is used for encodes and the other is used for scan and live preview generation. The titles are attached to the hb_handle_t.
This is OK when not using the json APIs as the non-json APIs take a hb_title_t parameter and we pass the title from the other hb_handle_t when initializing the job (I personally think this is bad practice since the other hb_handle_t and it's titles could be freed while the job is still holding a reference to the title. But that's the way it's been done for quite some time now). But the json APIs take only a title index and the job will do a single title scan to fill in it's own title information.
So caching FAS results in the title during live preview generation will not make that information available automatically for encoding when using the json APIs.
But, I've been thinking for some time now that it would be advantageous to somehow include the full title information in the json job rather than just the title index. This would eliminate the need for the extra single title scan that currently happens when performing a json job. This doesn't really solve the problem of communicating the updated title information after the job completes back to the GUI, but it's part of the way there. We would have to add an API to allow the GUI to query results after a job finishes.
So, for the live preview scenario. GUI performs live preview encode (with subtitle scan). GUI uses new API to query job results an update it's own local copy of title information (this means the GUI must keep it's own local copy of titles). hb_json_job_init is changed (or new API created) that accepts a json version of the title rather than a title index. GUI initializes all jobs from it's local updated versions of titles.
This may sound like a bit of overkill, but I'm thinking it could be used for additional analysis that we don't currently do. For example, for certain subtitle types, we don't know the duration until we see the next subtitle. We currently delay the subtitle pipelines and wait for the next subtitle to compute duration. But this results in improperly interleaved output files in some cases. We could cache subtitle durations whenever a scan pass is performed. So my thought is that being able to feed back title related information to the GUI after a job completes is generally useful. We could even have a "full scan" mode that does things like analyze every frame for interlacing, motion, or other types of artefacts and makes suggestions based on the results.
Anyway, not a quick hit solution to this, but it's worth doing IMO.