RayVentura / ShortGPT

๐Ÿš€๐ŸŽฌ ShortGPT - Experimental AI framework for youtube shorts / tiktok channel automation
https://shortx.ai/?ref=sgpt
MIT License
5.78k stars 734 forks source link

๐Ÿ› [Bug]: ERROR : Keyerror : duration #103

Open zhlmi opened 1 year ago

zhlmi commented 1 year ago

What happened?

ERROR : Keyerror : duration

What type of browser are you seeing the problem on?

Chrome

What type of Operating System are you seeing the problem on?

Windows

Python Version

3.10.10

Application Version

v0.1.3

Expected Behavior

There is a duration issue that occurs when reaching the eighth step.

Error Message

No response

Code to produce this issue.

Step 1 _generateScript
Step 2 _generateTempAudio
Step 3 _speedUpAudio
ffmpeg version 6.0-essentials_build-www.gyan.dev Copyright (c) 2000-2023 the FFmpeg developers
  built with gcc 12.2.0 (Rev10, Built by MSYS2 project)
  configuration: --enable-gpl --enable-version3 --enable-static --disable-w32threads --disable-autodetect --enable-fontconfig --enable-iconv --enable-gnutls --enable-libxml2 --enable-gmp --enable-bzlib --enable-lzma --enable-zlib --enable-libsrt --enable-libssh --enable-libzmq --enable-avisynth --enable-sdl2 --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxvid --enable-libaom --enable-libopenjpeg --enable-libvpx --enable-mediafoundation --enable-libass --enable-libfreetype --enable-libfribidi --enable-libvidstab --enable-libvmaf --enable-libzimg --enable-amf --enable-cuda-llvm --enable-cuvid --enable-ffnvcodec --enable-nvdec --enable-nvenc --enable-d3d11va --enable-dxva2 --enable-libvpl --enable-libgme --enable-libopenmpt --enable-libopencore-amrwb --enable-libmp3lame --enable-libtheora --enable-libvo-amrwbenc --enable-libgsm --enable-libopencore-amrnb --enable-libopus --enable-libspeex --enable-libvorbis --enable-librubberband
  libavutil      58.  2.100 / 58.  2.100
  libavcodec     60.  3.100 / 60.  3.100
  libavformat    60.  3.100 / 60.  3.100
  libavdevice    60.  1.100 / 60.  1.100
  libavfilter     9.  3.100 /  9.  3.100
  libswscale      7.  1.100 /  7.  1.100
  libswresample   4. 10.100 /  4. 10.100
  libpostproc    57.  1.100 / 57.  1.100
[mp3 @ 000001feeb9a0c00] Estimating duration from bitrate, this may be inaccurate
Input #0, mp3, from '.editing_assets/facts_shorts_assets/391f7dea008e4c2ea266b201/temp_audio_path.wav':
  Duration: 00:00:28.27, start: 0.000000, bitrate: 48 kb/s
  Stream #0:0: Audio: mp3, 24000 Hz, mono, fltp, 48 kb/s
Stream mapping:
  Stream #0:0 -> #0:0 (mp3 (mp3float) -> pcm_s16le (native))
Press [q] to stop, [?] for help
Output #0, wav, to '.editing_assets/facts_shorts_assets/391f7dea008e4c2ea266b201/audio_voice.wav':
  Metadata:
    ISFT            : Lavf60.3.100
  Stream #0:0: Audio: pcm_s16le ([1][0][0][0] / 0x0001), 24000 Hz, mono, s16, 384 kb/s
    Metadata:
      encoder         : Lavc60.3.100 pcm_s16le
size=    1325kB time=00:00:28.24 bitrate= 384.3kbits/s speed=1.12e+03x
video:0kB audio:1325kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 0.005748%
Step 4 _timeCaptions
Detected language: English
100%|โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆ| 2827/2827 [00:01<00:00, 1580.83frames/s]
Step 5 _generateImageSearchTerms
Step 6 _generateImageUrls
Search engine queries for images...: 100%|โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆ| 17/17 [01:43<00:00,  6.09s/it]
Step 7 _chooseBackgroundMusic
Step 8 _chooseBackgroundVideo
Error   File "J:\ShortGPT\shortgpt\gui\ui_tab_short_automation.py", line 103, in create_short
    for step_num, step_info in shortEngine.makeContent():
  File "J:\ShortGPT\shortgpt\shortGPT\engine\abstract_content_engine.py", line 74, in makeContent
    self.stepDict[currentStep]()
  File "J:\ShortGPT\shortgpt\shortGPT\engine\content_short_engine.py", line 95, in _chooseBackgroundVideo
    self._db_background_video_duration = AssetDatabase.get_asset_duration(
  File "J:\ShortGPT\shortgpt\shortGPT\config\asset_db.py", line 149, in get_asset_duration
    return cls._get_local_asset_duration(key)
  File "J:\ShortGPT\shortgpt\shortGPT\config\asset_db.py", line 244, in _get_local_asset_duration
    if 'duration' not in asset and asset['duration'] is not None:

Screenshots/Assets/Relevant links

No response

jackyin68 commented 11 months ago

Is this fixed?

xuhua127 commented 5 months ago

ๅฑๅน•ๆˆชๅ›พ 2024-06-08 234733 ๆ‚จๅฅฝ๏ผŒ่ฏท้—ฎไธ€็›ดๆ็คบopenai่ฟžๆŽฅ่ถ…ๆ—ถๅฆ‚ไฝ•่งฃๅ†ณ๏ผŸๆˆ‘็ฌฌไธ€ๆฌกไฝฟ็”จไธๅคชๆ‡‚ๆ€Žไนˆๅค„็†๏ผŒๆˆ‘ๅฐ่ฏ•็”จvpn ๏ผŒไนŸๆ˜ฏๆ˜พ็คบopenai่ฟžๆŽฅ้”™่ฏฏ๏ผŒๅฏๆ˜ฏๆˆ‘ไธ็Ÿฅ้“ๅฆ‚ไฝ•่งฃๅ†ณ๏ผŸๆŠฑๆญ‰๏ผŒๆˆ‘ๅฏไปฅๅ†้—ฎไธ€ไธช้—ฎ้ข˜ๅ—๏ผŸๅฐฑๆ˜ฏไธๆ˜พ็คบ่ฟžๆŽฅ่ถ…ๆ—ถ๏ผŒ็Žฐๅœจ็š„ๆŠฅ้”™ๆˆ‘ไธ็Ÿฅ้“ๅฆ‚ไฝ•่งฃๅ†ณ๏ผŒไธๆ•ขไฟฎๆ”นไปฃ็ ๏ผŒๅธŒๆœ›ๆ‚จ่ƒฝๅธฎๅŠฉๆˆ‘๏ผ๏ผ๏ผ ๅฑๅน•ๆˆชๅ›พ 2024-06-08 234433