Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

Video model with the possibility of automatic conversion to other formats and dimensions #154

Open
wants to merge 46 commits into from

5 participants

@nmfm

This is based on a solution we implemented with django for a client. We integrated the code into django-filer because it seemed useful and we could use it in future projects.

Videos can be used without activating the extra functionalities - they will behave just like the normal File object.

We tried to keep a similar architecture to the other django-filer + thumbnailer models.

There's a new Video model based on file, additional settings for configuring the processing with ffmpeg, a couple of management commands to do the conversion work and cleanup unused files, a template tag that renders an html5 video tag using multiple formats to work in different browsers, including legacy flash support (we expect this could be a typical use). Also included are some tests and documentation for the new features.

We are also working on a plugin (HTML5 Video) for django-cms that will make use of these new functionalities (https://github.com/nmfm/cmsplugin-filer).

nmfm and others added some commits
@nmfm nmfm Copied experimental stuff into project 2178d8c
@nmfm nmfm Added remaining files (still learning how to use git) d4fc60a
@nmfm nmfm Code cleanup 2f82758
@nmfm nmfm Working version: handles video file upload and converts it using the …
…management command.
9ae0315
@nmfm nmfm Fixes to the formats property - keys are now extensions without the l…
…eading '.' for easier use in a template, like {{instance.video.formats.flv}}
35d3b53
@pvl pvl tests and migrations 9c691f1
@nmfm nmfm Removed nasty import pdb 9cc8ae3
@nmfm nmfm Merge branch 'feature/video' of github.com:nmfm/django-filer into fea…
…ture/video
53382b8
@nmfm nmfm Forces extensions in settings not to have leading dot.
get_poster_url to get the image url (not working)
f79852b
@pvl pvl set dimensions and allow video resizing deb400e
@nmfm nmfm get_poster_url working.
moved new width & height definition out of the loop in convert
Fixed some pep8 nonconformances.
1ed67d4
@nmfm nmfm Small improvement to the convert_video help text f4141bb
@nmfm nmfm Lots of fixes in the conversion methods
More pep8 nonconformances
7a90fab
@pvl pvl template tag to display video 0694ba3
@pvl pvl merged changes 5926ff2
@nmfm nmfm Default dimensions on settings so users can resize all videos automat…
…ically

Save command output on conversion when no file is generated (was saving a meaningless exception)
8304681
@nmfm nmfm Merge branch 'feature/video' of github.com:nmfm/django-filer into fea…
…ture/video

Conflicts:
	filer/models/videomodels.py
0796ca6
@pvl pvl reverted changed in clipboardadmin.py 59bcb29
@pvl pvl Merge branch 'feature/video' of github.com:nmfm/django-filer into fea…
…ture/video
24bb729
@nmfm nmfm Log ffmpeg command even when successful
More pep8 stuff
b1c7426
@pvl pvl show poster, default to uploaded image when conversions are missing2 8af75d7
@pvl pvl adjustment on video admin width/height fields 6970d7c
@pvl pvl documentation 7c6383b
@pvl pvl more documentation 23d53a9
@pvl pvl filer.fields.video 3e6597f
@nmfm nmfm Merge branch 'feature/video' of github.com:nmfm/django-filer into fea…
…ture/video

Conflicts:
	filer/settings.py
016e3cd
@nmfm nmfm Merge branch 'feature/video' of github.com:nmfm/django-filer into fea…
…ture/video
7b5815e
@pvl pvl mimetypes in videos d39796d
@pvl pvl empty alt text when field is None 4808555
@nmfm nmfm Merge branch 'feature/video' of github.com:nmfm/django-filer into fea…
…ture/video

Conflicts:
	filer/models/videomodels.py
9ee477e
@nmfm nmfm management command formats_cleanup cf9346f
@nmfm nmfm formats_cleanup fixes 73e625a
@pvl pvl video conversion tests and refactor of video.formats and video.poster c7e22a2
@pvl pvl documentation and doc strings f7783d5
@nmfm nmfm Serving video formats from the private server 08cd171
@nmfm nmfm Merge branch 'feature/video' of github.com:nmfm/django-filer into fea…
…ture/video

Conflicts:
	filer/fields/multistorage_file.py
	filer/models/videomodels.py
0731efd
@nmfm nmfm Video._move_file (used when enabling/disabling permissions in a file)…
… and Video._copy_file (when copying files via admin) first version. Still lots of problems.

I fear I have broken Video.formats somehow (unconfirmed)
0e3e158
@nmfm nmfm Bugfix: When moving the formats for a file, we need to do it with the…
… original permissions, otherwise we won't find the files
dc6355f
@nmfm nmfm Changed formats_cleanup command to use the format_to_original_filenam…
…e method
0238591
@pvl pvl fixed bug in videomodels 089fceb
@pvl pvl Merge branch 'feature/video' of github.com:nmfm/django-filer into fea…
…ture/video
affe752
@nmfm nmfm Updated the documentation 5a90555
@pvl pvl tests on moving video files publi<->private cbfab07
@pvl pvl fixes for pep8 check 2ca2018
@nmfm nmfm Documentation update 6713abe
@nmfm nmfm Merge branch 'feature/video' of github.com:nmfm/django-filer into fea…
…ture/video
e34f9f3
@stefanfoulis
Owner

Epic guys, thanks!
Looking forward to review your pull request in detail :-)

