Closed jeryini closed 3 months ago
@jeryini If I try to playback the 10s video you provided in VLC player it is unable to do so. If I convert it to mp4 using ffmpeg I can play it and if I convert it back to raw h265 I can also play it:
ffmpeg -i video.h265 -c copy -movflags +faststart output.mp4
ffmpeg -i output.mp4 -c:v libx265 fout.h265
Also in the attached file I am not able to find the CPD data in Annex B format (i.e. I don't see the 40, 42, 44) sections but when I use ffmpeg to containerize it into MP4 then back to raw h265 I do see those start codes and the CPD data in Annex B format as I would expect.
I understand that the viewer shows you the InvalidCodecPrivateDataException
error. Can you please share any logs you have including the actual request / response for the PutMedia call itself? Did you receive persisted acks on the producer side while calling PutMedia? In addition are you able to verify using the KVS Stream metrics that there are incoming bytes?
Closing due to inactivity. Feel free to reopen if there's an update
Hi! We've implemented custom Android Producer, using examples as a reference point from:
The implementation should work correctly as in the AWS console we can see that data is being streamed:
We're streaming H.265 encoded video stream and have found out the following CPD (Codec Private Data) in the stream:
It consists of Sequence Parameter Set (SPS), Picture Parameter Set (PPS) and Video Parameter Set (VPS) frames, each starting with start bytes
00 00 00 01
. As specified in the reference manual for Stream Structures we've used this data to specify thefinal byte[] codecPrivateData
when creating a newStreamInfo
object, which is created in our implementation of customMediaSource
, overridden in methodgetStreamInfo
. Based on above data in the stream we've passed it in the following way:Also we've specified flag
NAL_ADAPTATION_ANNEXB_CPD_AND_FRAME_NALS
as last parameter when creatingStreamInfo
. According to the following document about NAL Adaptation Flags our stream is in Annex-B delimited format for NALUs, which means we need to use that flag.But regardless of all that, we're still seeing the following error in KVS media viewer:
I've prepared a 10s long video stream in H.265 accessible here if it helps debug this issue and to check that CPD is indeed correct.