Opened 3 weeks ago

Last modified 3 weeks ago

#7645 new defect

Crash when scale_vaapi to 4k

Reported by: sub.s7v7n Owned by:
Priority: normal Component: undetermined
Version: git-master Keywords: vaapi
Cc: Blocked By:
Blocking: Reproduced by developer: no
Analyzed by developer: no

Description

Summary of the bug:

My server freezes when scaling to 4k, 2k runs through without problems.

How to reproduce:

ffmpeg -loglevel info -hwaccel vaapi -hwaccel_device /dev/dri/renderD128 -hwaccel_output_format vaapi -y -i INPUT.mp4 -map 0:0 -map 0:1 -vf scale_vaapi=h=-2:w=4096 -b:v 3M -maxrate 3M -bufsize 3M -c:v h264_vaapi -codec:a:0 copy OUTPUT.mkv -f matroska 2> progress.txt

FFmpeg version:

ffmpeg version N-92392-g16d91b7 Copyright (c) 2000-2018 the FFmpeg developers
  built with gcc 7 (Ubuntu 7.3.0-27ubuntu1~18.04)
  configuration: --prefix=/root/ffmpeg_build --pkg-config-flags=--static 
  --extra-cflags=-I/root/ffmpeg_build/include 
  --extra-ldflags=-L/root/ffmpeg_build/lib --extra-libs='-lpthread -lm' 
  --bindir=/root/bin --enable-gpl --enable-libaom --enable-libass 
  --enable-libfdk-aac --enable-libfreetype --enable-libmp3lame 
  --enable-libopus --enable-libvorbis --enable-libvpx --enable-libx264 
  --enable-libx265 --enable-vaapi --enable-nonfree
  
  libavutil      56. 23.101 / 56. 23.101
  libavcodec     58. 39.100 / 58. 39.100
  libavformat    58. 22.100 / 58. 22.100
  libavdevice    58.  6.100 / 58.  6.100
  libavfilter     7. 43.100 /  7. 43.100
  libswscale      5.  4.100 /  5.  4.100
  libswresample   3.  4.100 /  3.  4.100
  libpostproc    55.  4.100 / 55.  4.100

vainfo:

error: can't connect to X server!
libva info: VA-API version 1.1.0
libva info: va_getDriverName() returns 0
libva info: Trying to open /usr/lib/x86_64-linux-gnu/dri/i965_drv_video.so
libva info: Found init function __vaDriverInit_1_1
libva info: va_openDriver() returns 0
vainfo: VA-API version: 1.1 (libva 2.1.0)
vainfo: Driver version: Intel i965 driver for Intel(R) Coffee Lake - 2.1.0
vainfo: Supported profile and entrypoints
      VAProfileMPEG2Simple            : VAEntrypointVLD
      VAProfileMPEG2Simple            : VAEntrypointEncSlice
      VAProfileMPEG2Main              : VAEntrypointVLD
      VAProfileMPEG2Main              : VAEntrypointEncSlice
      VAProfileH264ConstrainedBaseline: VAEntrypointVLD
      VAProfileH264ConstrainedBaseline: VAEntrypointEncSlice
      VAProfileH264ConstrainedBaseline: VAEntrypointEncSliceLP
      VAProfileH264Main               : VAEntrypointVLD
      VAProfileH264Main               : VAEntrypointEncSlice
      VAProfileH264Main               : VAEntrypointEncSliceLP
      VAProfileH264High               : VAEntrypointVLD
      VAProfileH264High               : VAEntrypointEncSlice
      VAProfileH264High               : VAEntrypointEncSliceLP
      VAProfileH264MultiviewHigh      : VAEntrypointVLD
      VAProfileH264MultiviewHigh      : VAEntrypointEncSlice
      VAProfileH264StereoHigh         : VAEntrypointVLD
      VAProfileH264StereoHigh         : VAEntrypointEncSlice
      VAProfileVC1Simple              : VAEntrypointVLD
      VAProfileVC1Main                : VAEntrypointVLD
      VAProfileVC1Advanced            : VAEntrypointVLD
      VAProfileNone                   : VAEntrypointVideoProc
      VAProfileJPEGBaseline           : VAEntrypointVLD
      VAProfileJPEGBaseline           : VAEntrypointEncPicture
      VAProfileVP8Version0_3          : VAEntrypointVLD
      VAProfileVP8Version0_3          : VAEntrypointEncSlice
      VAProfileHEVCMain               : VAEntrypointVLD
      VAProfileHEVCMain               : VAEntrypointEncSlice
      VAProfileHEVCMain10             : VAEntrypointVLD
      VAProfileHEVCMain10             : VAEntrypointEncSlice
      VAProfileVP9Profile0            : VAEntrypointVLD
      VAProfileVP9Profile0            : VAEntrypointEncSlice
      VAProfileVP9Profile2            : VAEntrypointVLD

progress.txt:

ffmpeg version N-92392-g16d91b7 Copyright (c) 2000-2018 the FFmpeg developers
  built with gcc 7 (Ubuntu 7.3.0-27ubuntu1~18.04)
  configuration: --prefix=/root/ffmpeg_build --pkg-config-flags=--static --extra-cflags=-I/root/ffmpeg_build/include --extra-ldflags=-L/root/ffmpeg_build/lib --extra-libs='-lpthread -lm' --bindir=/root/bin --enable-gpl --enable-libaom --enable-libass --enable-libfdk-aac --enable-libfreetype --enable-libmp3lame --enable-libopus --enable-libvorbis --enable-libvpx --enable-libx264 --enable-libx265 --enable-vaapi --enable-nonfree
  libavutil      56. 23.101 / 56. 23.101
  libavcodec     58. 39.100 / 58. 39.100
  libavformat    58. 22.100 / 58. 22.100
  libavdevice    58.  6.100 / 58.  6.100
  libavfilter     7. 43.100 /  7. 43.100
  libswscale      5.  4.100 /  5.  4.100
  libswresample   3.  4.100 /  3.  4.100
  libpostproc    55.  4.100 / 55.  4.100
Trailing options were found on the commandline.
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from '/INPUT.mp4':
  Metadata:
    major_brand     : isom
    minor_version   : 512
    compatible_brands: isomiso2avc1mp41
    encoder         : Lavf57.41.100
  Duration: 00:13:26.29, start: 0.000000, bitrate: 1609 kb/s
    Stream #0:0(und): Video: h264 (High) (avc1 / 0x31637661), yuv420p(tv, bt709), 1920x1080 [SAR 1:1 DAR 16:9], 1475 kb/s, 29.97 fps, 29.97 tbr, 90k tbn, 59.94 tbc (default)
    Metadata:
      handler_name    : VideoHandler
    Stream #0:1(eng): Audio: aac (LC) (mp4a / 0x6134706D), 44100 Hz, stereo, fltp, 125 kb/s (default)
    Metadata:
      handler_name    : SoundHandler
Stream mapping:
  Stream #0:0 -> #0:0 (h264 (native) -> h264 (h264_vaapi))
  Stream #0:1 -> #0:1 (copy)
Press [q] to stop, [?] for help
Output #0, matroska, to '/encoded_INPUT.mkv':
  Metadata:
    major_brand     : isom
    minor_version   : 512
    compatible_brands: isomiso2avc1mp41
    encoder         : Lavf58.22.100
    Stream #0:0(und): Video: h264 (h264_vaapi) (High) (H264 / 0x34363248), vaapi_vld, 4096x2304 [SAR 1:1 DAR 16:9], q=-1--1, 3000 kb/s, 29.97 fps, 1k tbn, 29.97 tbc (default)
    Metadata:
      handler_name    : VideoHandler
      encoder         : Lavc58.39.100 h264_vaapi
    Stream #0:1(eng): Audio: aac (LC) ([255][0][0][0] / 0x00FF), 44100 Hz, stereo, fltp, 125 kb/s (default)
    Metadata:
      handler_name    : SoundHandler
