Skip to content

JuPfu/beck-view-movie

Repository files navigation

beck-view-movie

beck-view-movie is a Python project designed to generate a movie from digitized frames (images) produced by the beck-view-digitalize project. This program converts a sequence of frames into a video file and supports parallel processing to optimize the performance when working with a large number of images.

Table of Contents

Overview

beck-view-movie is the second step in the process of digitizing Super V8 films. After the frames have been digitized and stored in an output directory by the beck-view-digitalize project, this program assembles the frames into a video file. The core method of this project utilizes parallel processing for efficient handling of a large number of images.

Features

  • Assembles digitized frames into a video file.
  • Supports parallel processing for efficient handling of large image sets.
  • Customizable frame rate (FPS) and output video file name.
  • Supports batch (chunk) processing to enhance performance.
  • Logging for detailed information and progress tracking.

Requirements

  • Python 3.11 or higher
  • Required Python packages:
    • numpy
    • opencv-python
    • tqdm

Ensure you have all necessary dependencies installed using the provided requirements file or installing packages via pip:

Installation

Clone the repository:

git clone https://github.com/JuPfu/beck-view-movie
cd beck-view-movie

Install the required dependencies:

pip install -r requirements.txt

Usage

To use the beck-view-movie program, you must run the script from the command line and provide the necessary arguments. The program accepts the following command-line arguments:

  • -p
    Specifies the path to the directory containing PNG frames matching the pattern frame{number}.png. The default is the current directory.
-p /path/to/input/directory
  • -o
    Specifies the output directory where the generated MP4 movie will be saved. The default is the current directory.
-o /path/to/output/directory
  • -n
    Specifies the name of the output MP4 movie file. The default is "beck-view-movie.mp4".
-n output_video.mp4
  • -fps
    Specifies the frames per second (FPS) for the video. The default is 24 FPS, and acceptable values range from 15 to 30.
-fps 21
  • -fh
    Flip images horizontally.
-fh
  • -fv
    Flip images vertically.
-fv
  • -w
    Number of parallel worker threads. The default value is 8. The value should be adapted to your hardware. Affects speed of assembly.
-w 8
  • -bs
    Specifies the batch size which is worked on in parallel in each worker thread. The default is 100 frames (images).
-bs 25

Examples

Here's an example of how to run the program from the command line:

python beck_view_movie.py -p /path/to/input/directory -o /path/to/output/directory -n my_movie.mp4 -fps 24

In this example, the program will generate a movie named my_movie.mp4 at 24 frames per second from PNG frames in the specified input directory. The output video file will be saved to the specified output directory.

You can run the program without any arguments to use the default values for each option.

For additional help and information on usage, you can use the --help flag:

python beck_view_movie.py --help

This will display a usage guide with information on the available arguments and their default values.

License

beck-view-movie is licensed under the MIT License. See the LICENSE file for details.

Information

This README.md file provides information on the project, its features, requirements, installation, usage, and examples. It is a comprehensive guide for anyone who wants to understand and use the beck-view-movie project. Let me know if you need any further assistance or adjustments!