GithubHelp home page GithubHelp logo

aiueoabc / make_mp4_vfr Goto Github PK

View Code? Open in Web Editor NEW
2.0 2.0 0.0 5 KB

To make a constant frame rate MP4 video into a variable frame rate.

Python 100.00%
mp4 h264 vfr cfr block atom avc1 framerate python

make_mp4_vfr's Introduction

Make_MP4_VFR

To make a constant frame rate MP4 video into a variable frame rate using Python.

What type of video is available?

Currently, this script is designed for a video generated from OpenCV-Python libraly. So, you need some modification to use it for other MP4. (If I notice this is useful for others too, I will try to modify this.)

How to use?

At first, you need to prepare timecodes.txt, which has time-stamp data for each frame in timecodes_v2 format.
Here is an example;

0
20
50
70
100
...

In this case, each frame will be played like 1st frame at 0 ms, 2nd frame at 20 ms, 3rd frame at 50 ms, ... . And, the gap between 2 frames will be the displayed duration for the first one.

Next, please edit first 3 lines accorfing to your files. These lines are like below;

videoFilename = './video.mp4'
outputFilename = './testVFR.mp4'
timecodesFilename = './timecodes.txt'

, where videoFilename is a path to MP4 video, outputFilename is a path for result MP4, and timecodesFilename is the one you made. Please note the number of timecodes in timecodes.txt has to be same as frames in your video.

Finally, you can run this script! Run python EditMP4.py, you will get result!

Tested situation

I used https://github.com/AiueoABC/CompressedVideoGenerationExample to generate video for this.

Comments are welcome

Please open issue to let me know about any comments, suggests, and requests.

To make it better...

I need your support, pls feed me to make me motivated.
Here is a link to give me a coffe;
Buy Me A Coffee

make_mp4_vfr's People

Contributors

aiueoabc avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.