Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Useful trick #1

Open
josedotjs opened this issue Feb 15, 2017 · 0 comments
Open

Useful trick #1

josedotjs opened this issue Feb 15, 2017 · 0 comments

Comments

@josedotjs
Copy link

Hello Khalid, thanks for this project. Im doing a similar software and i have a trick to share. You can use ffmpeg to download only the portion of the video that you need. Consider this example

const ytdl = require('youtube-dl')
const ffmpeg = require('fluent-ffmpeg')

let options = ['-f 18', '--get-url'];
let url = 'https://www.youtube.com/watch?v=zJ7hUvU-d2Q' // 6 hours long video

ytdl.getInfo(url, options, function(err, info) {
  if (err) {
    return
  }
  ffmpeg(info.url)
  .seekInput('0:20:30') //work best with this format
  .duration(20) //seconds
  .save('outfile.mp4')
})

This helps to save a lot of time and bandwidth in large videos.
I hope this helps
PS: Sorry for my bad english

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant