Re: [FFmpeg-user] Segmentation fault for two-pass libx264, but not two-pass libx265
On Feb 27, 2024, at 9:39 AM, Ferdi Scholten wrote: > >> Looks a bit like this trac ticket I >> made:https://trac.ffmpeg.org/ticket/10164 which is stiil open after 13 >> months. The difference in this ticket is that it happens when doing dual >> pass av1 transcode with libaom. Not always with every file, but very >> reliably with certain files that always deliver the segfault. I can supply >> these files, but since the ticket does not get any attention I have not done >> this yet. Thanks. I continued to work (play) after posting and it appears that I’ve found an acceptable workaround for x264. Now I’m trying “-r 29.97” or "-r 30” before input and “-fps_mode cfr” before the filtergraph. That prevents the crash and delivers pretty decent av sync, except that there’s an offset for the audio (it’s about 1200 ms late). But audio offset is pretty easy to correct, as long as the duration is right. I normally use a HEAD version of ffmpeg provided by Homebrew, but I wanted to make the environment as simple as possible to ask for help. I’ll go back to HEAD, I guess. I’m just a hobbyist. I would prefer to use x265, but the rest of my entertainment system isn’t yet compatible. Hope your libaom problem gets some attention soon. L. Lee ___ ffmpeg-user mailing list ffmpeg-user@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-user To unsubscribe, visit link above, or email ffmpeg-user-requ...@ffmpeg.org with subject "unsubscribe".
Re: [FFmpeg-user] Segmentation fault for two-pass libx264, but not two-pass libx265
I believe this should be a viable routine for two-pass encoding using libx264, but it fails, as shown. A similar command to encode the same video source file using libx265 with Matroska output is successful, so I don’t think the source file is the culprit. Both the x264 and x265 encoding report 1475 frames encoded. Please help. Thanks. Sincerely, L. Lee ffmpeg -i ~/Downloads/sgd.ts -map 0:0 -c:v:0 libx264 -b:v 2500k -pass 1 -vf fieldmatch=order=tff:combmatch=none,decimate,crop=1920:1072:0:4 -map 0:1 -an -f null /dev/null && ffmpeg -i ~/Downloads/sgd.ts -map 0:0 -c:v:0 libx264 -b:v 2500k -pass 2 -vf fieldmatch=order=tff:combmatch=none,decimate,crop=1920:1072:0:4 -map 0:1 -c:a ac3 -b:a 384k -movflags +faststart ~/Downloads/sgd.mp4 ffmpeg version 6.1.1 Copyright (c) 2000-2023 the FFmpeg developers built with Apple clang version 15.0.0 (clang-1500.1.0.2.5) configuration: --prefix=/opt/homebrew/Cellar/ffmpeg/6.1.1_3 --enable-shared --enable-pthreads --enable-version3 --cc=clang --host-cflags= --host-ldflags='-Wl,-ld_classic' --enable-ffplay --enable-gnutls --enable-gpl --enable-libaom --enable-libaribb24 --enable-libbluray --enable-libdav1d --enable-libharfbuzz --enable-libjxl --enable-libmp3lame --enable-libopus --enable-librav1e --enable-librist --enable-librubberband --enable-libsnappy --enable-libsrt --enable-libssh --enable-libsvtav1 --enable-libtesseract --enable-libtheora --enable-libvidstab --enable-libvmaf --enable-libvorbis --enable-libvpx --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxml2 --enable-libxvid --enable-lzma --enable-libfontconfig --enable-libfreetype --enable-frei0r --enable-libass --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-libopenvino --enable-libspeex --enable-libsoxr --enable-libzmq --enable-libzimg --disable-libjack --disable-indev=jack --enable-videotoolbox --enable-audiotoolbox --enable-neon libavutil 58. 29.100 / 58. 29.100 libavcodec 60. 31.102 / 60. 31.102 libavformat60. 16.100 / 60. 16.100 libavdevice60. 3.100 / 60. 3.100 libavfilter 9. 12.100 / 9. 12.100 libswscale 7. 5.100 / 7. 5.100 libswresample 4. 12.100 / 4. 12.100 libpostproc57. 3.100 / 57. 3.100 Input #0, mpegts, from '/Users/llee/Downloads/sgd.ts': Duration: 00:01:02.11, start: 1.40, bitrate: 14865 kb/s Program 1 Metadata: service_name: Service01 service_provider: FFmpeg Stream #0:0[0x100]: Video: h264 (High) ([27][0][0][0] / 0x001B), yuv420p(tv, bt709, progressive), 1920x1080 [SAR 1:1 DAR 16:9], 30 fps, 30 tbr, 90k tbn Stream #0:1[0x101]: Audio: ac3 (AC-3 / 0x332D4341), 48000 Hz, 5.1(side), fltp, 640 kb/s Stream mapping: Stream #0:0 -> #0:0 (h264 (native) -> h264 (libx264)) Press [q] to stop, [?] for help [libx264 @ 0x13c605d00] using SAR=1/1 [libx264 @ 0x13c605d00] using cpu capabilities: ARMv8 NEON [libx264 @ 0x13c605d00] profile Main, level 4.0, 4:2:0, 8-bit Output #0, null, to '/dev/null': Metadata: encoder : Lavf60.16.100 Stream #0:0: Video: h264, yuv420p(tv, bt709, progressive), 1920x1072 [SAR 1:1 DAR 120:67], q=2-31, 2500 kb/s, 24 fps, 24 tbn Metadata: encoder : Lavc60.31.102 libx264 Side data: cpb: bitrate max/min/avg: 0/0/250 buffer size: 0 vbv_delay: N/A [out#0/null @ 0x604ac180] video:20127kB audio:0kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: unknown frame= 1475 fps= 93 q=-1.0 Lsize=N/A time=00:01:01.37 bitrate=N/A speed=3.87x [libx264 @ 0x13c605d00] frame I:26Avg QP:20.39 size: 77028 [libx264 @ 0x13c605d00] frame P:450 Avg QP:23.72 size: 23644 [libx264 @ 0x13c605d00] frame B:999 Avg QP:25.04 size: 7975 [libx264 @ 0x13c605d00] consecutive B-frames: 9.0% 1.4% 2.0% 87.6% [libx264 @ 0x13c605d00] mb I I16..4: 64.1% 0.0% 35.9% [libx264 @ 0x13c605d00] mb P I16..4: 33.0% 0.0% 0.0% P16..4: 34.8% 0.0% 0.0% 0.0% 0.0%skip:32.2% [libx264 @ 0x13c605d00] mb B I16..4: 5.5% 0.0% 0.0% B16..8: 19.6% 0.0% 0.0% direct: 9.1% skip:65.8% L0:39.4% L1:54.2% BI: 6.4% [libx264 @ 0x13c605d00] final ratefactor: 24.22 [libx264 @ 0x13c605d00] coded y,uvDC,uvAC intra: 29.9% 40.3% 6.3% inter: 6.1% 10.3% 0.0% [libx264 @ 0x13c605d00] i16 v,h,dc,p: 35% 23% 26% 17% [libx264 @ 0x13c605d00] i4 v,h,dc,ddl,ddr,vr,hd,vl,hu: 24% 20% 22% 3% 9% 6% 6% 5% 5% [libx264 @ 0x13c605d00] i8c dc,h,v,p: 56% 20% 21% 3% [libx264 @ 0x13c605d00] Weighted P-Frames: Y:2.0% UV:0.9% [libx264 @ 0x13c605d00] kb/s:2682.78 ffmpeg version 6.1.1 Copyright (c) 2000-2023 the FFmpeg developers built with Apple clang version 15.0.0 (clang-1500.1.0.2.5) configuration: --prefix=/opt/homebrew/Cellar/ffmpeg/6.1.1_3 --enable-shared --enable-pthreads --enable-version3 --cc=clang --host-cflags= --host-ldflags='-Wl,-ld_classic' --enable-ffplay --enable-gnutls --enable-gpl --enable-libaom --enable-libaribb24 --enable-libbluray --enable-libdav1d
[FFmpeg-user] Segmentation fault for two-pass libx264, but not two-pass libx265
I believe this should be a viable routine for two-pass encoding using libx264, but it fails, as shown. A similar command to encode the same video source file using libx265 with Matroska output is successful, so I don’t think the source file is the culprit. Both the x264 and x265 encoding report 1475 frames encoded. Please help. Thanks. Sincerely, L. Lee ffmpeg -i ~/Downloads/sgd.ts -map 0:0 -c:v:0 libx264 -b:v 2500k -pass 1 -vf fieldmatch=order=tff:combmatch=none,decimate,crop=1920:1072:0:4 -map 0:1 -an -f null /dev/null && ffmpeg -i ~/Downloads/sgd.ts -map 0:0 -c:v:0 libx264 -b:v 2500k -pass 2 -vf fieldmatch=order=tff:combmatch=none,decimate,crop=1920:1072:0:4 -map 0:1 -c:a ac3 -b:a 384k -movflags +faststart ~/Downloads/sgd.mp4 ffmpeg version 6.1.1 Copyright (c) 2000-2023 the FFmpeg developers built with Apple clang version 15.0.0 (clang-1500.1.0.2.5) configuration: --prefix=/opt/homebrew/Cellar/ffmpeg/6.1.1_3 --enable-shared --enable-pthreads --enable-version3 --cc=clang --host-cflags= --host-ldflags='-Wl,-ld_classic' --enable-ffplay --enable-gnutls --enable-gpl --enable-libaom --enable-libaribb24 --enable-libbluray --enable-libdav1d --enable-libharfbuzz --enable-libjxl --enable-libmp3lame --enable-libopus --enable-librav1e --enable-librist --enable-librubberband --enable-libsnappy --enable-libsrt --enable-libssh --enable-libsvtav1 --enable-libtesseract --enable-libtheora --enable-libvidstab --enable-libvmaf --enable-libvorbis --enable-libvpx --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxml2 --enable-libxvid --enable-lzma --enable-libfontconfig --enable-libfreetype --enable-frei0r --enable-libass --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-libopenvino --enable-libspeex --enable-libsoxr --enable-libzmq --enable-libzimg --disable-libjack --disable-indev=jack --enable-videotoolbox --enable-audiotoolbox --enable-neon libavutil 58. 29.100 / 58. 29.100 libavcodec 60. 31.102 / 60. 31.102 libavformat60. 16.100 / 60. 16.100 libavdevice60. 3.100 / 60. 3.100 libavfilter 9. 12.100 / 9. 12.100 libswscale 7. 5.100 / 7. 5.100 libswresample 4. 12.100 / 4. 12.100 libpostproc57. 3.100 / 57. 3.100 Input #0, mpegts, from '/Users/llee/Downloads/sgd.ts': Duration: 00:01:02.11, start: 1.40, bitrate: 14865 kb/s Program 1 Metadata: service_name: Service01 service_provider: FFmpeg Stream #0:0[0x100]: Video: h264 (High) ([27][0][0][0] / 0x001B), yuv420p(tv, bt709, progressive), 1920x1080 [SAR 1:1 DAR 16:9], 30 fps, 30 tbr, 90k tbn Stream #0:1[0x101]: Audio: ac3 (AC-3 / 0x332D4341), 48000 Hz, 5.1(side), fltp, 640 kb/s Stream mapping: Stream #0:0 -> #0:0 (h264 (native) -> h264 (libx264)) Press [q] to stop, [?] for help [libx264 @ 0x13c605d00] using SAR=1/1 [libx264 @ 0x13c605d00] using cpu capabilities: ARMv8 NEON [libx264 @ 0x13c605d00] profile Main, level 4.0, 4:2:0, 8-bit Output #0, null, to '/dev/null': Metadata: encoder : Lavf60.16.100 Stream #0:0: Video: h264, yuv420p(tv, bt709, progressive), 1920x1072 [SAR 1:1 DAR 120:67], q=2-31, 2500 kb/s, 24 fps, 24 tbn Metadata: encoder : Lavc60.31.102 libx264 Side data: cpb: bitrate max/min/avg: 0/0/250 buffer size: 0 vbv_delay: N/A [out#0/null @ 0x604ac180] video:20127kB audio:0kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: unknown frame= 1475 fps= 93 q=-1.0 Lsize=N/A time=00:01:01.37 bitrate=N/A speed=3.87x [libx264 @ 0x13c605d00] frame I:26Avg QP:20.39 size: 77028 [libx264 @ 0x13c605d00] frame P:450 Avg QP:23.72 size: 23644 [libx264 @ 0x13c605d00] frame B:999 Avg QP:25.04 size: 7975 [libx264 @ 0x13c605d00] consecutive B-frames: 9.0% 1.4% 2.0% 87.6% [libx264 @ 0x13c605d00] mb I I16..4: 64.1% 0.0% 35.9% [libx264 @ 0x13c605d00] mb P I16..4: 33.0% 0.0% 0.0% P16..4: 34.8% 0.0% 0.0% 0.0% 0.0%skip:32.2% [libx264 @ 0x13c605d00] mb B I16..4: 5.5% 0.0% 0.0% B16..8: 19.6% 0.0% 0.0% direct: 9.1% skip:65.8% L0:39.4% L1:54.2% BI: 6.4% [libx264 @ 0x13c605d00] final ratefactor: 24.22 [libx264 @ 0x13c605d00] coded y,uvDC,uvAC intra: 29.9% 40.3% 6.3% inter: 6.1% 10.3% 0.0% [libx264 @ 0x13c605d00] i16 v,h,dc,p: 35% 23% 26% 17% [libx264 @ 0x13c605d00] i4 v,h,dc,ddl,ddr,vr,hd,vl,hu: 24% 20% 22% 3% 9% 6% 6% 5% 5% [libx264 @ 0x13c605d00] i8c dc,h,v,p: 56% 20% 21% 3% [libx264 @ 0x13c605d00] Weighted P-Frames: Y:2.0% UV:0.9% [libx264 @ 0x13c605d00] kb/s:2682.78 ffmpeg version 6.1.1 Copyright (c) 2000-2023 the FFmpeg developers built with Apple clang version 15.0.0 (clang-1500.1.0.2.5) configuration: --prefix=/opt/homebrew/Cellar/ffmpeg/6.1.1_3 --enable-shared --enable-pthreads --enable-version3 --cc=clang --host-cflags= --host-ldflags='-Wl,-ld_classic' --enable-ffplay --enable-gnutls --enable-gpl --enable-libaom --enable-libaribb24 --enable-libbluray --enable-libdav1d --enable-libharfbuzz