binglinggroup / autosub Goto Github PK
View Code? Open in Web Editor NEWCommand-line utility to transcribe/translate from video/audio/subtitles to subtitles
License: GNU General Public License v2.0
Command-line utility to transcribe/translate from video/audio/subtitles to subtitles
License: GNU General Public License v2.0
In python 2.7, argparse can't decode the stdin into the unicode type successfully. Need some decoding works after argparse.
agermanidis/autosub #46
agermanidis/autosub #62
Perhaps all these features will be added in another program bingst
And all these features won't be considered adding into this program.
Related #21
lang codes
Google says its using BCP-47 as a standard. According to my test (agermanidis/autosub pull request #136), a more specific and compliant with a standard's lang codes get a better result, which means they are able to avoid Google's IP-local optimization.
Obviously currently using Google recommended lang codes strategy is not enough. (Sometimes it's hard to compare due to the non-standard usage by Google.) We need a library to compare lang codes and perhaps give a full lang codes reference to user.
Please forgive my ignorance but I'm trying to get this working. When I run
autosub -i myvideoFilter.wav
It immediately returns an error:
Convert source audio to "/var/folders/fz/_m3hd8n524x47ktcbwj4f6g00000gn/T/tmpq5j6nows.wav" and get audio length for regions detection.
ffmpeg -hide_banner -y -i "myvideoFilter.wav" -ac 1 -ar 48000 "/var/folders/fz/_m3hd8n524x47ktcbwj4f6g00000gn/T/tmpq5j6nows.wav"
Traceback (most recent call last):
File "/usr/local/bin/autosub", line 11, in <module>
sys.exit(main())
File "/usr/local/lib/python3.7/site-packages/autosub/__init__.py", line 142, in main
no_audio_prcs=no_audio_prcs)
File "/usr/local/lib/python3.7/site-packages/autosub/cmdline_utils.py", line 812, in audio_or_video_prcs
subprocess.check_output(command, stdin=open(os.devnull), shell=False)
File "/usr/local/Cellar/python/3.7.0/Frameworks/Python.framework/Versions/3.7/lib/python3.7/subprocess.py", line 376, in check_output
**kwargs).stdout
File "/usr/local/Cellar/python/3.7.0/Frameworks/Python.framework/Versions/3.7/lib/python3.7/subprocess.py", line 453, in run
with Popen(*popenargs, **kwargs) as process:
File "/usr/local/Cellar/python/3.7.0/Frameworks/Python.framework/Versions/3.7/lib/python3.7/subprocess.py", line 756, in __init__
restore_signals, start_new_session)
File "/usr/local/Cellar/python/3.7.0/Frameworks/Python.framework/Versions/3.7/lib/python3.7/subprocess.py", line 1499, in _execute_child
raise child_exception_type(errno_num, err_msg, err_filename)
FileNotFoundError: [Errno 2] No such file or directory: 'ffmpeg -hide_banner -y -i "myvideoFilter.wav" -ac 1 -ar 48000 "/var/folders/fz/_m3hd8n524x47ktcbwj4f6g00000gn/T/tmpq5j6nows.wav"': 'ffmpeg -hide_banner -y -i "myvideoFilter.wav" -ac 1 -ar 48000 "/var/folders/fz/_m3hd8n524x47ktcbwj4f6g00000gn/T/tmpq5j6nows.wav"'
At which stage is the file supposed to be generated?
Hello All,
This is really not an autosub deficiency, but curious if it is at all possible to autosub a video song. Have tried all of the online subtitling products and none work either.
Am guessing with the background music with various instruments trying to get anywhere close to correct subtitlng will be impossible.
Thank You.
[Fix]
Issue [#120] (ValueError: No JSON object could be decoded)
[Update]
Refactoring and beautifying source code.
[Add]
Add arguments -V, --version for command-line options.
Reference: iWangJiaxiang/autosub
Like auto detect language.
Split generate_subtitles into 3 functions which process finding speech regions, speech-to-text and subtitle translation.
Allow user to do these 3 functions separately or altogether.
Optimize memory usage when float variables change into int ones.
Added arguments for minimum and maximum region size (length of audio to be transcribed in each "subtitle").
Personally I found this very convenient when using autosub to transcribe interviews (yes, autosub works great for that application), but it might be useful in other cases too.
Input is a subtitles file.
Translating text from "zh-cn" to "en".
Translation: 100% |####################################################################################| Time: 0:00:01
Error: Translation failed.
pysubs2 json output
Hi,
I needed a Dockerfile to run autosub and thought it may be helpful to someone else.
Louis
Hi, just curious why the flac processing taking too long? Is this normal? Example, if an video file 1hour long, the flac output processing also taking 1 hour too. Is it possible to make it faster? Previously, if I'm not mistaken in v0.5.0-alpha it was faster. Please advise. Below is the flac output process.
Stream mapping:
Stream #0:0 -> #0:0 (h264 (native) -> png (native))
Stream #0:1 -> #0:1 (aac (native) -> flac (native))
Press [q] to stop, [?] for help
[flac @ 000001e49e5874c0] encoding as 24 bits-per-sample2:22.77 bitrate= -0.0kbits/s speed=N/A
[flac @ 000001e49e3db000] Video stream #0 is not an attached picture. Ignoring
Output #0, flac, to 'c:\users\akumar~1\appdata\local\temp\tmpxt7xdo.flac':
Metadata:
major_brand : mp42
minor_version : 0
compatible_brands: isommp42
encoder : Lavf58.20.100
Stream #0:0(und): Video: png, rgb24(progressive), 1152x720 [SAR 1:1 DAR 8:5], q=2-31, 200 kb/s, 30 fps, 30 tbn, 30 tbc (default)
Metadata:
creation_time : 2018-03-04T02:27:29.000000Z
handler_name : ISO Media file produced by Google Inc. Created on: 03/03/2018.
encoder : Lavc58.35.100 png
Stream #0:1(und): Audio: flac, 44100 Hz, mono, s32 (24 bit), 128 kb/s (default)
Metadata:
creation_time : 2018-03-04T02:27:29.000000Z
handler_name : ISO Media file produced by Google Inc. Created on: 03/03/2018.
encoder : Lavc58.35.100 flac
frame=20630 fps= 10 q=-0.0 size= 52992kB time=00:11:27.54 bitrate= 631.4kbits/s speed=0.332x
A useful parameter for different types of videos or audios.
Useful when debugging
Useful when input is large.
Translating text from "zh-cn" to "en".
Translation: 2% |## | ETA: 0:01:08Traceback (most recent call last):
File "c:\python27\lib\runpy.py", line 174, in _run_module_as_main
"__main__", fname, loader, pkg_name)
File "c:\python27\lib\runpy.py", line 72, in _run_code
exec code in run_globals
File "C:\Python27\Scripts\autosub.exe\__main__.py", line 9, in <module>
File "c:\python27\lib\site-packages\autosub\__init__.py", line 142, in main
no_audio_prcs=no_audio_prcs)
File "c:\python27\lib\site-packages\autosub\cmdline_utils.py", line 1015, in audio_or_video_prcs
service_urls=args.service_urls
File "c:\python27\lib\site-packages\autosub\core.py", line 306, in list_to_googletrans
result_list[valid_index[j] - last_index])
IndexError: list index out of range
Related #20
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.