-
Notifications
You must be signed in to change notification settings - Fork 81
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
api2-decode-encode-video.cpp
example and correct stream tear-down sequence
#113
Comments
This is what I do to manually count the frames w/ resynchronization on the input stream when it is possible: |
There are two separate issues that prevent the clean teardown First one: Line 953 in 4aaaaa1
There are two possible sources for the timebase here - either from the current frame - which works for all frames except the last one where the encoder is called with an empty frame - either from Second one: Line 85 in 4aaaaa1
This should be: |
Thanks for reporting and fix! |
I am using avcpp to create Node.js bindings for ffmpeg as a PoC for nobind
It is a very good C++ wrapper and it would be a pity to leave it to fall into disrepair.
It seems that the
example/api2-samples/api2-decode-encode-video.cpp
does not work with ffmpeg 5.0/6.0.It does not set the PTS/DTS when writing and ffmpeg complains and (sometimes) eventually chokes.
I added some rudimentary PTS/DTS calculations - they should probably go into the example - and now the problem is the flushing of the last frame.
Looking from the code:
avcpp/example/api2-samples/api2-decode-encode-video.cpp
Line 158 in 4aaaaa1
This expects that an EOF is signaled by
decode
returning a falsy frame. However it does not do that - at the last packet,readPacket
returns a falsy packet, but when pusing it through the codec, it returns one more valid frame. When trying to read again,readPacket
returns another falsy packet and this timedecode
throws an EOF error - which probably means that it shouldn't have been called at this point.Do you know what is the correct sequence to tear down the stream?
The text was updated successfully, but these errors were encountered: