isonic1 / flick

A CLI with helpful QA tools for Android (Devices & Emulators) and iOS (Devices).
MIT License
101 stars 26 forks source link

Dynamic video rate #30

Open erdoganonur opened 7 years ago

erdoganonur commented 7 years ago

This is my first Ruby code, please check it out as structurally.

We have new dependency that it is mp4fpsmod. It is quite good at video resampling etc.

I follow this step for create dynamic fps video.

  1. Before we create video from screenshots, we create a timecode file from creation date of screenshots.
  2. A video that has constant frame rate is created via FFMPEG.
  3. mp4fpsmod convert the video to variable frame rate video against to time code file. Which means every moment of video can have different fps.
  4. Variable frame rated video is converted to constant frame rate video via FFMPEG. Basically FFMPEG resample fps against to peak fps value.

I added lots of comments and system.out to make more readable and debugging purposes.

We can create VFR without mp4fpsmod via editing meta data of video but it is really complex.

isonic1 commented 7 years ago

HI @erdoganonur,

First off, thank you so much for taking the time to create this PR! A lot of people do not go that far in doing that.

With that said, I'm a bit reluctant to introduce a new tool (mp4fpsmod) to this. For one, ffmpeg and mp4box work on all platforms (linux, osx, windows). Though I don't support Windows currently because I haven't had time to work on it, I will do so in the future.

The new frame rate argument I added fo my iOS videos are good. At least for my use case when viewing video test results. Although, it's not entirely smooth

Have you tried tweaking the seconds and frame rate arguments like below for your use case? flick video -p ios -s 0.1 -a start (takes a screenshot per 0.1 seconds) Though, this depends on machine and iOS device resources how fast it actually happens. flick video -p ios -r 3 -a stop

How hard would it be to make ffmpeg do what mp4fpsmod is doing? I am open to making adjustments to Flick for this but I'm also trying to keep things really simple too.

erdoganonur commented 6 years ago

Hi, @isonic1,

I am sorry for late response, you are right on your concerns about adding a new tool to flick. I have googled a bit about mp4box so, we can deal with it via mp4Box. I'll try at first chance.

Tweaking isn't an option in my experiments because screenshots have the variety of size within 70kb to 1.5MB according to their contents so, capturing time is dependent on the size.