Coder Social home page Coder Social logo

almostengr / videoprocessor Goto Github PK

View Code? Open in Web Editor NEW
5.0 2.0 1.0 8.46 MB

Application that renders videos using FFMPEG for my content platforms

Home Page: https://thealmostengineer.com/projects/video-processor-application/

License: GNU General Public License v3.0

Shell 100.00%
kdenlive ubuntu linux automation video-render video-editing video-rendering render-videos youtuber content-creation

videoprocessor's Introduction

Video Processor

Purpose

Ask any content creator and they will tell you that creating videos is a time consuming process. For me, the most mundane and worse part of the process is waiting on the videos to render and uploading them to YouTube.

Some video editors, have a version of their software that can be ran on the server to render the video files created. By offloading the video rendering to another machine, you can edit more videos in less time.

Purpose of this application is to automate the video creation process. Videos that I post on both of my YouTube channels have a predefined structure for each video. Thus they are easy to automate. When additional content or on screen text needs to be displayed, the automation for that particular channel is modified accordingly.

My YouTube Channels

Video Schedule By Channel

  • Kenny Ram Dash Cam - Videos released weekly on Sundays
  • Robinson Handy and Technology Services - Videos released on Saturdays
  • Tech Talk with RHT Services - released on Tuesdays

References

Additional FFMPEG Commands

Occasionally, there are some additional FFMPEG commands that I need to run to create the videos that I desire to have. Since the commands are rarely used, I chose to not add the functionality that uses these commands into the application, but instead note them here for future reference.

Timelapse Video Without Audio

ffmpeg -i FILE0710.MOV -filter:v "setpts=0.5*PTS" -an FILE0710.timelapse.MOV

Create Video without Audio

ffmpeg -i out165.mov -an -c:v copy uncut165.mp4

Scale Video Resolution

ffmpeg -i out165.mov -an -vf scale=1920:1080 scaled165.mov

Concat Video Timelapse Files

for file in *MP4
do
echo "file $file" >> input.txt
done

ffmpeg -f concat -i input.txt -c:v copy output.mp4

Create Video With Image Files

ffmpeg -framerate 1/3 -pattern_type glob -i '*.jpg' -c:v libx264 -r 30 -pix_fmt yuv420p output.mp4

Add Music To Video

fmpeg -i 20230401_110000.mp4 -i ../../../ytvideostructure/07music/mix03.mp3 -shortest -c:v copy -c:a copy -map 0:v:0 -map 1:a:0 output.mp4

Convert Variable Rate Video To Constant Rate Video

ffmpeg -i input.mp4 -vf "setpts=1.0*PTS" -r 30 -c:v libx264 -crf 18 -c:a aac -b:a 192k output.mp4

videoprocessor's People

Contributors

almostengr avatar dependabot[bot] avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar

Forkers

swipswaps

videoprocessor's Issues

Create logging class

Need class for logging output instead of the static method in the UI class. Currently violates SRP

Also need to set the log format

generate thumbnails

After rendering each video, a thumbnail of each video should be created so that it can be uploaded with the video.
The thumbnail should have the title of the video in it.

Call api for transcriptions

Google has api that will transcribe a audio file to text. Will leverage this to transcribe the video and to provide captions

video object

create Dto for videos that has the following properties

  • archive file name
  • video title based on file name
  • channel properties to be used
  • video description
  • video keywords
  • video location

Add Readme

Readme file for how to use the automation, purpose,

Post transcriptions to website

Transcriptions from the videos will need to be posted to the website as new content. The content that is posted, will need to be in draft so that final edits can be done on the post.

Additional fields may need to be added to the content type to track the response received from the transcription service.

Rename project

Project name needs to be updated so that it better describes the project

filters file for blurring

Add logic for additional filters file to be read for video filters. This will allow for additional filters to be dynamically added so that additional video edits and rendering does not have to be done

Check disk space before rendering

A lot of disk space can be used when generating videos.

Automation needs to check the disk space before rendering a video to prevent running out of space and the program crashing.

Error when attempting to move file

Exception message being thrown. Looks like the wrong version of Files is being called.

Exception in thread "main" java.lang.NoClassDefFoundError: com/google/common/io/Files
at com.thealmostengineer.kdenlivetoyoutube.App.archiveProject(App.java:141)
at com.thealmostengineer.kdenlivetoyoutube.App.main(App.java:256)
Caused by: java.lang.ClassNotFoundException: com.google.common.io.Files
at java.net.URLClassLoader.findClass(URLClassLoader.java:382)
at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:349)
at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
... 2 more

Create credits clip

Have application to create credits clip when credits.txr file is present.

filter for flipping video

Some video footage is recorded with the camera upside down. Condition needs to be added to the file so that it can determine and add this filter when rendering the output

update render video

when creating video with multiple MP4 files with different encodings, it is advised to convert them to TS format first. Then merge them into a single MP4 file that is the same.

https://stackoverflow.com/questions/7333232/how-to-concatenate-two-mp4-files-using-ffmpeg

for MP4 files:
If they are not exactly same (100% same codec, same resolution, same type) MP4 files, then you have to trans-code them into intermediate streams at first:

ffmpeg -i myfile1.mp4 -c copy -bsf:v h264_mp4toannexb -f mpegts temp1.ts
ffmpeg -i myfile2.mp4 -c copy -bsf:v h264_mp4toannexb -f mpegts temp2.ts
// now join
ffmpeg -i "concat:temp1.ts|temp2.ts" -c copy -bsf:a aac_adtstoasc output.mp4

https://www.jeffgeerling.com/blog/2021/how-join-multiple-mp4-files-gopro-ffmpeg
https://superuser.com/questions/1059245/ffmpeg-join-two-mp4-files-with-ffmpeg-on-command-line/1059261#1059261

ffmpeg -i input1.mp4 -c copy -bsf:v h264_mp4toannexb -f mpegts intermediate1.ts
ffmpeg -i input2.mp4 -c copy -bsf:v h264_mp4toannexb -f mpegts intermediate2.ts
ffmpeg -i "concat:intermediate1.ts|intermediate2.ts" -c copy -bsf:a aac_adtstoasc output.mp4

transcript - sentence case

For the blog post, split the entire string into an array, using period followed by space as the separator.

Then uppercase the first letter in each array string

Then merge the individual strings to a single variable and continue with generating the final output.

Similar would need to be done for question marks followed by space

determine video project type

Determine the video project type, dash cam or tutorial. Based on this, then perform the additional steps for publishing the post, in addition to generating the video for it.

color schemes

Color schemes for the different video types are

  • handyman - yellow text, black background
  • technology - white text, green background; Christmas light show, white text, red (maroon) background
  • dash cam - white text, black background; night videos, orange text, black background
  • Toastmasters - blue background, white text

Lower thirds are to use the same backgrounds unless otherwise specified.

update repository structure

Update the project to the below folder structure. This will assist in better organizing the project and making future updates to the code.

  • documentation
  • source
  • tests

Use java logger

Use native java logging.
Remove current function that does logging.

night text for "fireworks"

Dash cam video titles that contain the word "fireworks" need to display titles in night mode (orange) color.

Get transcriptions

Some time needs to pass to allow for the a transcriptions to be generated by youtube. Process needs to wait after uploading before pushing the text to the website

Check for duplicate processes

Check to see if a previous instance of the process is already running. That will prevent the same file from being processed twice or causing unexpected exceptions.

add on screen graphics at beginning of clip

For Videos, there should be a check to include a video filter for lower third overlay. This filter will show for the first 5 to 10 seconds of the clip. Will then disappear. The overlay will need to be predefined and hard coded, so that it is consistent throughout the video.

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.