Is there a way to extract audio from a video file with Ruby? I'm looking to get audio from our sermon videos when posting them online.
There isn't anything built into Ruby, but you can use ffmpeg
to strip the audio from the video. Check out the gem https://github.com/streamio/streamio-ffmpeg. This will also require you to have ffmpeg
and any dependencies installed on your production machine. You may want to consider moving this into a background process (delayed_job) or putting a progressbar so the user doesn't wonder why it is just churning but not displaying results immediately. You can use something like polling or some type of notification to let the user know once the audio file is ready for streaming/downloading.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With