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

Using sample torrents, get error playing a few videos from web(chrome) #1680

Closed
ddumont opened this issue Aug 1, 2019 · 8 comments
Closed

Using sample torrents, get error playing a few videos from web(chrome) #1680

ddumont opened this issue Aug 1, 2019 · 8 comments

Comments

@ddumont
Copy link
Contributor

@ddumont ddumont commented Aug 1, 2019

    const magnet = 'magnet:?xt=urn:btih:dd8255ecdc7ca55fb0bbf81323d87062db1f6d1c&dn=Big+Buck+Bunny&tr=udp%3A%2F%2Fexplodie.org%3A6969&tr=udp%3A%2F%2Ftracker.coppersurfer.tk%3A6969&tr=udp%3A%2F%2Ftracker.empire-js.us%3A1337&tr=udp%3A%2F%2Ftracker.leechers-paradise.org%3A6969&tr=udp%3A%2F%2Ftracker.opentrackr.org%3A1337&tr=wss%3A%2F%2Ftracker.btorrent.xyz&tr=wss%3A%2F%2Ftracker.fastcast.nz&tr=wss%3A%2F%2Ftracker.openwebtorrent.com&ws=https%3A%2F%2Fwebtorrent.io%2Ftorrents%2F&xs=https%3A%2F%2Fwebtorrent.io%2Ftorrents%2Fbig-buck-bunny.torrent';
    // client.seed(dropped, torrent => {
    client.add(magnet, torrent => {
      setTorrents(torrents.concat(torrent));
      console.dir(torrent.magnetURI);
      torrent.files.forEach(file => {
        console.log(file.name);
      });

      torrent.on('download', () => {
        console.log('progress: ' + torrent.progress);
        if (torrent.progress === 1) {
          console.dir(torrent.files);
          torrent.files.some(file => {
            if (file.name.endsWith('.mp4') && file.progress === 1) {
              console.dir(file);
              file.renderTo(videoRef.current, (err) => {
                if (err) {
                  console.error(err);
                }
              });
              return true;
            }
          });
        }
      });
      torrent.on('upload', (bytes) => {
        console.log('total uploaded: ' + torrent.uploaded);
      });
      torrent.on('warning', err => console.warn(err));
      torrent.on('error', err => console.error(err));
      torrent.on('metadata', data => console.dir(data));
    });

"webtorrent": "^0.105.1"
Windows, fwiw...
Chrome 75.0.3770.142 (Official Build) (64-bit)

What did you expect to happen?
I expected it to play...

What actually happened?

Uncaught Error: invalid selection 1909 : 1053
    at Torrent.select (torrent.js:840)
    at File.createReadStream (file.js:89)
    at MP4Remuxer._findMoov (mp4-remuxer.js:28)
    at Decoder.<anonymous> (mp4-remuxer.js:51)
    at Decoder.emit (events.js:146)
    at decode.js:120
    at Decoder.../node_modules/mp4-stream/decode.js.Decoder._write (decode.js:67)
    at doWrite (_stream_writable.js:405)
    at writeOrBuffer (_stream_writable.js:394)
    at Decoder.../node_modules/mp4-stream/node_modules/readable-stream/lib/_stream_writable.js.Writable.write (_stream_writable.js:303)

The Sintel torrent you have plays fine this way, but videos I have on my computer (added via drag and drop) and the bunny one here don't play, they throw an error.

@ddumont

This comment has been minimized.

Copy link
Contributor Author

@ddumont ddumont commented Aug 1, 2019

stupid question, because I haven't ever had to deal with videos like this...

Why do we have to decode mp4? Can't the browser do that?

@guanzo

This comment has been minimized.

Copy link
Contributor

@guanzo guanzo commented Aug 1, 2019

@PaTiToMaSteR

This comment has been minimized.

Copy link

@PaTiToMaSteR PaTiToMaSteR commented Aug 1, 2019

@ddumont you need to webseed the .torrent, sintel.torrent is encoded in javascript in the same website

@ddumont

This comment has been minimized.

Copy link
Contributor Author

@ddumont ddumont commented Aug 1, 2019

@PaTiToMaSteR I don't think that's relevant to my issue

@ddumont

This comment has been minimized.

Copy link
Contributor Author

@ddumont ddumont commented Aug 1, 2019

I took that patch to videostream
@guanzo Interestingly enough... it seems the videos are playing but I still see this error:
Uncaught Error: invalid selection 43963 : 222
at Torrent.select (torrent.js:840)
at File.createReadStream (file.js:89)
at MP4Remuxer._findMoov (mp4-remuxer.js:28)
at Decoder.boxHandler (mp4-remuxer.js:52)
at Decoder.emit (events.js:146)
at decode.js:120
at Decoder.../node_modules/mp4-stream/decode.js.Decoder._write (decode.js:67)
at doWrite (_stream_writable.js:405)
at writeOrBuffer (_stream_writable.js:394)
at Decoder.../node_modules/mp4-stream/node_modules/readable-stream/lib/_stream_writable.js.Writable.write (_stream_writable.js:303)

@ddumont

This comment has been minimized.

Copy link
Contributor Author

@ddumont ddumont commented Aug 1, 2019

@guanzo I missed a line in the patch. Thank you, sir!

@ddumont

This comment has been minimized.

Copy link
Contributor Author

@ddumont ddumont commented Aug 1, 2019

I'll close this here, seeing as it's an upstream problem.

@ddumont ddumont closed this Aug 1, 2019
@feross

This comment has been minimized.

Copy link
Member

@feross feross commented Aug 4, 2019

Related: jhiesey/videostream#48

The latest version of videostream is published to npm now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
4 participants
You can’t perform that action at this time.