Open jdchristensen opened 1 year ago
execute
pip install -U ffmpeg-smart-trim
!wget -c http://commondatastorage.googleapis.com/gtv-videos-bucket/sample/ForBiggerBlazes.mp4
!python -m ffmpeg_smart_trim.trim ForBiggerBlazes.mp4 --start_time 0.345 --end_time 9.890 --output out.mp4
result
Parsing video file...
Traceback (most recent call last):
File "/usr/lib/python3.10/runpy.py", line 196, in _run_module_as_main
return _run_code(code, main_globals, None,
File "/usr/lib/python3.10/runpy.py", line 86, in _run_code
exec(code, run_globals)
File "/usr/local/lib/python3.10/dist-packages/ffmpeg_smart_trim/trim.py", line 127, in <module>
video = TrimVideo(args.video, time_range=(input_start_time, input_end_time))
File "/usr/local/lib/python3.10/dist-packages/ffmpeg_smart_trim/trim.py", line 14, in __init__
self.key_frame_timestamps = [Decimal(frame['pts_time']) for frame in probe['frames']]
File "/usr/local/lib/python3.10/dist-packages/ffmpeg_smart_trim/trim.py", line 14, in <listcomp>
self.key_frame_timestamps = [Decimal(frame['pts_time']) for frame in probe['frames']]
KeyError: 'pts_time'
p.s. same video can be trim using ffmpeg from shell and another python module, e.g. ffmpeg-python
best regards
I tried this program for the first time and got:
The test video is 90 minutes long, from a Zoom recording.