frame=   34 fps=0.0 q=-0.0 size=       1kB time=00:00:01.50 bitrate=   5.8kbits/s speed=2.98x    
frame=   70 fps= 68 q=-0.0 size=       1kB time=00:00:02.71 bitrate=   3.2kbits/s speed=2.65x    
frame=  106 fps= 69 q=-0.0 size=       1kB time=00:00:03.92 bitrate=   2.2kbits/s speed=2.54x    
frame=  142 fps= 69 q=-0.0 size=    1444kB time=00:00:05.10 bitrate=2315.5kbits/s speed=2.49x    
frame=  178 fps= 69 q=-0.0 size=    1444kB time=00:00:06.31 bitrate=1872.6kbits/s speed=2.46x    
frame=  214 fps= 69 q=-0.0 size=    1444kB time=00:00:07.52 bitrate=1572.2kbits/s speed=2.44x     

Attachments (1)

scale_to_4k_crash.PNG (34.8 KB) - added by sub.s7v7n 3 weeks ago.

Download all attachments as: .zip

Change History (6)

Changed 3 weeks ago by sub.s7v7n

comment:1 Changed 3 weeks ago by cehoyos

  • Component changed from ffmpeg to undetermined
  • Keywords vaapi added
  • Version changed from unspecified to git-master

Please provide a backtrace.

comment:2 Changed 3 weeks ago by sub.s7v7n

Please provide a backtrace.

sorry, but how do I do that?

comment:3 Changed 3 weeks ago by cehoyos

If ffmpeg crashes (as the ticket title suggests), please provide backtrace, disassembly and register dump as explained on https://ffmpeg.org/bugreports.html
If ffmpeg freezes, run the binary from gdb, interrupt it with Ctrl-C and post the backtrace here.
In any case, you need (static) ffmpeg_g, the debug binary.

comment:4 follow-up: Changed 3 weeks ago by sub.s7v7n

By freezing I mean server is not working anymore, just help reset button.

gdb does not start:

#gdb: unrecognized option '-hwaccel'

valgrind (file is broken):

==733== Memcheck, a memory error detector
==733== Copyright (C) 2002-2017, and GNU GPL'd, by Julian Seward et al.
==733== Using Valgrind-3.13.0 and LibVEX; rerun with -h for copyright info
==733== Command: ffmpeg_g -hwaccel vaapi -hwaccel_device /dev/dri/renderD128 -hwaccel_output_format vaapi -y -i INPUT.mp4 -map 0:0 -map 0:1 -vf scale_vaapi=h=-2:w=4096 -b:v 3M -maxrate 3M -bufsize 3M -c:v h264_vaapi -codec:a:0 copy OUTPUT.mp4 -f mp4
==733==
ffmpeg version N-92392-g16d91b7 Copyright (c) 2000-2018 the FFmpeg developers

built with gcc 7 (Ubuntu 7.3.0-27ubuntu1~18.04)
configuration: --prefix=/root/ffmpeg_build --pkg-config-flags=--static --extra-cflags=-I/root/ffmpeg_build/include --extra-ldflags=-L/root/ffmpeg_build/lib --extra-libs='-lpthread -lm' --bindir=/root/bin --enable-gpl --enable-libaom --enable-libass --enable-libfdk-aac --enable-libfreetype --enable-libmp3lame --enable-libopus --enable-libvorbis --enable-libvpx --enable-libx264 --enable-libx265 --enable-vaapi --enable-nonfree
libavutil 56. 23.101 / 56. 23.101
libavcodec 58. 39.100 / 58. 39.100
libavformat 58. 22.100 / 58. 22.100
libavdevice 58. 6.100 / 58. 6.100
libavfilter 7. 43.100 / 7. 43.100
libswscale 5. 4.100 / 5. 4.100
libswresample 3. 4.100 / 3. 4.100
libpostproc 55. 4.100 / 55. 4.100

