Git Product home page Git Product logo

asr_subtitles's People

Contributors

hafpaf avatar

Stargazers

 avatar

Watchers

 avatar

Forkers

greedyecho

asr_subtitles's Issues

Add comment to subtitle on Whisper model size

Add comment in SRT file on transcribed date and Whisper model size

Suggested format:

# Transcribed 2023-11-10 with medium model size

This allows proofreading contributors to identify the accuracy of a raw transcription file

Video filetype check

Verify audio if available in file format, and handle error of by lack thereof, ie. skip file processing if not video file.

Approaches:

  • Check for filetype magic bytes by using a library interfacing with libmagic (preferable)
  • Read file name extension.

One could make a list of accepted filetypes or simply skip SRT files

Error shown:

video file: ../videofiles/import-56124-eng-Goodbye_World_hd.mp4.srt                                                 
Traceback (most recent call last):                                                                                  
  File "/ASR_subtitles/venv/lib/python3.9/site-packages/whisper/audio.py", line 59, in load_audio   
    out = run(cmd, capture_output=True, check=True).stdout                                                          
  File "/usr/lib/python3.9/subprocess.py", line 528, in run                                                         
    raise CalledProcessError(retcode, process.args,                                                                 
subprocess.CalledProcessError: Command '['ffmpeg', '-nostdin', '-threads', '0', '-i', '../videofiles/import-56124-en
g-Goodbye_World_hd.mp4.srt', '-f', 's16le', '-ac', '1', '-acodec', 'pcm_s16le', '-ar', '16000', '-']' returned non-z
ero exit status 1.                                                                                                  
                                                                                                                    
The above exception was the direct cause of the following exception:                                                
                                                                                                                    
Traceback (most recent call last):                                                                                  
  File "/ASR_subtitles/app.py", line 38, in transcribe_audio                                            audio = whisper.load_audio(video_file_path)                                                                     
  File "/ASR_subtitles/venv/lib/python3.9/site-packages/whisper/audio.py", line 61, in load_audio       raise RuntimeError(f"Failed to load audio: {e.stderr.decode()}") from e
RuntimeError: Failed to load audio: ffmpeg version 4.2.7-0ubuntu0.1 Copyright (c) 2000-2022 the FFmpeg developers     built with gcc 9 (Ubuntu 9.4.0-1ubuntu1~20.04.1)  
...
Output file #0 does not contain any stream

pandas: futurewarning of concatenation

Error message

/ASR_subtitles/app.py:55: FutureWarning: The behavior of DataFrame concatenation with empty or all-NA entries is deprecated. In a future version, this will no longer exclude empty or all-NA columns when determining the result dtypes. To retain the old behavior, exclude the relevant entries before the concat operation.
  df = pd.concat([df, pd.DataFrame([new_row])], axis=0, ignore_index=True)

A recent upgrade to pandas 2.1.2 from 1.5.2 now presents this warning.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.