kvazaar icon indicating copy to clipboard operation
kvazaar copied to clipboard

ffmpeg pruduces 0 byte output if build with cmake

Open nanake opened this issue 1 year ago • 3 comments

use this command ffmpeg -loglevel debug -filter_complex "smptehdbars=size=1280x720:rate=30:duration=10" -c:v libkvazaar -y out.hevc

libkvazaar with cmake, it produce 0 byte output file.

ffmpeg -loglevel debug -filter_complex "smptehdbars=size=1280x720:rate=30:duration=10" -c:v libkvazaar -y out.hevc
ffmpeg version N-113347-g8e23ebe6f-2024-01-19-nonfree Copyright (c) 2000-2024 the FFmpeg developers
  built with gcc 13.2.1 (GCC) 20230728 (Fedora MinGW 13.2.1-5.fc39)
  configuration: --prefix=/ffbuild/prefix --pkg-config-flags=--static --pkg-config=pkg-config --cross-prefix=x86_64-w64-mingw32ucrt- --arch=x86_64 --target-os=mingw32 --enable-gpl --enable-version3 --disable-debug --disable-doc --enable-nonfree --extra-version=2024-01-19-nonfree --disable-w32threads --enable-pthreads --enable-iconv --enable-libxml2 --enable-zlib --enable-libfreetype --enable-libfribidi --enable-gmp --enable-lzma --enable-libharfbuzz --enable-libfontconfig --enable-libvorbis --enable-opencl --enable-libvmaf --enable-amf --enable-avisynth --enable-chromaprint --enable-libdav1d --enable-libdavs2 --enable-decklink --enable-ffnvcodec --enable-cuda-llvm --enable-libgme --enable-libkvazaar --enable-libaribcaption --enable-libass --enable-libbluray --enable-libfdk-aac --enable-libjxl --enable-libmp3lame --enable-libopus --enable-librist --enable-libtheora --enable-vaapi --enable-libvpx --enable-libwebp --enable-libzmq --enable-libvpl --enable-openal --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenh264 --enable-libopenjpeg --enable-libopenmpt --enable-libssh --enable-libsrt --enable-librav1e --enable-librubberband --enable-schannel --enable-sdl2 --enable-libsoxr --enable-libsvtav1 --enable-libtwolame --enable-libuavs3d --enable-libvidstab --enable-vulkan --enable-libshaderc --enable-libplacebo --enable-libx264 --enable-libx265 --enable-libxavs2 --enable-libzimg --enable-libzvbi --extra-cflags=-DLIBTWOLAME_STATIC --extra-cxxflags= --extra-ldflags= --extra-libs=
  libavutil      58. 36.101 / 58. 36.101
  libavcodec     60. 37.100 / 60. 37.100
  libavformat    60. 20.100 / 60. 20.100
  libavdevice    60.  4.100 / 60.  4.100
  libavfilter     9. 17.100 /  9. 17.100
  libswscale      7.  6.100 /  7.  6.100
  libswresample   4. 13.100 /  4. 13.100
  libpostproc    57.  4.100 / 57.  4.100
