Code Monkey home page Code Monkey logo

bmtool's People

Contributors

talha131 avatar

Watchers

 avatar  avatar

bmtool's Issues

Create command to make snapshot from video

bmtool videoSnapshot -f -o

  • Create png or jpeg(default) output
  • check duration of video
  • take from mid. Time format is 00:00:03 for 3rd second
  • check if it is video before processing

Command is

ffmpeg -ss 01:23:45 -i input -vframes 1 -q:v 1 output.jpg

or

ffmpeg -ss 01:23:45 -i input -vframes 1 -q:v 1 output.png

Fix videoLoop to use single method to create video with and without crossfade

Video has artifacts.

See this parameter

[0:v]trim=start=0:end=15,setpts=PTS-STARTPTS[clip1]; [0:v]trim=start=0:end=15,setpts=PTS-STARTPTS[clip2]; [0:v]trim=start=15:end=15,setpts=PTS-STARTPTS[clip3]; [0:v]trim=start=15:end=15,setpts=PTS-STARTPTS[fadeoutsrc]; [0:v]trim=start=0:end=0,setpts=PTS-STARTPTS[fadeinsrc]; [fadeinsrc]format=pix_fmts=yuva420p, fade=t=in:st=0:d=0:alpha=1[fadein]; [fadeoutsrc]format=pix_fmts=yuva420p, fade=t=out:st=0:d=0:alpha=1[fadeout]; [fadein]fifo[fadeinfifo]; [fadeout]fifo[fadeoutfifo]; [fadeoutfifo][fadeinfifo]overlay[crossfade]; [crossfade] split=3 [cf1][cf2][cf3] ; [clip2] split=3 [cl1][cl2][cl3] ; [clip1][cf1][cl1][cf2][cl2][cf3][cl3][clip3]concat=n=8:v=1[output]

Several items like clip2, clip3, fadein, fadeout are not required. They can be enclosed in if conditional.

What we need to do is to split clip1 required number of times and then concatenate it.

Better way is to create a new method that generates filter_complex. It would be cleaner.

Use cobra

https://github.com/spf13/cobra

  • Add cobra
  • Move file renamer to cobra
    • Figure out verbose flag on root. Need to know how it can be used in file rename command
    • Test bmtool file rename command after installation
  • Move audio converted to cobra

Create `video loop -c -d" command

I need two things

  1. Create loop of video by concatenating same video -c times
  2. Create loop of video by concatenating until final video duration is over -d

Count

  • Create temp file
  • add file 'input.mov' -c times to it
  • pass temp file to ffmpeg
  • format of final video is mp4
  • name of output is input_3times.mp4

Duration

  • get duration of video

Batch convert audio files

See code here

https://github.com/talha131/bm-utilities/blob/f8bbbd2726de8dd4390b4376dd2311ccbbe1213a/bm_convert_audio/bm_convert_audio.go#L22-L27

If file is audio, then convertFile method is immediately called. If you have 1000 files, convertFile will be called 1000 times. It is not necessary, because ffmpeg has support for multiple inputs and multiple outputs.

For example, this command converts two files.

ffmpeg -i "2017-12-15 130550.mp3" -i "2018-01-19 131624.mp3" -map 0:0 -ac 1 -ab 64k -ar 44100 "2017-12-15 130550.wav" -map 1:0 -ac 1 -ab 64k -ar 44100 "2018-01-19 131624.wav"

Or

ffmpeg -i "2017-12-15 130550.mp3" -i "2018-01-19 131624.mp3" -ac 1 -ab 64k -ar 44100  -map 0:0  "2017-12-15 130550.wav" -map 1:0  "2018-01-19 131624.wav"

This converts files simultaneously.

Documentation:

  1. https://trac.ffmpeg.org/wiki/Creating%20multiple%20outputs
  2. https://trac.ffmpeg.org/wiki/Map

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.