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

When using 'range' option the output video is unreadable #32

Closed
stevewirig opened this issue Apr 18, 2014 · 1 comment
Closed

When using 'range' option the output video is unreadable #32

stevewirig opened this issue Apr 18, 2014 · 1 comment

Comments

@stevewirig
Copy link

When I run the following, I get a functioning mp4 video that lasts for 2 seconds then freezes for the remaining 5 seconds (original YT video is 7 seconds, 300kb):

ytdl(url, { filter: function(format) { return format.container === 'mp4'; }, range:"0-85714", quality:
"highest" })
  .pipe(fs.createWriteStream('video.mp4'));

When I run this:

ytdl(url, { filter: function(format) { return format.container === 'mp4'; }, range:"42857-85714", quality:
"highest" })
  .pipe(fs.createWriteStream('video.mp4'));

I would expect to get an mp4 with 1 second duration starting from the offset of 1 second. The files size looks correct in that it is returning the appropriate number of bytes, but I believe the video is not getting its duration / dimension meta data and is not playable.

Am I doing something wrong?

@fent
Copy link
Owner

fent commented Apr 25, 2014

range is meant to be used to get a partial file, it's meant to be used as way to pause/continue a download. not to slice a video. I don't know if there's a video encoding that can break up the time in a video by breaking up the video file itself.

also thanks for reminding me to put the range option back.

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

2 participants