disguise-one / hap-encoder-adobe-cc

Community-supported exporter of HAP codec family for Adobe CC applications
Other
169 stars 16 forks source link

AME hap export cut last frame #2

Closed exscriber closed 5 years ago

exscriber commented 5 years ago

It happen with AE to AME render, and File to File transcode from 60sec 25 fps file it render only 1499 frames, not 1500 like QT Hap (and other codecs) file to play with: https://www.dropbox.com/s/kw0al6es559ra95/Comp%201.mp4?dl=0

GregBakker commented 5 years ago

Could you try an export to h264 and see if that drops the last frame too please?

I have observed that behaviour from AME previously; it may not be a codec thing.

Thanks, Greg

On Tue, 25 Sep 2018 at 11:31, Nick Zinovenko notifications@github.com wrote:

It happen with AE to AME render, and File to File transcode from 60sec 25 fps file it render only 1499 frames, not 1500 like QT Hap (and other codecs) file to play with: https://www.dropbox.com/s/kw0al6es559ra95/Comp%201.mp4?dl=0

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/disguise-one/hap-adobe-premiere-plugin/issues/2, or mute the thread https://github.com/notifications/unsubscribe-auth/AGqHEzXVNgqf-KxMVR_ZjAXbRBukBp8Hks5uegX0gaJpZM4W4Ul9 .

exscriber commented 5 years ago

Exports from https://www.dropbox.com/s/kw0al6es559ra95/Comp%201.mp4?dl=0 file (1500 frames with timecode text): h264: 00:00:00:00 - 00:00:59:24 1500 frames QT Hap: 00:00:00:00 - 00:00:59:24 1500 frames FlexRes: 00:00:00:00 - 00:00:59:24 1500 frames Hap plugin: 00:00:00:00 - 00:00:59:23 1499 frames

In/out markers in AME not touched: AME itself set markers to 00:00:00:00 - 00:01:00:00, but correctly render file as 00:00:00:00 - 00:00:59:24

AME 12.0.1 version for windows if it matter - not last one because of QT support

GregBakker commented 5 years ago

Thanks,

I'll be able to take a look at the cause in code on Friday.

Greg

On Tue, 25 Sep 2018 at 12:03, Nick Zinovenko notifications@github.com wrote:

Exports from https://www.dropbox.com/s/kw0al6es559ra95/Comp%201.mp4?dl=0 file (1500 frames with timecode text): h264: 00:00:00:00 - 00:00:59:24 1500 frames QT Hap: 00:00:00:00 - 00:00:59:24 1500 frames FlexRes: 00:00:00:00 - 00:00:59:24 1500 frames Hap plugin: 00:00:00:00 - 00:00:59:23 1499 frames

In/out markers in AME not touched: AME itself set markers to 00:00:00:00 - 00:01:00:00, but correctly render file as 00:00:00:00 - 00:00:59:24

AME 12.0.1 version for windows if it matter - not last one because of QT support

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/disguise-one/hap-adobe-premiere-plugin/issues/2#issuecomment-424299852, or mute the thread https://github.com/notifications/unsubscribe-auth/AGqHE8OrhkCuaY3wd6dx73usmk_YZ5Feks5ueg2HgaJpZM4W4Ul9 .

exscriber commented 5 years ago

Partial solution: for even fps like 25, 30, etc

main.cpp:
-        renderParams.inEndTime = exportInfoP->endTime;
+        renderParams.inEndTime = exportInfoP->endTime + frameRateDenominator; //add one more frame to render

but it not mimic QT hap or h264 with 29.97 framerates, only with 25fps

PS: with patch it start to mimic FlexRes behavior: both right for 25fps, but both wrong for 29.97 AE Test Project: https://www.dropbox.com/s/9o2xks02wmtu8b0/AE-frame-count.aep?dl=0

GregBakker commented 5 years ago

That patch looks correct though; I'll have to look at the QT hap source and see where it's inconsistent.

I'll make that change; thanks for the investigation.

GregBakker commented 5 years ago

I've added the change; still need to check if QT hap was doing the right thing. The Adobe API seems slightly inconsistent here too.

exscriber commented 5 years ago

Hi Greg I was wrong about issue roots: SDK work as expected - so patch is wrong and not needed. AME render all 1500 frames without it.

But something not right with time_base setting in muxer, You can see it with ffprobe -show_entries stream=codec_time_base,time_base,avg_frame_rate 1.mov

Hap-CC: codec_time_base=1499/37500 (~25,0167 fps), and d3 also show 25,0167 fps. QT-Hap: codec_time_base=1/25 (25fps)

And slight fps increase cause last frame hiding in AE, d3, other software...

GregBakker commented 5 years ago

Older code I started with [using a different non-multithreaded api] had the non-inclusive end code as well; so maybe there's something subtle here. The main thing is are we exporting the same frames as (say) an Adobe-written H264 export. The fps-reporting issue is probably a different matter. I'll raise a separate issue on that.

exscriber commented 5 years ago

Hap-CC AME test render with release 1.0.8-rc4 version: 1minute 25fps 1500 frames file d3 and ffprobe: both show 1500 frames exist in file. With wrong fps, but no frames missed.

So Hap-CC not cut frames during AME render. No renderParams.inEndTime adjust needed.

What looks like missing last frame: most likely caused by issue #15.