forked from randomknowledge/django-webvideo
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
0e5aa1a
commit 7d51c32
Showing
9 changed files
with
112 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
Copyright 2013 Florian Finke | ||
|
||
Permission is hereby granted, free of charge, to any person obtaining | ||
a copy of this software and associated documentation files (the | ||
"Software"), to deal in the Software without restriction, including | ||
without limitation the rights to use, copy, modify, merge, publish, | ||
distribute, sublicense, and/or sell copies of the Software, and to | ||
permit persons to whom the Software is furnished to do so, subject to | ||
the following conditions: | ||
|
||
The above copyright notice and this permission notice shall be | ||
included in all copies or substantial portions of the Software. | ||
|
||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, | ||
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF | ||
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND | ||
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE | ||
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION | ||
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION | ||
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,72 @@ | ||
# django-webvideo | ||
___ | ||
`django-webvideo` is a [Django](https://www.djangoproject.com/) module to convert videos into web video formats. | ||
Converting is handled by [ffmpeg](http://www.ffmpeg.org/) and queued with [rq](http://python-rq.org/). | ||
By now `django-webvideo` can convert to h264 and ogg/theora. | ||
`django-webvideo` will also create 3 screenshots of each video. | ||
|
||
____ | ||
## Requirements | ||
* [Django](https://www.djangoproject.com/) | ||
* [easy-thumbnails](https://github.com/SmileyChris/easy-thumbnails) | ||
* [rq](http://python-rq.org/) | ||
|
||
## Installation | ||
|
||
Install [pip](http://pypi.python.org/pypi/pip): | ||
|
||
```console | ||
$ sudo easy_install pip | ||
``` | ||
|
||
Download source and install package using pip: | ||
|
||
```console | ||
$ sudo pip install -e git+https://github.com/randomknowledge/django_webvideo.git#egg=django-webvideo | ||
``` | ||
|
||
Add ``django_webvideo`` to your ``INSTALLED_APPS`` setting:: | ||
|
||
INSTALLED_APPS = ( | ||
... | ||
'django_webvideo', | ||
) | ||
|
||
If you have South installed then run ``manage.py migrate``, | ||
otherwise just run ``manage.py syncdb``. | ||
|
||
## Configuration | ||
|
||
The following settings can be added to your django settings (these are also the default settings): | ||
|
||
DJANGO_WEBVIDEO_SETTINGS = { | ||
'upload_to': 'videos', | ||
'convert_to': 'videos/converted', | ||
'screens_to': 'videos/screens', | ||
'ffmpeg': { | ||
'binary': 'ffmpeg', | ||
'call_h264': "{ffmpeg} -y -i {infile} -acodec libmp3lame -ar 48000 -ab 128k -ac 2 -vcodec libx264 " | ||
"-cmp 256 -subq 7 -trellis 1 -refs 5 -coder 0 -me_range 16 -keyint_min 25 -sc_threshold 40 " | ||
"-i_qfactor 0.71 -bt 1200k -maxrate 1200k -bufsize 1200k -rc_eq 'blurCplx^(1-qComp)' " | ||
"-qcomp 0.6 -qmin 10 -qmax 51 -qdiff 4 -level 30 -r 30 -g 90 {outfile}", | ||
'call_ogv': '{ffmpeg} -i {infile} -b 1200k -vcodec libtheora -acodec libvorbis -ab 160000 {outfile}', | ||
}, | ||
'redis': { | ||
'connection': { | ||
'db': 0, | ||
'host': 'localhost', | ||
'port': 6379, | ||
}, | ||
'eager': False, # If True, Tasks are not queued, but executed directly. Use for testing purposes only! | ||
'queue_prefix': 'webvideo', # django_webvideo will prefix all (RQ-)Queues with this prefix. | ||
'timeout': 600, | ||
}, | ||
'use_admin': True, | ||
} | ||
|
||
Any setting missing in this dictionary will be replaced by the default one. | ||
|
||
## Example Template usage | ||
|
||
{% load webvideo_tags %} | ||
{% video_tag webvideo_object width=640 height=480 autoplay=0 controls=1 attributes='id="test"' screen_num=2 %} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,2 @@ | ||
|
||
# -*- coding: utf-8 -*- | ||
__version__ = '0.1.0' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
django_webvideo/templates/django_webvideo/snippets/video-embed.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
<video {{ attributes }} width="{{ width }}" height="{{ height }}" preload="{{ preload }}" poster="{{ poster }}"{% if controls %} controls{% endif %}{% if autoplay %} autoplay="autoplay"{% endif %}> | ||
<source src="{{ video.h264.url }}" type="video/mp4; codecs="avc1.42E01E, mp4a.40.2""> | ||
<source src="{{ video.oggvorbis.url }}" type="video/ogg; codecs="theora, vorbis""> | ||
<source src="{{ video.oggtheora.url }}" type="video/ogg; codecs="theora, vorbis""> | ||
</video> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,26 +1,28 @@ | ||
# coding=utf-8 | ||
from setuptools import setup | ||
import django_webvideo | ||
import finddata | ||
|
||
|
||
setup( | ||
name="django_webvideo", | ||
name="django-webvideo", | ||
author="Florian Finke", | ||
author_email="[email protected]", | ||
version='0.0.1', | ||
version=django_webvideo.__version__, | ||
packages=['django_webvideo'], | ||
package_data=finddata.find_package_data(), | ||
url='https://github.com/randomknowledge/django_webvideo', | ||
include_package_data=True, | ||
license='MIT', | ||
description='', | ||
description='A queuing web video converter', | ||
long_description=open('Readme.md').read(), | ||
zip_safe=False, | ||
install_requires=[ | ||
'Django==1.5', | ||
'South==0.7.6', | ||
'PIL==1.1.7', | ||
'easy-thumbnails==1.2', | ||
'rq==0.3.7', | ||
], | ||
classifiers=[ | ||
'Development Status :: 4 - Beta', | ||
|