Opened 4 days ago

Last modified 4 days ago

#11260 new enhancement

Reasonable restrictions on video bit rate for some hardware encoders

Reported by: elias tsolis Owned by:
Priority: normal Component: avdevice
Version: 7.0 Keywords: vaapi
Cc: MasterQuestionable Blocked By:
Blocking: Reproduced by developer: no
Analyzed by developer: no

Description

for vids in *.mp4; do ffmpeg  -hwaccel vaapi -hwaccel_output_format yuv420p -vaapi_device /dev/dri/renderD128 -i "$vids" -vf "format=nv12,hwupload" -c:v hevc_vaapi  -video_track_timescale 90000   -b:v 17  "a_${vids/.*}.mp4"; done;

while -b:v 17M not!

ffmpeg version 7.0.2-3 Copyright (c) 2000-2024 the FFmpeg developers

built with gcc 14 (Debian 14.2.0-2)

Attachments (1)

img.jpg (1.0 MB ) - added by elias tsolis 4 days ago.
resseting

Download all attachments as: .zip

Change History (6)

comment:1 by MasterQuestionable, 4 days ago

Cc: MasterQuestionable added
Component: undeterminedavdevice
Keywords: vaapi added; hang removed
Summary: in linux debian trixie, b:v command missing "M" or "K" makes a reset on my pc."-c:v hevc_vaapi" and "-b:v 17" crashed system in some Debian Linux build

͏    Would you reproduce with?
͏    ffmpeg -v debug -hide_banner -nostdin -nostats -hwaccel vaapi -vaapi_device "/dev/dri/renderD128" -hwaccel_output_format yuv420p -f lavfi -i "testsrc2=1920x1080:d=1,format=nv12,hwupload" -c:v hevc_vaapi -b:v 17 -f null -

͏    Or?
͏    ffmpeg -v debug -hide_banner -nostdin -nostats -hwaccel vaapi -vaapi_device "/dev/dri/renderD128" -hwaccel_output_format yuv420p -f lavfi -i "testsrc2=1920x1080:d=1" -vf "format=nv12,hwupload" -c:v hevc_vaapi -b:v 17 -f null -

comment:2 by MasterQuestionable, 4 days ago

Summary: "-c:v hevc_vaapi" and "-b:v 17" crashed system in some Debian Linux buildReasonable restrictions on video bit rate for some hardware encoders
Type: defectenhancement

͏    The bit rate 17 bps doesn't look sane for the codec:
͏    "libx264" outright complained error.
͏    "libx265" did proceed though.
͏    But likely just produced garbage.

͏    Some hardware encoders probably wouldn't properly handle it:
͏    And outright crash the system...

comment:3 by elias tsolis, 4 days ago

Tested both commands.

Only the 2nd one resetted my machine

Results from 1t one


Splitting the commandline.
Reading option '-v' ... matched as option 'v' (set logging level) with argument 'debug'.
Reading option '-hide_banner' ... matched as option 'hide_banner' (do not show program banner) with argument '1'.

