In regards to running the samples in the jetson_multimedia_api, specifically 01_video_encode on the nvidia jetson.
I have noticed there is a difference between the H264 packets created by libavcodec and the jetson multimedia api.
By default, libavcodec appears to put in all the necessary codec parameters in every packet or at least every so often.
So if the first several H264 packets from the libavcodec are not written to disk, the packet stream can still be decoded.
But I cannot get jetson_multimedia_api video_encode sample to do this.
So, if the first packets from the sample are not written to disk using the jetson, decoding by vlc or ffprobe fails.
When running this ./video_encode …/…/data/Video/sample_outdoor_car_1080p_10fps.yuv 1920 1080 H264 sample_outdoor_car_1080p_10fps.h264
both vlc and ffprobe read the resulting file in succesfully.
If, I modify video_encode_main.cpp and I make a modification to skip writing the first few files,
Write encoded frame data.
@param stream : output stream
@param buffer : output nvbuffer
write_encoder_output_frame(ofstream * stream, NvBuffer * buffer)
static int skip = 0;
if(skip > 10)
stream->write((char *) buffer->planes.data, buffer->planes.bytesused);
VLC cannot play the file, and ffprobe returns this error
[h264 @ 0x559a30be80] decode_slice_header error
[h264 @ 0x559a30be80] no frame!
[h264 @ 0x559a30be80] non-existing PPS 0 referenced
[h264 @ 0x559a30aed0] decoding for stream 0 failed
[h264 @ 0x559a30aed0] Could not find codec parameters for stream 0 (Video: h264, none): unspecified size
Consider increasing the value for the ‘analyzeduration’ and ‘probesize’ options
How can I get the codec paramters into the H264 packets to acheive the same as libavcodec?