@mitar

The idea looks great!

@mitar

There are also some issues with current player: divio/django-cms#1238

It seems development has stopped.

@mitar

How about request timeouts? Currently even some bulk image tasks already timeout?

Maybe there should be a way for filer to post background tasks, probably using Celery? This would also allow distribution of those tasks?

@yakky yakky modified the milestone: 0.9.6, 0.9.5, 1.0, someday
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Oct 25, 2011
  1. @nmfm
  2. @nmfm
  3. @nmfm

    Code cleanup

    nmfm authored
  4. @nmfm
  5. @nmfm

    Fixes to the formats property - keys are now extensions without the l…

    nmfm authored
    …eading '.' for easier use in a template, like {{instance.video.formats.flv}}
  6. @pvl

    tests and migrations

    pvl authored
  7. @nmfm

    Removed nasty import pdb

    nmfm authored
  8. @nmfm
  9. @nmfm

    Forces extensions in settings not to have leading dot.

    nmfm authored
    get_poster_url to get the image url (not working)
Commits on Oct 26, 2011
  1. @pvl
  2. @nmfm

    get_poster_url working.

    nmfm authored
    moved new width & height definition out of the loop in convert
    Fixed some pep8 nonconformances.
  3. @nmfm
  4. @nmfm

    Lots of fixes in the conversion methods

    nmfm authored
    More pep8 nonconformances
  5. @pvl

    template tag to display video

    pvl authored
  6. @pvl

    merged changes

    pvl authored
  7. @nmfm

    Default dimensions on settings so users can resize all videos automat…

    nmfm authored
    …ically
    
    Save command output on conversion when no file is generated (was saving a meaningless exception)
  8. @nmfm

    Merge branch 'feature/video' of github.com:nmfm/django-filer into fea…

    nmfm authored
    …ture/video
    
    Conflicts:
    	filer/models/videomodels.py
  9. @pvl
  10. @pvl
  11. @nmfm

    Log ffmpeg command even when successful

    nmfm authored
    More pep8 stuff
  12. @pvl
  13. @pvl
Commits on Oct 27, 2011
  1. @pvl

    documentation

    pvl authored
  2. @pvl

    more documentation

    pvl authored
  3. @pvl

    filer.fields.video

    pvl authored
  4. @nmfm

    Merge branch 'feature/video' of github.com:nmfm/django-filer into fea…

    nmfm authored
    …ture/video
    
    Conflicts:
    	filer/settings.py
  5. @nmfm
  6. @pvl

    mimetypes in videos

    pvl authored
  7. @pvl

    empty alt text when field is None

    pvl authored
  8. @nmfm

    Merge branch 'feature/video' of github.com:nmfm/django-filer into fea…

    nmfm authored
    …ture/video
    
    Conflicts:
    	filer/models/videomodels.py
  9. @nmfm
  10. @nmfm

    formats_cleanup fixes

    nmfm authored
Commits on Oct 28, 2011
  1. @pvl
  2. @pvl

    documentation and doc strings

    pvl authored
  3. @nmfm
  4. @nmfm

    Merge branch 'feature/video' of github.com:nmfm/django-filer into fea…

    nmfm authored
    …ture/video
    
    Conflicts:
    	filer/fields/multistorage_file.py
    	filer/models/videomodels.py
  5. @nmfm

    Video._move_file (used when enabling/disabling permissions in a file)…

    nmfm authored
    … and Video._copy_file (when copying files via admin) first version. Still lots of problems.
    
    I fear I have broken Video.formats somehow (unconfirmed)
Commits on Oct 31, 2011
  1. @nmfm

    Bugfix: When moving the formats for a file, we need to do it with the…

    nmfm authored
    … original permissions, otherwise we won't find the files
  2. @nmfm
  3. @pvl

    fixed bug in videomodels

    pvl authored
  4. @pvl
Commits on Nov 1, 2011
  1. @nmfm

    Updated the documentation

    nmfm authored
Commits on Nov 2, 2011
  1. @pvl
  2. @pvl

    fixes for pep8 check

    pvl authored
  3. @nmfm

    Documentation update

    nmfm authored
  4. @nmfm
Something went wrong with that request. Please try again.