Trailing options were found on the commandline.
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'INPUT.mp4':

Metadata:

major_brand : isom
minor_version : 512
compatible_brands: isomiso2avc1mp41
encoder : Lavf57.41.100

Duration: 00:13:26.29, start: 0.000000, bitrate: 1609 kb/s

Stream #0:0(und): Video: h264 (High) (avc1 / 0x31637661), yuv420p(tv, bt709), 1920x1080 [SAR 1:1 DAR 16:9], 1475 kb/s, 29.97 fps, 29.97 tbr, 90k tbn, 59.94 tbc (default)
Metadata:

handler_name : VideoHandler?

Stream #0:1(eng): Audio: aac (LC) (mp4a / 0x6134706D), 44100 Hz, stereo, fltp, 125 kb/s (default)
Metadata:

handler_name : SoundHandler?

Stream mapping:

Stream #0:0 -> #0:0 (h264 (native) -> h264 (h264_vaapi))
Stream #0:1 -> #0:1 (copy)

Press [q] to stop, ? for help
Output #0, mp4, to 'OUTPUT.mp4':

Metadata:

major_brand : isom
minor_version : 512
compatible_brands: isomiso2avc1mp41
encoder : Lavf58.22.100
Stream #0:0(und): Video: h264 (h264_vaapi) (High) (avc1 / 0x31637661), vaapi_vld, 4096x2304 [SAR 1:1 DAR 16:9], q=-1--1, 3000 kb/s, 29.97 fps, 30k tbn, 29.97 tbc (default)
Metadata:

handler_name : VideoHandler?
encoder : Lavc58.39.100 h264_vaapi

Stream #0:1(eng): Audio: aac (LC) (mp4a / 0x6134706D), 44100 Hz, stereo, fltp, 125 kb/s (default)
Metadata:

handler_name : SoundHandler?

frame= 1 fps=0.0 q=0.0 size= 0kB time=00:00:00.41 bitrate= 0.9kbits/s speed=0.647x
frame= 28 fps= 24 q=-0.0 size= 0kB time=00:00:01.32 bitrate= 0.3kbits/s speed=1.13x
frame= 61 fps= 36 q=-0.0 size= 0kB time=00:00:02.41 bitrate= 0.2kbits/s speed=1.42x
frame= 94 fps= 42 q=-0.0 size= 0kB time=00:00:03.50 bitrate= 0.1kbits/s speed=1.58x
.
.
.
frame=24155 fps= 63 q=-0.0 size= 12288kB time=00:13:26.26 bitrate= 124.9kbits/s speed=2.12x
frame=24163 fps= 63 q=-0.0 Lsize= 12498kB time=00:13:26.26 bitrate= 127.0kbits/s speed=2.12x
video:0kB audio:12361kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 1.104951%
==733==
==733== HEAP SUMMARY:
==733== in use at exit: 23,776 bytes in 20 blocks
==733== total heap usage: 5,428,991 allocs, 5,428,971 frees, 931,826,187,707 bytes allocated
==733==
==733== LEAK SUMMARY:
==733== definitely lost: 0 bytes in 0 blocks
==733== indirectly lost: 0 bytes in 0 blocks
==733== possibly lost: 0 bytes in 0 blocks
==733== still reachable: 23,776 bytes in 20 blocks
==733== suppressed: 0 bytes in 0 blocks
==733== Rerun with --leak-check=full to see details of leaked memory
==733==
==733== For counts of detected and suppressed errors, rerun with: -v
==733== ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 0 from 0)

comment:5 in reply to: ↑ 4 Changed 3 weeks ago by cehoyos

Replying to sub.s7v7n:

By freezing I mean server is not working anymore, just help reset button.

This indicates an issue that is not related to FFmpeg.

gdb does not start:

#gdb: unrecognized option '-hwaccel'

That's not how gdb works and this is explained in the link I posted.

Note: See TracTickets for help on using tickets.