fraunhoferhhi / vvenc

VVenC, the Fraunhofer Versatile Video Encoder
https://www.hhi.fraunhofer.de/en/departments/vca/technologies-and-solutions/h266-vvc.html
BSD 3-Clause Clear License
937 stars 167 forks source link

ffmpeg transcode not support yuv420p #418

Closed yangchar closed 2 weeks ago

yangchar commented 2 weeks ago

yangchar:~/build_ffmpeg/ffmpeg-7.0.1$ ./build/bin/ffmpeg -i /home/yangchar/jellyfish-10-mbps-hd-hevc.mkv -c:v vvc -b:v 2M -pix_fmt yuv420p -strict -2 jellyfish-2-mbps-hd-vvc.vvc ffmpeg version 7.0.1 Copyright (c) 2000-2024 the FFmpeg developers built with gcc 9 (Ubuntu 9.4.0-1ubuntu1~20.04.2) configuration: --prefix=build --arch=x86_64 --enable-pthreads --enable-pic --enable-rpath --enable-static --disable-shared --enable-gpl --enable-nonfree --enable-version3 --enable-libx264 --enable-libx265 --enable-demuxer=dash --enable-libxml2 --enable-libvvenc --enable-libfdk-aac libavutil 59. 8.100 / 59. 8.100 libavcodec 61. 3.100 / 61. 3.100 libavformat 61. 1.100 / 61. 1.100 libavdevice 61. 1.100 / 61. 1.100 libavfilter 10. 1.100 / 10. 1.100 libswscale 8. 1.100 / 8. 1.100 libswresample 5. 1.100 / 5. 1.100 libpostproc 58. 1.100 / 58. 1.100 Input #0, matroska,webm, from '/home/yangchar/jellyfish-10-mbps-hd-hevc.mkv': Metadata: COMPATIBLE_BRANDS: iso4hvc1iso6 MAJOR_BRAND : iso4 MINOR_VERSION : 1 ENCODER : Lavf56.3.100 Duration: 00:00:30.10, start: 0.067000, bitrate: 9978 kb/s Stream #0:0(und): Video: hevc (Main), yuv420p(tv), 1920x1080 [SAR 1:1 DAR 16:9], 29.97 fps, 29.97 tbr, 1k tbn (default) Metadata: CREATION_TIME : 2016-02-04 22:41:00 LANGUAGE : und HANDLER_NAME : hevc@GPAC0.5.2-DEV-rev565-g71748d7-ab-suite Incompatible pixel format 'yuv420p' for codec 'libvvenc', auto-selecting format 'yuv420p10le' File 'jellyfish-2-mbps-hd-vvc.vvc' already exists. Overwrite? [y/N] y Stream mapping: Stream #0:0 -> #0:0 (hevc (native) -> vvc (libvvenc)) Press [q] to stop, [?] for help [libvvenc @ 0x55ac81214540] libvvenc version: 1.10.0 Output #0, vvc, to 'jellyfish-2-mbps-hd-vvc.vvc': Metadata: COMPATIBLE_BRANDS: iso4hvc1iso6 MAJOR_BRAND : iso4 MINOR_VERSION : 1 encoder : Lavf61.1.100 Stream #0:0(und): Video: vvc, yuv420p10le(tv, progressive), 1920x1080 [SAR 1:1 DAR 16:9], q=2-31, 2000 kb/s, 29.97 fps, 29.97 tbn (default) Metadata: CREATION_TIME : 2016-02-04 22:41:00 LANGUAGE : und HANDLER_NAME : hevc@GPAC0.5.2-DEV-rev565-g71748d7-ab-suite encoder : Lavc61.3.100 libvvenc ^C[in#0/matroska,webm @ 0x55ac8120d240] Error during demuxing: Immediate exit requested ^C^CReceived > 3 system signals, hard exiting yangchar:~/build_ffmpeg/ffmpeg-7.0.1$ ./build/bin/ffmpeg -i /home/yangchar/jellyfish-10-mbps-hd-hevc.mkv -c:v vvc -b:v 2M -pix_fmt yuv420 -strict -2 jellyfish-2-mbps-hd-vvc.vvc ffmpeg version 7.0.1 Copyright (c) 2000-2024 the FFmpeg developers built with gcc 9 (Ubuntu 9.4.0-1ubuntu1~20.04.2) configuration: --prefix=build --arch=x86_64 --enable-pthreads --enable-pic --enable-rpath --enable-static --disable-shared --enable-gpl --enable-nonfree --enable-version3 --enable-libx264 --enable-libx265 --enable-demuxer=dash --enable-libxml2 --enable-libvvenc --enable-libfdk-aac libavutil 59. 8.100 / 59. 8.100 libavcodec 61. 3.100 / 61. 3.100 libavformat 61. 1.100 / 61. 1.100 libavdevice 61. 1.100 / 61. 1.100 libavfilter 10. 1.100 / 10. 1.100 libswscale 8. 1.100 / 8. 1.100 libswresample 5. 1.100 / 5. 1.100 libpostproc 58. 1.100 / 58. 1.100 Input #0, matroska,webm, from '/home/yangchar/jellyfish-10-mbps-hd-hevc.mkv': Metadata: COMPATIBLE_BRANDS: iso4hvc1iso6 MAJOR_BRAND : iso4 MINOR_VERSION : 1 ENCODER : Lavf56.3.100 Duration: 00:00:30.10, start: 0.067000, bitrate: 9978 kb/s Stream #0:0(und): Video: hevc (Main), yuv420p(tv), 1920x1080 [SAR 1:1 DAR 16:9], 29.97 fps, 29.97 tbr, 1k tbn (default) Metadata: CREATION_TIME : 2016-02-04 22:41:00 LANGUAGE : und HANDLER_NAME : hevc@GPAC0.5.2-DEV-rev565-g71748d7-ab-suite [vost#0:0/libvvenc @ 0x55d896102e00] Unknown pixel format requested: yuv420. Error opening output file jellyfish-2-mbps-hd-vvc.vvc. Error opening output files: Invalid argument

yangchar:~/build_ffmpeg/ffmpeg-7.0.1$ vvencapp --help vvencapp: VVenC, the Fraunhofer H.266/VVC Encoder, version 1.10.0 [Linux][GCC 9.4.0][64 bit][SIMD=AVX2] -c, --format [yuv420] set input format (yuv420, yuv420_10, yuv420_10_packed)

lehmann-c commented 2 weeks ago

You cannot specify yuv420p as pixel format as it is not supported as output format. You need to set vvenc-params: -vvenc-params internalbitdepth=8 For instance: ffmpeg -i input -c:v vvc -b:v 2M -vvenc-params internalbitdepth=8 output

For more information visit: https://github.com/fraunhoferhhi/vvenc/wiki/FFmpeg-Integration#8-bit-coding

yangchar commented 2 weeks ago

@lehmann-c set -vvenc-params internalbitdepth=8 works, thank you!