<br><br>On Thursday, May 26, 2022, Andrew Randrianasulu <<a href="mailto:randrianasulu@gmail.com">randrianasulu@gmail.com</a>> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><br><br>On Thursday, May 26, 2022, Andrew Randrianasulu <<a href="mailto:randrianasulu@gmail.com" target="_blank">randrianasulu@gmail.com</a>> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><br><br>On Thursday, May 26, 2022, Andrew Randrianasulu <<a href="mailto:randrianasulu@gmail.com" target="_blank">randrianasulu@gmail.com</a>> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><br><br>On Thursday, May 26, 2022, Phyllis Smith via Cin <<a href="mailto:cin@lists.cinelerra-gg.org" target="_blank">cin@lists.cinelerra-gg.org</a>> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div dir="ltr"><div class="gmail_default" style="font-size:small">Checked these 2 into GIT after testing.  About the following:<br></div></div><br><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
Instead "h264_vaapi.mkv" gives me error and no rendering.<br>
<br>
Error message popup:<br>
"error rendering data"<br>
<br>
On terminal:<br>
FFMPEG::encode_activate: write header failed /home/paz/vaapi_test.mkv<br>
  err: Invalid data found when processing input<br>
Render::render_single: Session finished.<br></blockquote><div><br></div><div style="font-size:small" class="gmail_default">I added a message to the format to state that the mkv "only works on computer that has vaapi capable software and hardware".  I got the same error message as Andrew on my AMD laptop that does not handle vaapi, but an old HP laptop has it working.  Not exactly sure that is the correct reason but it is all I could think of.  Correct me if I am wrong.<br></div></div></div></blockquote><div><br></div><div>may be mkv muxer in ffmpeg more strict (or buggy)? </div><div><br></div><div>if you try to re-mux vaapi-encoded h264 mp4 into mkv with ffmpeg -i file.mp4 -c:v copy (..other params) file.mkv - does it work? </div></blockquote><div><br></div><div><br></div><div>at least for some user it was not working in ~2020... may be AMD driver/firmware need some support? </div><div><br></div><div><br></div><div><a href="https://forums.gentoo.org/viewtopic-t-1107846-start-0.html" target="_blank">https://forums.gentoo.org/view<wbr>topic-t-1107846-start-0.html</a></div></blockquote><div><br></div><div><br></div><div>ah, googling exact error showed up solution in this bug:</div><div><br></div><div><a href="https://gitlab.freedesktop.org/mesa/mesa/-/issues/2351" target="_blank">https://gitlab.freedesktop.<wbr>org/mesa/mesa/-/issues/2351</a></div><div><br></div><div>should be fixed if your mesa has commits from:</div><div><br></div><div><a href="https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4184/commits" target="_blank">https://gitlab.freedesktop.<wbr>org/mesa/mesa/-/merge_<wbr>requests/4184/commits</a></div><div><br></div><div>but may be latest nesa reintroduced this bug...? </div><div><br></div><div>Also, you can try this bsf metadata option... (not sure how to use it yet) </div></blockquote><div><br></div><div><br></div><div><br></div><div><a href="https://www.ffmpeg.org/ffmpeg-bitstream-filters.html#toc-dump_005fextra">https://www.ffmpeg.org/ffmpeg-bitstream-filters.html#toc-dump_005fextra</a></div><div><br></div><div>===</div><div>For example the following ffmpeg command forces a global header (thus disabling individual packet headers) in the H.264 packets generated by the libx264 encoder, but corrects them by adding the header stored in extradata to the key packets:</div><div><br></div><div>ffmpeg -i INPUT -map 0 -flags:v +global_header -c:v libx264 -bsf:v dump_extra out.ts</div><div><br></div><div>===</div><div><br></div><div>if modification of such command work for ffmpeg vaapi encoding and muxing into mkv on AMD hardware (!) we hopefully can add this to our newly-added profile? </div><div><br></div><div>It seems ffmpeg.C already supports adding bitstream filters at encoder side... </div><div><br></div><div>Successfully rebased and updated refs/heads/master.</div><div>$ cd cinelerra/</div><div>$ grep av_bsf ffmpeg.C</div><div>        if( bsfc ) av_bsf_free(&bsfc);</div><div>                ret = av_bsf_send_packet(bsfc, pkt);</div><div>                        if( (ret=av_bsf_receive_packet(bsfc, bs)) < 0 ) {</div><div>                ret = av_bsf_list_parse_str(bsfilter, &fst->bsfc);</div><div>$ mcedit ffmpeg.C</div><div><br></div><div>---</div><div><br></div><div>you can look up av_bsf_list_parse_str documentation.... </div><div><br></div><div><a href="https://ffmpeg.org/doxygen/3.2/group__lavc__misc.html#gacc7bbd4bb41b36893f6ad971fd95f7fb">https://ffmpeg.org/doxygen/3.2/group__lavc__misc.html#gacc7bbd4bb41b36893f6ad971fd95f7fb</a></div><div><br></div><div>===</div><div><br></div><div>int av_bsf_list_parse_str       (       const char *    str,</div><div>AVBSFContext **      bsf </div><div>)  </div><div>Parse string describing list of bitstream filters and create single AVBSFContext describing the whole chain of bitstream filters.</div><div><br></div><div>Resulting AVBSFContext can be treated as any other AVBSFContext freshly allocated by av_bsf_alloc().</div><div><br></div><div>Parameters</div><div>str       String describing chain of bitstream filters in format bsf1[=opt1=val1:opt2=val2][,bsf2]</div><div><br></div><div>[out]   bsf     Pointer to be set to newly created AVBSFContext structure representing the chain of bitstream filters</div><div>Returns</div><div>>=0 on success, negative AVERROR in case of failure</div><div><br></div><div>===</div><div><br></div><div>and try to have fun with h264_metadata (try rotation as example?) by modifying one from our h264 profiles (temporarily) </div><div><br></div>