Hello,
Tesla K20X, using the 352.101 on Linux.
I’m a bit lost on how to properly start encoding another stream after flushing the encoder.
Scenario 1:
Stream 1: create encoder and input/output buffers
Stream 1: encode normally
Stream 1: submit an EOS by setting NV_ENC_PIC_PARAMS::encodePicFlags = NV_ENC_PIC_FLAG_EOS
Stream 1: process pending packets
Stream 2: destroy input/output buffers and encoder
Stream 2: create new encoder and input/output buffers
Stream 2: encode normally
Stream 2: submit an EOS…
Scenario 1 works fine, and all of the raw h264 streams can be muxed to mp4 and viewed without issue.
Scenario 2:
Stream 1: create encoder and input/output buffers
Stream 1: encode normally
Stream 1: submit an EOS
Stream 1: process pending packets
Stream 2: for the first frame, set encodePicFlags = NV_ENC_PIC_FLAG_FORCEINTRA
Stream 2: encode normally
Stream 2: submit EOS
Stream 2: process pending packets
…
Stream N: destroy input/output buffers and encoder
For Scenario 2, the very first stream works fine. FFmpeg throws “[h264 @ 0x235e860] non-existing PPS 0 referenced” errors for every other stream, which implies that the first keyframe (and maybe more) is missing.
The programming guide implies that Scenario 2 should work: “EOS notification effectively flushes the encoder. This can be called multiple times in a single encode session.” However, it doesn’t say that anything is needed besides sending an EOS and finishing the output processing. Any ideas what I might be missing?