Fwd: two more h264_vaapi profile for cingg
---------- Forwarded message ---------- From: *Андрей Рандрианасулу* <[email protected]> Date: Wednesday, May 25, 2022 Subject: two more h264_vaapi profile for cingg To: randrianasulu <[email protected]> both tested on Intel integrated video /webcam -- Андрей Рандрианасулу
I tried the new presets. "H264_vaapi.qt" works smoothly, but I didn't see any speed increase over h264.mp4 Render::render_single: Session finished. ** rendered 677 frames in 36.564 secs, 18.515 fps Instead "h264_vaapi.mkv" gives me error and no rendering. Error message popup: "error rendering data" On terminal: FFMPEG::encode_activate: write header failed /home/paz/vaapi_test.mkv err: Invalid data found when processing input Render::render_single: Session finished.
On Wednesday, May 25, 2022, Andrea paz <[email protected]> wrote:
I tried the new presets. "H264_vaapi.qt" works smoothly, but I didn't see any speed increase over h264.mp4
Render::render_single: Session finished. ** rendered 677 frames in 36.564 secs, 18.515 fps
well, I imagined main use for this format will be just encoding h264 wuth pcm sound (something ffmpeg refuses to do)
Instead "h264_vaapi.mkv" gives me error and no rendering.
Error message popup: "error rendering data"
On terminal: FFMPEG::encode_activate: write header failed /home/paz/vaapi_test.mkv err: Invalid data found when processing input Render::render_single: Session finished.
strange, will retest when I actually return to home...
Checked these 2 into GIT after testing. About the following: Instead "h264_vaapi.mkv" gives me error and no rendering.
Error message popup: "error rendering data"
On terminal: FFMPEG::encode_activate: write header failed /home/paz/vaapi_test.mkv err: Invalid data found when processing input Render::render_single: Session finished.
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.
On Thursday, May 26, 2022, Phyllis Smith via Cin <[email protected]> wrote:
Checked these 2 into GIT after testing. About the following:
Instead "h264_vaapi.mkv" gives me error and no rendering.
Error message popup: "error rendering data"
On terminal: FFMPEG::encode_activate: write header failed /home/paz/vaapi_test.mkv err: Invalid data found when processing input Render::render_single: Session finished.
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.
may be mkv muxer in ffmpeg more strict (or buggy)? 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?
On Thursday, May 26, 2022, Andrew Randrianasulu <[email protected]> wrote:
On Thursday, May 26, 2022, Phyllis Smith via Cin < [email protected]> wrote:
Checked these 2 into GIT after testing. About the following:
Instead "h264_vaapi.mkv" gives me error and no rendering.
Error message popup: "error rendering data"
On terminal: FFMPEG::encode_activate: write header failed /home/paz/vaapi_test.mkv err: Invalid data found when processing input Render::render_single: Session finished.
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.
may be mkv muxer in ffmpeg more strict (or buggy)?
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?
at least for some user it was not working in ~2020... may be AMD driver/firmware need some support? https://forums.gentoo.org/viewtopic-t-1107846-start-0.html
On Thursday, May 26, 2022, Andrew Randrianasulu <[email protected]> wrote:
On Thursday, May 26, 2022, Andrew Randrianasulu <[email protected]> wrote:
On Thursday, May 26, 2022, Phyllis Smith via Cin < [email protected]> wrote:
Checked these 2 into GIT after testing. About the following:
Instead "h264_vaapi.mkv" gives me error and no rendering.
Error message popup: "error rendering data"
On terminal: FFMPEG::encode_activate: write header failed /home/paz/vaapi_test.mkv err: Invalid data found when processing input Render::render_single: Session finished.
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.
may be mkv muxer in ffmpeg more strict (or buggy)?
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?
at least for some user it was not working in ~2020... may be AMD driver/firmware need some support?
ah, googling exact error showed up solution in this bug: https://gitlab.freedesktop.org/mesa/mesa/-/issues/2351 should be fixed if your mesa has commits from: https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4184/commits but may be latest nesa reintroduced this bug...? Also, you can try this bsf metadata option... (not sure how to use it yet)
On Thursday, May 26, 2022, Andrew Randrianasulu <[email protected]> wrote:
On Thursday, May 26, 2022, Andrew Randrianasulu <[email protected]> wrote:
On Thursday, May 26, 2022, Andrew Randrianasulu <[email protected]> wrote:
On Thursday, May 26, 2022, Phyllis Smith via Cin < [email protected]> wrote:
Checked these 2 into GIT after testing. About the following:
Instead "h264_vaapi.mkv" gives me error and no rendering.
Error message popup: "error rendering data"
On terminal: FFMPEG::encode_activate: write header failed /home/paz/vaapi_test.mkv err: Invalid data found when processing input Render::render_single: Session finished.
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.
may be mkv muxer in ffmpeg more strict (or buggy)?
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?
at least for some user it was not working in ~2020... may be AMD driver/firmware need some support?
ah, googling exact error showed up solution in this bug:
https://gitlab.freedesktop.org/mesa/mesa/-/issues/2351
should be fixed if your mesa has commits from:
https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4184/commits
but may be latest nesa reintroduced this bug...?
Also, you can try this bsf metadata option... (not sure how to use it yet)
https://www.ffmpeg.org/ffmpeg-bitstream-filters.html#toc-dump_005fextra === 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: ffmpeg -i INPUT -map 0 -flags:v +global_header -c:v libx264 -bsf:v dump_extra out.ts === 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? It seems ffmpeg.C already supports adding bitstream filters at encoder side... Successfully rebased and updated refs/heads/master. $ cd cinelerra/ $ grep av_bsf ffmpeg.C if( bsfc ) av_bsf_free(&bsfc); ret = av_bsf_send_packet(bsfc, pkt); if( (ret=av_bsf_receive_packet(bsfc, bs)) < 0 ) { ret = av_bsf_list_parse_str(bsfilter, &fst->bsfc); $ mcedit ffmpeg.C --- you can look up av_bsf_list_parse_str documentation.... https://ffmpeg.org/doxygen/3.2/group__lavc__misc.html#gacc7bbd4bb41b36893f6a... === int av_bsf_list_parse_str ( const char * str, AVBSFContext ** bsf ) Parse string describing list of bitstream filters and create single AVBSFContext describing the whole chain of bitstream filters. Resulting AVBSFContext can be treated as any other AVBSFContext freshly allocated by av_bsf_alloc(). Parameters str String describing chain of bitstream filters in format bsf1[=opt1=val1:opt2=val2][,bsf2] [out] bsf Pointer to be set to newly created AVBSFContext structure representing the chain of bitstream filters Returns
=0 on success, negative AVERROR in case of failure
=== and try to have fun with h264_metadata (try rotation as example?) by modifying one from our h264 profiles (temporarily)
On Thursday, May 26, 2022, Andrew Randrianasulu <[email protected]> wrote:
On Thursday, May 26, 2022, Andrew Randrianasulu <[email protected]> wrote:
On Thursday, May 26, 2022, Andrew Randrianasulu <[email protected]> wrote:
On Thursday, May 26, 2022, Andrew Randrianasulu <[email protected]> wrote:
On Thursday, May 26, 2022, Phyllis Smith via Cin < [email protected]> wrote:
Checked these 2 into GIT after testing. About the following:
Instead "h264_vaapi.mkv" gives me error and no rendering.
Error message popup: "error rendering data"
On terminal: FFMPEG::encode_activate: write header failed /home/paz/vaapi_test.mkv err: Invalid data found when processing input Render::render_single: Session finished.
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.
may be mkv muxer in ffmpeg more strict (or buggy)?
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?
at least for some user it was not working in ~2020... may be AMD driver/firmware need some support?
ah, googling exact error showed up solution in this bug:
https://gitlab.freedesktop.org/mesa/mesa/-/issues/2351
should be fixed if your mesa has commits from:
https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4184/commits
but may be latest nesa reintroduced this bug...?
Also, you can try this bsf metadata option... (not sure how to use it yet)
https://www.ffmpeg.org/ffmpeg-bitstream-filters.html#toc-dump_005fextra
=== 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:
ffmpeg -i INPUT -map 0 -flags:v +global_header -c:v libx264 -bsf:v dump_extra out.ts
===
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?
It seems ffmpeg.C already supports adding bitstream filters at encoder side...
Successfully rebased and updated refs/heads/master. $ cd cinelerra/ $ grep av_bsf ffmpeg.C if( bsfc ) av_bsf_free(&bsfc); ret = av_bsf_send_packet(bsfc, pkt); if( (ret=av_bsf_receive_packet(bsfc, bs)) < 0 ) { ret = av_bsf_list_parse_str(bsfilter, &fst->bsfc); $ mcedit ffmpeg.C
---
you can look up av_bsf_list_parse_str documentation....
https://ffmpeg.org/doxygen/3.2/group__lavc__misc.html# gacc7bbd4bb41b36893f6ad971fd95f7fb
===
int av_bsf_list_parse_str ( const char * str, AVBSFContext ** bsf ) Parse string describing list of bitstream filters and create single AVBSFContext describing the whole chain of bitstream filters.
Resulting AVBSFContext can be treated as any other AVBSFContext freshly allocated by av_bsf_alloc().
Parameters str String describing chain of bitstream filters in format bsf1[=opt1=val1:opt2=val2][,bsf2]
[out] bsf Pointer to be set to newly created AVBSFContext structure representing the chain of bitstream filters Returns
=0 on success, negative AVERROR in case of failure
===
and try to have fun with h264_metadata (try rotation as example?) by modifying one from our h264 profiles (temporarily)
unfortunately cin on termux segfaults with this opt file: mp4 libx264 | h264_metadata=crop_left=20:crop_right=20 # use framerate for 1 keyframe/sec, needed for seeks keyint_min=25 x264-params keyint=25 Thread 113 "cin" received signal SIGSEGV, Segmentation fault. [Switching to LWP 18851] 0xf4511c30 in ?? () from /data/data/com.termux/files/usr/lib/libavcodec.so (gdb) bt full #0 0xf4511c30 in ?? () from /data/data/com.termux/files/usr/lib/libavcodec.so No symbol table info available. #1 0xf6eef496 in av_mallocz () from /data/data/com.termux/files/usr/lib/libavutil.so No symbol table info available. #2 0xe75f3140 in ?? () No symbol table info available. --- I hope it works better on desktop/with older integrated ffmpeg...
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.
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?
I have AMD hardware (CPU + GPU). I tried rendering in CinGG a project in h264_vaapi/mp4. Then from external terminal I used ffmpeg to convert the file to h264/mkv. The conversion went well and the resulting file is viewable in mpv.
unfortunately cin on termux segfaults with this opt file: mp4 libx264 | h264_metadata=crop_left=20:crop_right=20 # use framerate for 1 keyframe/sec, needed for seeks keyint_min=25 x264-params keyint=25
I tried the opt file you suggested and it works fine. I attach the preset. From earlier I had tried the copy/paste from your email, but the line: mp4 libx264 | h264_metadata=crop_left=20:crop_right=20 leads to a dump; instead by going to new line: mp4 libx264 h264_metadata=crop_left=20:crop_right=20 it works well.
On Friday, May 27, 2022, Andrea paz <[email protected]> wrote:
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.
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?
I have AMD hardware (CPU + GPU). I tried rendering in CinGG a project in h264_vaapi/mp4. Then from external terminal I used ffmpeg to convert the file to h264/mkv. The conversion went well and the resulting file is viewable in mpv.
unfortunately cin on termux segfaults with this opt file: mp4 libx264 | h264_metadata=crop_left=20:crop_right=20 # use framerate for 1 keyframe/sec, needed for seeks keyint_min=25 x264-params keyint=25
I tried the opt file you suggested and it works fine. I attach the preset. From earlier I had tried the copy/paste from your email, but the line: mp4 libx264 | h264_metadata=crop_left=20:crop_right=20 leads to a dump; instead by going to new line: mp4 libx264 h264_metadata=crop_left=20:crop_right=20 it works well.
it works, but without cropping (mediainfo shows same dimensions) ..... and whole point of this test was to test bitstream filtering ..... can you check resulting file?
it works, but without cropping (mediainfo shows same dimensions) ..... and whole point of this test was to test bitstream filtering ..... can you check resulting file?
No, the crop option does not seem to be considered. I attach mediainfo.txt. (I don't even know what bitstream filtering means).
Il giorno sab 28 mag 2022 alle ore 09:08 Andrea paz <[email protected]> ha scritto:
it works, but without cropping (mediainfo shows same dimensions) ..... and whole point of this test was to test bitstream filtering ..... can you check resulting file?
No, the crop option does not seem to be considered. I attach mediainfo.txt. (I don't even know what bitstream filtering means).
On Saturday, May 28, 2022, Andrea paz <[email protected]> wrote:
Il giorno sab 28 mag 2022 alle ore 09:08 Andrea paz <[email protected]> ha scritto:
it works, but without cropping (mediainfo shows same dimensions) .....
and whole point of this test was to test bitstream filtering .....
can you check resulting file?
No, the crop option does not seem to be considered. I attach mediainfo.txt. (I don't even know what bitstream filtering means).
it supposed to change coded bitstream, so ffmpeg has few those bitstream filters, ones for h264 and hevc can do cropping at codec level (and CinGG seems to show those files correctly). Main idea was to try and fix vaapi_h264 stream as coming from AMD'S hardware encoder into something ffmpeg's mkv/matroska muxer accepts....
participants (3)
-
Andrea paz -
Andrew Randrianasulu -
Phyllis Smith