-
Notifications
You must be signed in to change notification settings - Fork 6
Open
Description
问题
我往videos放了个120帧的高帧视频,程序处理时卡住,毫无反应,只能用ctrl+c手动退出
诉求
虽然问题本质是 ffmpeg 的高帧率处理瓶颈,但希望能在项目文档(如 README.md)中添加明确提示,告知用户避免使用过高帧率(建议不超过 60 帧)的视频文件,以防止程序卡住并提升使用体验。
问题排查
我将python_rotaeno_stabilizer.py第116行的subprocess.run(cmd, stdout=devnull, stderr=devnull)改为了subprocess.run(cmd)以显示ffmpeg日志,以下为终端的输出:
['Screenrecording_20251108_082111_com.xd.rotaeno.tapcn.mp4']
正在处理: Screenrecording_20251108_082111_com.xd.rotaeno.tapcn.mp4
正在将视频转换为CFR视频……
ffmpeg version 6.1.1-3ubuntu5 Copyright (c) 2000-2023 the FFmpeg developers
built with gcc 13 (Ubuntu 13.2.0-23ubuntu3)
configuration: --prefix=/usr --extra-version=3ubuntu5 --toolchain=hardened --libdir=/usr/lib/x86_64-linux-gnu --incdir=/usr/include/x86_64-linux-gnu --arch=amd64 --enable-gpl --disable-stripping --disable-omx --enable-gnutls --enable-libaom --enable-libass --enable-libbs2b --enable-libcaca --enable-libcdio --enable-libcodec2 --enable-libdav1d --enable-libflite --enable-libfontconfig --enable-libfreetype --enable-libfribidi --enable-libglslang --enable-libgme --enable-libgsm --enable-libharfbuzz --enable-libmp3lame --enable-libmysofa --enable-libopenjpeg --enable-libopenmpt --enable-libopus --enable-librubberband --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libtheora --enable-libtwolame --enable-libvidstab --enable-libvorbis --enable-libvpx --enable-libwebp --enable-libx265 --enable-libxml2 --enable-libxvid --enable-libzimg --enable-openal --enable-opencl --enable-opengl --disable-sndio --enable-libvpl --disable-libmfx --enable-libdc1394 --enable-libdrm --enable-libiec61883 --enable-chromaprint --enable-frei0r --enable-ladspa --enable-libbluray --enable-libjack --enable-libpulse --enable-librabbitmq --enable-librist --enable-libsrt --enable-libssh --enable-libsvtav1 --enable-libx264 --enable-libzmq --enable-libzvbi --enable-lv2 --enable-sdl2 --enable-libplacebo --enable-librav1e --enable-pocketsphinx --enable-librsvg --enable-libjxl --enable-shared
libavutil 58. 29.100 / 58. 29.100
libavcodec 60. 31.102 / 60. 31.102
libavformat 60. 16.100 / 60. 16.100
libavdevice 60. 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
libpostproc 57. 3.100 / 57. 3.100
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from '/home/chen_shuhan/Desktop/python_rotaeno_stabilizer-master/videos/Screenrecording_20251108_082111_com.xd.rotaeno.tapcn.mp4':
Metadata:
major_brand : mp42
minor_version : 0
compatible_brands: isommp42
creation_time : 2025-11-08T00:23:45.000000Z
com.android.version: 15
Duration: 00:02:32.58, start: 0.000000, bitrate: 9682 kb/s
Stream #0:0[0x1](eng): Video: h264 (High) (avc1 / 0x31637661), yuv420p(tv, bt470bg/bt470bg/smpte170m, progressive), 720x1600, 9510 kb/s, 116.36 fps, 90k tbr, 90k tbn (default)
Metadata:
creation_time : 2025-11-08T00:23:45.000000Z
handler_name : VideoHandle
vendor_id : [0][0][0][0]
Side data:
displaymatrix: rotation of 90.00 degrees
Stream #0:1[0x2](eng): Audio: aac (LC) (mp4a / 0x6134706D), 48000 Hz, mono, fltp, 156 kb/s (default)
Metadata:
creation_time : 2025-11-08T00:23:45.000000Z
handler_name : SoundHandle
vendor_id : [0][0][0][0]
Stream mapping:
Stream #0:0 -> #0:0 (h264 (native) -> h264 (libx264))
Stream #0:1 -> #0:1 (copy)
Press [q] to stop, [?] for help
[libx264 @ 0x59226284e400] MB rate (405000000) > level limit (16711680)
[libx264 @ 0x59226284e400] using cpu capabilities: MMX2 SSE2Fast SSSE3 SSE4.2 AVX FMA3 BMI2 AVX2
[libx264 @ 0x59226284e400] profile High, level 6.2, 4:2:0, 8-bit
[libx264 @ 0x59226284e400] 264 - core 164 r3108 31e19f9 - H.264/MPEG-4 AVC codec - Copyleft 2003-2023 - http://www.videolan.org/x264.html - options: cabac=1 ref=3 deblock=1:0:0 analyse=0x3:0x113 me=hex subme=7 psy=1 psy_rd=1.00:0.00 mixed_ref=1 me_range=16 chroma_me=1 trellis=1 8x8dct=1 cqm=0 deadzone=21,11 fast_pskip=1 chroma_qp_offset=-2 threads=12 lookahead_threads=2 sliced_threads=0 nr=0 decimate=1 interlaced=0 bluray_compat=0 constrained_intra=0 bframes=3 b_pyramid=2 b_adapt=1 b_bias=0 direct=1 weightb=1 open_gop=0 weightp=2 keyint=250 keyint_min=25 scenecut=40 intra_refresh=0 rc_lookahead=40 rc=crf mbtree=1 crf=23.0 qcomp=0.60 qpmin=0 qpmax=69 qpstep=4 ip_ratio=1.40 aq=1:1.00
Output #0, mp4, to '/home/chen_shuhan/Desktop/python_rotaeno_stabilizer-master/output/Screenrecording_20251108_082111_com.xd.rotaeno.tapcn_cfr.mp4':
Metadata:
major_brand : mp42
minor_version : 0
compatible_brands: isommp42
com.android.version: 15
encoder : Lavf60.16.100
Stream #0:0(eng): Video: h264 (avc1 / 0x31637661), yuv420p(tv, bt470bg/bt470bg/smpte170m, progressive), 1600x720, q=2-31, 90k fps, 90k tbn (default)
Metadata:
creation_time : 2025-11-08T00:23:45.000000Z
handler_name : VideoHandle
vendor_id : [0][0][0][0]
encoder : Lavc60.31.102 libx264
Side data:
cpb: bitrate max/min/avg: 0/0/0 buffer size: 0 vbv_delay: N/A
displaymatrix: rotation of -0.00 degrees
Stream #0:1(eng): Audio: aac (LC) (mp4a / 0x6134706D), 48000 Hz, mono, fltp, 156 kb/s (default)
Metadata:
creation_time : 2025-11-08T00:23:45.000000Z
handler_name : SoundHandle
vendor_id : [0][0][0][0]
[out_0_0 @ 0x5922625e8740] 100 buffers queued in out_0_0, something may be wrong. dup=477 drop=0 speed=0.276x
[out_0_0 @ 0x5922625e8740] 1000 buffers queued in out_0_0, something may be wrong.dup=477 drop=0 speed=0.00421x
[out_0_0 @ 0x5922625e8740] 10000 buffers queued in out_0_0, something may be wrong.
Traceback (most recent call last):
File "/home/chen_shuhan/Desktop/python_rotaeno_stabilizer-master/main.py", line 41, in <module>
stab_task.run()
File "/home/chen_shuhan/Desktop/python_rotaeno_stabilizer-master/python_rotaeno_stabilizer.py", line 366, in run
self.convert_vfr_to_cfr()
File "/home/chen_shuhan/Desktop/python_rotaeno_stabilizer-master/python_rotaeno_stabilizer.py", line 20, in measure_time
result = fn(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^
File "/home/chen_shuhan/Desktop/python_rotaeno_stabilizer-master/python_rotaeno_stabilizer.py", line 116, in convert_vfr_to_cfr
subprocess.run(cmd)
File "/usr/lib/python3.12/subprocess.py", line 550, in run
stdout, stderr = process.communicate(input, timeout=timeout)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/lib/python3.12/subprocess.py", line 1201, in communicate
self.wait()
File "/usr/lib/python3.12/subprocess.py", line 1264, in wait
return self._wait(timeout=timeout)
^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/lib/python3.12/subprocess.py", line 2053, in _wait
(pid, sts) = self._try_wait(0)
^^^^^^^^^^^^^^^^^
File "/usr/lib/python3.12/subprocess.py", line 2011, in _try_wait
(pid, sts) = os.waitpid(self.pid, wait_flags)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
KeyboardInterrupt
(.venv) chen_shuhan@mycomputer:~/Desktop/python_rotaeno_stabilizer-master$
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels