time-lapse


Nametime-lapse JSON
Version 7.0 PyPI version JSON
download
home_pageNone
SummaryTime-lapse movie assembly
upload_time2024-04-06 09:53:22
maintainerNone
docs_urlNone
authorNone
requires_python>=3.11
licenseNone
keywords ffmpeg photography time-lapse
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            Time-Lapse assembling
=====================

[![PyPI](https://img.shields.io/pypi/v/time-lapse)](https://pypi.org/project/time-lapse/)
[![License](https://img.shields.io/github/license/153957/time-lapse)](https://github.com/153957/time-lapse/blob/main/LICENSE)
[![Build](https://img.shields.io/github/actions/workflow/status/153957/time-lapse/tests.yml?branch=main)](https://github.com/153957/time-lapse/actions)

This repo contains tools used to compile Time-lapse movies using
ffmpeg. The ffmpeg utility is controlled via the ffmpeg-python wrapper.

Example usage of this package can be found in the
[time-lapse scripts](https://github.com/153957/time-lapse-scripts) repository.

Installation
============

This package requires the `ffmpeg` tool to be installed.

    brew install ffmpeg

Then install this package:

    pip install time-lapse

Additionally, when using the verbose output option a graph will be
rendered using `graphviz`, this requires the Graphviz library and the
related Python package:

    brew install graphviz
    pip install time-lapse[graph]

Codec
=====

For near-universal compatibility the H.264 codec is used. The following
section describe some of the choices for specific configuration options.

See the ffmpeg wiki for additional information:
<https://trac.ffmpeg.org/wiki/Encode/H.264>

Constant Rate Factor
--------------------

This uses `-crf 20` to set a constant rate factor, which means the overall
quality of the movie should be constant. So bitrate varies to ensure
this. Higher value is lower quality. The quality and bit rates at this
value seem reasonable.

Preset
------

`-preset slower` is used to improve the compression ratio for the selected
quality (crf), without taking too much time.

Faststart
---------

`-movflags +faststart` is used to allow the movie to quickly start playing,
while it is still loading or buffering.

Quicktime support
-----------------

The codec defaults to YUV 444, which is not supported by Quicktime. So
add `pix_fmt yuv420p` to fix Quicktime support.

Input
=====

Select input frames
-------------------

Use frames as input by giving a glob pattern which matches the desired
images. Usually these will be tiff images so use
`-pattern_type glob -i "*.tiff"`.

Framerate
---------

When using image sequences as input the framerate of the desired output
should be given using `-framerate 30`.

Filters
=======

Commonly used filters:

- Deflicker <https://ffmpeg.org/ffmpeg-filters.html#toc-deflicker>
- Scale <https://ffmpeg.org/ffmpeg-filters.html#scale>
- Crop <https://ffmpeg.org/ffmpeg-filters.html#crop>
- Drawtext <https://ffmpeg.org/ffmpeg-filters.html#drawtext-1>
- Video sizes <https://ffmpeg.org/ffmpeg-utils.html#video-size-syntax>

Steps
-----

- First deflicker the video to ensure it is equally deflickered for
  all outputs
- Then scale and crop the videos to fit the desired final resolutions
- Then add the watermark (which should not be deflickered)

Scale video
-----------

Add scaling to ensure it fits in given dimensions. Negative values for
width or height make the encoder figure out the size by itself, keeping
the aspect ratio of the source. The integer of the negative value, i.e.
4 for -4, means that the size should be devisble by that value. TODO:
does it just scale/squish the video or crop?:

    -vf scale=1920:-2
    -vf scale=960:540:aspect..

Convert movie
=============

Using time-lapse to find tif files, and create a movie called 'test_movie'
with 24 fps and deflickered:

    from time_lapse import output, source

    source_input = source.get_input(['*.tif'], fps=24, deflicker=10, filters=None)
    output.create_outputs(source_input, 'test_movie', verbose=False)

Inspection
----------

By passing `verbose=True` to create outputs the following ffmpeg-python
inspection methods will be performed.

Show the ffmpeg command options ffmpeg-python would use:

    .get_args()

By using graphviz the graph from input to output can be shown using:

    .view()

            

Raw data

            {
    "_id": null,
    "home_page": null,
    "name": "time-lapse",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.11",
    "maintainer_email": "Arne de Laat <arne@delaat.net>",
    "keywords": "ffmpeg, photography, time-lapse",
    "author": null,
    "author_email": "Arne de Laat <arne@delaat.net>",
    "download_url": "https://files.pythonhosted.org/packages/90/10/32024143b29bd0a3f093ea940e0baa0c83150425a76577b4d1dc747d6b86/time_lapse-7.0.tar.gz",
    "platform": null,
    "description": "Time-Lapse assembling\n=====================\n\n[![PyPI](https://img.shields.io/pypi/v/time-lapse)](https://pypi.org/project/time-lapse/)\n[![License](https://img.shields.io/github/license/153957/time-lapse)](https://github.com/153957/time-lapse/blob/main/LICENSE)\n[![Build](https://img.shields.io/github/actions/workflow/status/153957/time-lapse/tests.yml?branch=main)](https://github.com/153957/time-lapse/actions)\n\nThis repo contains tools used to compile Time-lapse movies using\nffmpeg. The ffmpeg utility is controlled via the ffmpeg-python wrapper.\n\nExample usage of this package can be found in the\n[time-lapse scripts](https://github.com/153957/time-lapse-scripts) repository.\n\nInstallation\n============\n\nThis package requires the `ffmpeg` tool to be installed.\n\n    brew install ffmpeg\n\nThen install this package:\n\n    pip install time-lapse\n\nAdditionally, when using the verbose output option a graph will be\nrendered using `graphviz`, this requires the Graphviz library and the\nrelated Python package:\n\n    brew install graphviz\n    pip install time-lapse[graph]\n\nCodec\n=====\n\nFor near-universal compatibility the H.264 codec is used. The following\nsection describe some of the choices for specific configuration options.\n\nSee the ffmpeg wiki for additional information:\n<https://trac.ffmpeg.org/wiki/Encode/H.264>\n\nConstant Rate Factor\n--------------------\n\nThis uses `-crf 20` to set a constant rate factor, which means the overall\nquality of the movie should be constant. So bitrate varies to ensure\nthis. Higher value is lower quality. The quality and bit rates at this\nvalue seem reasonable.\n\nPreset\n------\n\n`-preset slower` is used to improve the compression ratio for the selected\nquality (crf), without taking too much time.\n\nFaststart\n---------\n\n`-movflags +faststart` is used to allow the movie to quickly start playing,\nwhile it is still loading or buffering.\n\nQuicktime support\n-----------------\n\nThe codec defaults to YUV 444, which is not supported by Quicktime. So\nadd `pix_fmt yuv420p` to fix Quicktime support.\n\nInput\n=====\n\nSelect input frames\n-------------------\n\nUse frames as input by giving a glob pattern which matches the desired\nimages. Usually these will be tiff images so use\n`-pattern_type glob -i \"*.tiff\"`.\n\nFramerate\n---------\n\nWhen using image sequences as input the framerate of the desired output\nshould be given using `-framerate 30`.\n\nFilters\n=======\n\nCommonly used filters:\n\n- Deflicker <https://ffmpeg.org/ffmpeg-filters.html#toc-deflicker>\n- Scale <https://ffmpeg.org/ffmpeg-filters.html#scale>\n- Crop <https://ffmpeg.org/ffmpeg-filters.html#crop>\n- Drawtext <https://ffmpeg.org/ffmpeg-filters.html#drawtext-1>\n- Video sizes <https://ffmpeg.org/ffmpeg-utils.html#video-size-syntax>\n\nSteps\n-----\n\n- First deflicker the video to ensure it is equally deflickered for\n  all outputs\n- Then scale and crop the videos to fit the desired final resolutions\n- Then add the watermark (which should not be deflickered)\n\nScale video\n-----------\n\nAdd scaling to ensure it fits in given dimensions. Negative values for\nwidth or height make the encoder figure out the size by itself, keeping\nthe aspect ratio of the source. The integer of the negative value, i.e.\n4 for -4, means that the size should be devisble by that value. TODO:\ndoes it just scale/squish the video or crop?:\n\n    -vf scale=1920:-2\n    -vf scale=960:540:aspect..\n\nConvert movie\n=============\n\nUsing time-lapse to find tif files, and create a movie called 'test_movie'\nwith 24 fps and deflickered:\n\n    from time_lapse import output, source\n\n    source_input = source.get_input(['*.tif'], fps=24, deflicker=10, filters=None)\n    output.create_outputs(source_input, 'test_movie', verbose=False)\n\nInspection\n----------\n\nBy passing `verbose=True` to create outputs the following ffmpeg-python\ninspection methods will be performed.\n\nShow the ffmpeg command options ffmpeg-python would use:\n\n    .get_args()\n\nBy using graphviz the graph from input to output can be shown using:\n\n    .view()\n",
    "bugtrack_url": null,
    "license": null,
    "summary": "Time-lapse movie assembly",
    "version": "7.0",
    "project_urls": {
        "Homepage": "https://arne.delaat.net/timelapse.html",
        "Repository": "https://github.com/153957/time-lapse"
    },
    "split_keywords": [
        "ffmpeg",
        " photography",
        " time-lapse"
    ],
    "urls": [
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "0e5330ac847bfa0b42864d90538a8ee3c0f4821365b5094819ca244f76bb1574",
                "md5": "e237532cf4a05e68560ab08c97abf601",
                "sha256": "1574fa4669c44f081de6a5f1aad35b2fc59f70b61327d57c85d1775cd78bd6c6"
            },
            "downloads": -1,
            "filename": "time_lapse-7.0-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "e237532cf4a05e68560ab08c97abf601",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.11",
            "size": 53354,
            "upload_time": "2024-04-06T09:53:01",
            "upload_time_iso_8601": "2024-04-06T09:53:01.127975Z",
            "url": "https://files.pythonhosted.org/packages/0e/53/30ac847bfa0b42864d90538a8ee3c0f4821365b5094819ca244f76bb1574/time_lapse-7.0-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "901032024143b29bd0a3f093ea940e0baa0c83150425a76577b4d1dc747d6b86",
                "md5": "3a64fe2cfd98be01e7890fdd4501a3b1",
                "sha256": "52dba76e68ad40db3f0c7b46859bd4809f1aed3a93dad3aea86834ba924b1036"
            },
            "downloads": -1,
            "filename": "time_lapse-7.0.tar.gz",
            "has_sig": false,
            "md5_digest": "3a64fe2cfd98be01e7890fdd4501a3b1",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.11",
            "size": 2440040,
            "upload_time": "2024-04-06T09:53:22",
            "upload_time_iso_8601": "2024-04-06T09:53:22.353606Z",
            "url": "https://files.pythonhosted.org/packages/90/10/32024143b29bd0a3f093ea940e0baa0c83150425a76577b4d1dc747d6b86/time_lapse-7.0.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-04-06 09:53:22",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "153957",
    "github_project": "time-lapse",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "lcname": "time-lapse"
}
        
Elapsed time: 0.22430s