<div dir="ltr">Hi All,<div><br></div><div>I'm trying to programmatically  add metadata to each frame of a video stream. The target encoding is HEVC (via NVENC) stored in an MP4 container. I haven't had success using any of the following (showing only relevant code snippets for brevity):</div><div><br></div><div>1) AVFrame::metadata</div><div><br></div><div><pre style="margin-top:0px;margin-bottom:0px"><font color="#000000" face="monospace, monospace">av_dict_set(&frame->metadata, "my-custom-key", data, 0); // data: 23-char string</font></pre></div><div><br></div><div>2) AVFrame::opaque</div><div><br></div><div><pre style="margin-top:0px;margin-bottom:0px"><font color="#000000" face="monospace, monospace">frame->opaque = malloc(size);</font></pre></div><div><pre style="margin-top:0px;margin-bottom:0px"><font color="#000000" face="monospace, monospace">strcpy(frame->opaque, data);</font><br></pre><pre style="margin-top:0px;margin-bottom:0px"><span style="color:rgb(170,170,170)"><br></span></pre></div><div>3) AVFrame::opaque_ref</div><div><br></div><div><pre style="margin-top:0px;margin-bottom:0px"><font color="#000000" face="monospace, monospace">frame->opaque_ref = av_buffer_create(data, size, av_buffer_default_free, NULL, 0);</font></pre><pre style="margin-top:0px;margin-bottom:0px"><span style="color:rgb(170,170,170)"><br></span></pre>Any suggestions what I'm doing wrong? Also, could anyone point me to any examples how to do this.</div><div><br></div><div>Many thanks in advance,</div><div><br></div><div>Dzhoshkun</div></div>