Splitting the commandline.
Reading option '-loglevel' ... matched as option 'loglevel' (set logging level) with argument 'debug'.
Reading option '-filter_complex' ... matched as option 'filter_complex' (create a complex filtergraph) with argument 'smptehdbars=size=1280x720:rate=30:duration=10'.
Reading option '-c:v' ... matched as option 'c' (codec name) with argument 'libkvazaar'.
Reading option '-y' ... matched as option 'y' (overwrite output files) with argument '1'.
Reading option 'out.hevc' ... matched as output url.
Finished splitting the commandline.
Parsing a group of options: global .
Applying option loglevel (set logging level) with argument debug.
Applying option filter_complex (create a complex filtergraph) with argument smptehdbars=size=1280x720:rate=30:duration=10.
[AVFilterGraph @ 0000022b09ee99c0] Setting 'size' to value '1280x720'
[AVFilterGraph @ 0000022b09ee99c0] Setting 'rate' to value '30'
[AVFilterGraph @ 0000022b09ee99c0] Setting 'duration' to value '10'
[Parsed_smptehdbars_0 @ 0000022b09efb1c0] size:1280x720 rate:30/1 duration:10.000000 sar:1/1
Applying option y (overwrite output files) with argument 1.
Successfully parsed a group of options.
Parsing a group of options: output url out.hevc.
Applying option c:v (codec name) with argument libkvazaar.
Successfully parsed a group of options.
Opening an output file: out.hevc.
[out#0/hevc @ 0000022b09ee99c0] Creating output stream from unlabeled output of complex filtergraph 0. This overrides automatic video mapping.
[vost#0:0/libkvazaar @ 0000022b09f3ba80] Created video stream from complex filtergraph 0:[smptehdbars:default]
[vost#0:0/libkvazaar @ 0000022b09f3ba80]
[out#0/hevc @ 0000022b09ee99c0] No explicit maps, mapping streams automatically...
[file @ 0000022b09f3d7c0] Setting default whitelist 'file,crypto,data'
Successfully opened the file.
Stream mapping:
  smptehdbars:default -> Stream #0:0 (libkvazaar)
[vost#0:0/libkvazaar @ 0000022b09f3ba80] Starting thread...
[fc#0 @ 0000022b09eecc00] Starting thread...
Press [q] to stop, [?] for help
[AVFilterGraph @ 0000022b09f81ec0] Setting 'size' to value '1280x720'
[AVFilterGraph @ 0000022b09f81ec0] Setting 'rate' to value '30'
[AVFilterGraph @ 0000022b09f81ec0] Setting 'duration' to value '10'
detected 12 logical cores
[Parsed_smptehdbars_0 @ 0000022b09f8cd40] size:1280x720 rate:30/1 duration:10.000000 sar:1/1
[format @ 0000022b09f8d1c0] Setting 'pix_fmts' to value 'yuv420p'
[AVFilterGraph @ 0000022b09f81ec0] query_formats: 3 queried, 6 merged, 0 already done, 0 delayed
Compiled: INTEL, flags: MMX SSE SSE2 SSSE3 SSE41 SSE42
Detected: INTEL, flags: MMX SSE SSE2 SSE3 SSSE3 SSE41 SSE42 AVX AVX2
Available: avx2(55) sse2(2) sse41(4)
In use: avx2(55) sse2(1)
--owf=auto value set to 3.
--threads=auto value set to 12.
Output #0, hevc, to 'out.hevc':
  Metadata:
    encoder         : Lavf60.20.100
  Stream #0:0, 0, 1/30: Video: hevc, 1 reference frame, yuv420p(bt709/unknown/unknown, progressive), 1280x720 (0x0) [SAR 1:1 DAR 16:9], 0/1, q=2-31, 30 fps, 30 tbn
      Metadata:
        encoder         : Lavc60.37.100 libkvazaar
[out#0/hevc @ 0000022b09ee99c0] Starting thread...
frame=    0 fps=0.0 q=0.0 size=       0kB time=N/A bitrate=N/A speed=N/A

It works fine with autotools.

nanake avatar Jan 19 '24 05:01 nanake

[out#0/hevc @ 00000000007573c0] Starting thread...
[New Thread 8296.0x2ee8]

Thread 19 received signal SIGSEGV, Segmentation fault.
[Switching to Thread 8296.0x3c4c]
do_one_edge_ymm (offsets_256=..., badbyte_mask=..., orig=..., c=..., b=..., a=...)
    at /stage/kvazaar/src/strategies/avx2/sao-avx2.c:284
warning: 284    /stage/kvazaar/src/strategies/avx2/sao-avx2.c: No such file or directory

@fador indeed, cmake missed the cflags -Wa,-muse-unaligned-vector-move.

nanake avatar Jan 20 '24 11:01 nanake

Is this issue still present at the current master?

Jovasa avatar Jan 31 '24 10:01 Jovasa

The issue still persists.

But this build works.

fwiw, for cross compiling, the target os is Windows, not mingw. so, this check if(CMAKE_SYSTEM_NAME MATCHES ".*MINGW.*") won't work.

nanake avatar Jan 31 '24 14:01 nanake

Hopefully this should be fixed in v2.3.1

Jovasa avatar Apr 12 '24 11:04 Jovasa

I can verify this is fixed for me in commit f34f8a7.

nanake avatar Apr 12 '24 11:04 nanake