Reading option '-nostdin' ... matched as option 'stdin' (enable or disable interaction on standard input) with argument 0.
Reading option '-nostats' ... matched as option 'stats' (print progress report during encoding) with argument 0.
Reading option '-hwaccel' ... matched as option 'hwaccel' (use HW accelerated decoding) with argument 'vaapi'.
Reading option '-vaapi_device' ... matched as option 'vaapi_device' (set VAAPI hardware device (DirectX adapter index, DRM path or X11 display name)) with argument '/dev/dri/renderD128'.
Reading option '-hwaccel_output_format' ... matched as option 'hwaccel_output_format' (select output format used with HW accelerated decoding) with argument 'yuv420p'.
Reading option '-f' ... matched as option 'f' (force container format (auto-detected otherwise)) with argument 'lavfi'.
Reading option '-i' ... matched as input url with argument 'testsrc2=1920x1080:d=1,format=nv12,hwupload'.
Reading option '-c:v' ... matched as option 'c' (select encoder/decoder ('copy' to copy stream without reencoding)) with argument 'hevc_vaapi'.
Reading option '-b:v' ... matched as option 'b' (video bitrate (please use -b:v)) with argument '17'.
Reading option '-f' ... matched as option 'f' (force container format (auto-detected otherwise)) with argument 'null'.
Reading option '-' ... matched as output url.
Finished splitting the commandline.
Parsing a group of options: global .
Applying option v (set logging level) with argument debug.
Applying option hide_banner (do not show program banner) with argument 1.
Applying option nostdin (enable or disable interaction on standard input) with argument 0.
Applying option nostats (print progress report during encoding) with argument 0.
Applying option vaapi_device (set VAAPI hardware device (DirectX adapter index, DRM path or X11 display name)) with argument /dev/dri/renderD128.
[AVHWDeviceContext @ 0x55f0d4599380] libva: VA-API version 1.22.0
[AVHWDeviceContext @ 0x55f0d4599380] libva: Trying to open /usr/lib/x86_64-linux-gnu/dri/radeonsi_drv_video.so
[AVHWDeviceContext @ 0x55f0d4599380] libva: Found init function vaDriverInit_1_22
[AVHWDeviceContext @ 0x55f0d4599380] libva: va_openDriver() returns 0
[AVHWDeviceContext @ 0x55f0d4599380] Initialised VAAPI connection: version 1.22
[AVHWDeviceContext @ 0x55f0d4599380] Format 0x3231564e -> nv12.
[AVHWDeviceContext @ 0x55f0d4599380] Format 0x30313050 -> p010le.
[AVHWDeviceContext @ 0x55f0d4599380] Format 0x36313050 -> unknown.
[AVHWDeviceContext @ 0x55f0d4599380] Format 0x30323449 -> yuv420p.
[AVHWDeviceContext @ 0x55f0d4599380] Format 0x32315659 -> yuv420p.
[AVHWDeviceContext @ 0x55f0d4599380] Format 0x56595559 -> unknown.
[AVHWDeviceContext @ 0x55f0d4599380] Format 0x32595559 -> yuyv422.
[AVHWDeviceContext @ 0x55f0d4599380] Format 0x59565955 -> uyvy422.
[AVHWDeviceContext @ 0x55f0d4599380] Format 0x30303859 -> gray.
[AVHWDeviceContext @ 0x55f0d4599380] Format 0x50343434 -> yuv444p.
[AVHWDeviceContext @ 0x55f0d4599380] Format 0x56323234 -> yuv440p.
[AVHWDeviceContext @ 0x55f0d4599380] Format 0x50424752 -> unknown.
[AVHWDeviceContext @ 0x55f0d4599380] Format 0x41524742 -> bgra.
[AVHWDeviceContext @ 0x55f0d4599380] Format 0x41424752 -> rgba.
[AVHWDeviceContext @ 0x55f0d4599380] Format 0x42475241 -> argb.
[AVHWDeviceContext @ 0x55f0d4599380] Format 0x58524742 -> bgr0.
[AVHWDeviceContext @ 0x55f0d4599380] Format 0x58424752 -> rgb0.
[AVHWDeviceContext @ 0x55f0d4599380] Format 0x30335241 -> unknown.
[AVHWDeviceContext @ 0x55f0d4599380] Format 0x30334241 -> unknown.
[AVHWDeviceContext @ 0x55f0d4599380] Format 0x30335258 -> x2rgb10le.
[AVHWDeviceContext @ 0x55f0d4599380] Format 0x30334258 -> unknown.
[AVHWDeviceContext @ 0x55f0d4599380] VAAPI driver: Mesa Gallium driver 24.2.4-1 for AMD Radeon RX 5700 XT (radeonsi, navi10, LLVM 19.1.1, DRM 3.59, 6.11.2-amd64).
[AVHWDeviceContext @ 0x55f0d4599380] Driver not found in known nonstandard list, using standard behaviour.
Successfully parsed a group of options.
Parsing a group of options: input url testsrc2=1920x1080:d=1,format=nv12,hwupload.
Applying option hwaccel (use HW accelerated decoding) with argument vaapi.
Applying option hwaccel_output_format (select output format used with HW accelerated decoding) with argument yuv420p.
Applying option f (force container format (auto-detected otherwise)) with argument lavfi.
Successfully parsed a group of options.
Opening an input file: testsrc2=1920x1080:d=1,format=nv12,hwupload.
[AVFilterGraph @ 0x55f0d47e02c0] Setting 'size' to value '1920x1080'
[AVFilterGraph @ 0x55f0d47e02c0] Setting 'd' to value '1'
[AVFilterGraph @ 0x55f0d47e02c0] Setting 'pix_fmts' to value 'nv12'
detected 24 logical cores
[Parsed_testsrc2_0 @ 0x55f0d47e3e80] size:1920x1080 rate:25/1 duration:1.000000 sar:1/1
[hwupload @ 0x55f0d4599880] A hardware device reference is required to upload frames to.
[Parsed_hwupload_2 @ 0x55f0d47e4640] Query format failed for 'Parsed_hwupload_2': Invalid argument
[in#0 @ 0x55f0d47dfb40] Error opening input: Invalid argument
Error opening input file testsrc2=1920x1080:d=1,format=nv12,hwupload.
Error opening input files: Invalid argument

by elias tsolis, 4 days ago

Attachment: img.jpg added

resseting

comment:4 by elias tsolis, 4 days ago

See attached image for 2nd ffmpeg, taken from my mobile

last line says "sync to pic 0/0 (input surface 0x1), then reset.

comment:5 by MasterQuestionable, 4 days ago

͏    Thanks for the info.
͏    I've guessed the cause.

͏    Alike system crashes also indicate potential use of cracking the system.

Note: See TracTickets for help on using tickets.