Giter VIP home page Giter VIP logo

Comments (5)

pietrop avatar pietrop commented on September 22, 2024

Figured out how to convert audio to video. Seems like you need to add an image, and then loop over it.

eg

ffmpeg -loop 1 -i 20180919_053412_0.jpg -i test-audio.m4a -shortest short-outputfile.mp4

and using fluent ffmpeg

/**
 * Converting this ffmpeg compand into a fluent-ffmpeg one to make a module out of it
 * ffmpeg -loop 1 -i 20180919_053412_0.jpg -i test-audio.m4a  -shortest  short-outputfile.mp4
 */
const ffmpeg = require('fluent-ffmpeg');

let videoSrc = 'test-audio.m4a';
let imageSrc = '20180919_053412_0.jpg';
let outpuFileName= 'short-outputfile-fluent.mp4';
// multiple inputs https://github.com/fluent-ffmpeg/node-fluent-ffmpeg#mergetofilefilename-tmpdir-concatenate-multiple-inputs
ffmpeg(videoSrc)
.input(imageSrc)
.loop()
.output(outpuFileName)
.withVideoCodec('libx264')
// shortest is used to avoid looping indefinitely
.addOptions(['-shortest'])
// .withVideoBitrate(1024)
.withAudioCodec('aac')
// when done executing returning output file name to callback
.on('end', function() { 
    console.log(`Done processing ${outpuFileName}`);
    // callback(outputName);
 })
.run();

more details here https://trello.com/c/AjGPSIvf

Need to decide if just use a default black image, or whether to allow to supply an image?
and/or add captions to the file? wave form? don't relly want to "re-invent" audiogram... so something simple, and modular would be good. Suggestions welcome.

  • Need to make this into a self contained module
  • add to autoEdit

from autoedit_2.

pietrop avatar pietrop commented on September 22, 2024

Alternatively if going down the generate an audio wave form video from audio file, then no need to do the looping of the image. (could just add captions)

This command seem to work

ffmpeg -i test-audio.m4a -filter_complex "[0:a]showwaves=s=1920x1080:mode=line,format=yuv420p[v]" -map "[v]" -map 0:a -c:v libx264 -c:a copy output-wave.mp4

see video example of effect https://youtu.be/jrY9h9OFBCM

from autoedit_2.

pietrop avatar pietrop commented on September 22, 2024

Next steps considering to add support for audio

  • waveform module (see above) - for audio only
  • caption module (see above) - for audio and video, for so called "silent video" on social media (twitter in this casE)
  • put it all together and add to autoEdit

from autoedit_2.

pietrop avatar pietrop commented on September 22, 2024

made some improvement on tweet-that-clip npm module to enable functionalities discussed above. pietrop/tweet-that-clip#1.

Got adding support for burnt in captions and audio (with animated wave form) to work.

However going to try and do some refactoring/cleaning up before merging to master.

It will then be possible to update the module in autoEdit, and try and integrate it (eg generating an srt from the clip selection burn in the captions etc..)

Suggestions and help welcome :)

from autoedit_2.

pietrop avatar pietrop commented on September 22, 2024

updated to TweetThatClip 2.0.1 and started integration

  • UI in transcription view for audio / video select (while figure out how to do it programmatically, in a reliable way).
  • Add support for captions - convert words in timecode segment, into srt in tmp folder, and pass path as param. to burn caption in tweet, audio or video.

from autoedit_2.

Related Issues (20)

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.