opengenus / vidsum Goto Github PK
View Code? Open in Web Editor NEWGenerate summary of any video :tv: anywhere and anytime
License: GNU General Public License v3.0
Generate summary of any video :tv: anywhere and anytime
License: GNU General Public License v3.0
How can we improve the video summary? Can you provide url of videos that generate good summaries?
๐จ Apply PEP8 Style Guide to code base
add relevant code to allow vidsum to be indexed in pypi.
it would allow users to install using pip or easy_install pip install vidsum
and allow users to use it as a independent program ex: vidsum <Video url>
Exception produced when running:
python sum.py -u https://www.youtube.com/watch?v=o8NPllzkFhE
Exception
+++++++++++
raise DoesNotExist('No videos met this criteria.')
pytube.exceptions.DoesNotExist: No videos met this criteria.
+++++++++++
Solution:
Line 118 - download_video parameter should be 'url' not args.video_file
C:\Users\Einstein\Downloads\pavan_proj\vidsum\code>python sum.py -u https://www.youtube.com/watch?v=PT2_F-1esPk
[nltk_data] Downloading package punkt to
[nltk_data] C:\Users\Einstein\AppData\Roaming\nltk_data...
[nltk_data] Package punkt is already up-to-date!
[youtube] PT2_F-1esPk: Downloading webpage
[download] 1.mp4 has already been downloaded
[download] 100% of 21.26MiB
Traceback (most recent call last):
File "sum.py", line 246, in
movie_filename, subtitle_filename = download_video_srt(url)
File "sum.py", line 216, in download_video_srt
subtitle_language = list(subtitle_info.keys())[0]
AttributeError: 'NoneType' object has no attribute 'keys'
๐
I have noticed that several of the commits are short of information on "what, why, or how? " It would make the reviewer's life easier, maybe we could have either/or
The URL of the commit template is wrong in readme.
There is no Issue and Pull request template in .github, it can give a idea to contributors about details required to make the issues and pull requests. Also it will make things organised?
I can add them, with reference given in this post https://github.com/blog/2111-issue-and-pull-request-templates ,
https://github.com/stevemao/github-issue-templates
This based on the assumptions that previous issues #1 #2 #4 have been fixed( #5 )
The Error means that the mp4 video you are trying to download has multiple resolutions and you have to decide which one you would like to get.
python sum.py -u https://www.youtube.com/watch?v=xRJCOz3AfYY
raise MultipleObjectsReturned('Multiple videos met this criteria.')
pytube.exceptions.MultipleObjectsReturned: Multiple videos met this criteria.
filter videos by type(mp4) and highest available resolution
yt.filter('mp4')[-1]
Explanation
This is a(n):
Details:
File "C:\Python27\lib\site-packages\moviepy\video\io\ffmpeg_reader.py", line 2
59, in ffmpeg_parse_infos
proc.terminate()
File "C:\Python27\lib\subprocess.py", line 1002, in terminate
_subprocess.TerminateProcess(self._handle, 1)
WindowsError: [Error 5] Access is denied
[sum.py] Remove the original files
I run python sum.py -u "https://www.youtube.com/watch?v=ZlXta87qyxU"
as suggested in your wiki..
Error I get is..
usage: Watch videos quickly [-h] -i VIDEO_FILE -s SUBTITLES_FILE [-u URL]
Watch videos quickly: error: the following arguments are required: -i/--video-file, -s/--subtitles-file
Download the subtitles of a YouTube video as video.srt
To achieve this, use youtube-dl
with the --write-auto-sub
option
The solution should go at Line 124
Other solutions are warmly welcomed as well.
This is a(n):
Details:
Traceback (most recent call last): File "sum.py", line 9, in <module> import pysrt ImportError: No module named pysrt
I have installed pysrt but also this error is coming.
๐
To help contributors get more easily started, I think there should be a contributing.md file. It would be a general guide on how to contribute to Vidsum.
This file could contain information on:
Here is an example template of a CONTRIBUTING.md file
Implementing this would address issue #13
Call the function get_summary()
on the downloaded YouTube video and subtitles file namely 1.mp4
and 1.(lang).srt
(where lang
refers to the specific language of the subtitle)
This code snippet will follow after Line 158
This will complete the step to summarize any YouTube video given its url
If you need any help, let us know.
I tried running the program as described in the README with a sample .avi file and a .srt file (both english).
The first error I faced was a UnicodeDecodeError
, the error log of which is as follows:
Traceback (most recent call last):
File "sum.py", line 155, in <module>
get_summary(args.video_file, args.subtitles_file)
File "sum.py", line 110, in get_summary
regions = find_summary_regions(subtitles, 60, "english")
File "sum.py", line 72, in find_summary_regions
srt_file = pysrt.open(srt_filename)
File "C:\Python34\lib\site-packages\pysrt\srtfile.py", line 153, in open
new_file.read(source_file, error_handling=error_handling)
File "C:\Python34\lib\site-packages\pysrt\srtfile.py", line 181, in read
self.extend(self.stream(source_file, error_handling=error_handling))
File "C:\Python34\lib\collections\__init__.py", line 1016, in extend
self.data.extend(other)
File "C:\Python34\lib\site-packages\pysrt\srtfile.py", line 204, in stream
for index, line in enumerate(chain(source_file, '\n')):
File "C:\Python34\lib\codecs.py", line 707, in __next__
return next(self.reader)
File "C:\Python34\lib\codecs.py", line 638, in __next__
line = self.readline()
File "C:\Python34\lib\codecs.py", line 551, in readline
data = self.read(readsize, firstline=True)
File "C:\Python34\lib\codecs.py", line 497, in read
newchars, decodedbytes = self.decode(data, self.errors)
UnicodeDecodeError: 'utf-8' codec can't decode byte 0xc1 in position 39: invalid start byte
After checking out the pysrt readme, I realized it could be because of an encoding mismatch. Running the file with pysrt.open(srt_filename, encoding='iso-8859-1')
fixed this error. One easy way to fix this is to first use the chardet
module to detect the encoding, and then pass that to pysrt.
Next, I also faced a LookupError
next due to the NLTK Tokenizer
not being able to find punkt
. I recommend adding this as a requirement, along with the youtube_dl library which was needed when the -u
flag was being used. Are you developing the file primarily on Linux? That might explain why you didn't notice the need, since most of these might be pre-installed in it.
I can make the necessary changes and send a pull request in a couple of hours. Will that be fine?
I've made a few updates and pushed them to the wiki section on my fork. They can be pulled here and compared against your wiki. I hope this helps.
It is always nice to show who has contributed to your project.
We could have a AUTHORS.md file where each contributor's name/email is added
We expect sum.py to delete original mp4 and srt files unless otherwise specified
Traceback (most recent call last):
File "sum.py", line 252, in
os.remove(movie_filename)
WindowsError: [Error 32] The process cannot access the file because it is being used by another process: u'1.mp4'
I do not know ๐
Upon running sum.py on a windows 10 platform, the script is interrupted with a windowsError stating that the removal of files can't take place because one of the file is still in use.
This is a Proposal to the Repository:
Details:
Seems like this applucation only utilizes the subtitles to generate the summary.
There is nothing to analyse each frame of the video for keywords and create summary based on them?
Overall:
A docstring should be included at the top of code to summarize project @AdiChat This might be good for you to do
Specifically (see example below): This could be done by other contributers
def is_cow(sound):
''' Checks if cow makes inputted sound
Args:
sound(str): sound the animal makes
Returns:
bool: True for success, False otherwise.
'''
if sound == 'moo':
return True
else:
return False
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.