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

Automatic codec detection #222

Closed
jakefb opened this issue Dec 29, 2014 · 7 comments
Closed

Automatic codec detection #222

jakefb opened this issue Dec 29, 2014 · 7 comments
Labels

Comments

@jakefb
Copy link
Contributor

@jakefb jakefb commented Dec 29, 2014

Hi, I'm having a few issues streaming video in the browser with WebTorrent.

I encoded a MP4 video to MPEG-Dash with the command: MP4Box -dash 5000 -frag 5000 -rap video.mp4. I uploaded the video_dashinit.mp4 file to instant.io in Chrome. The torrent was created and an HTML5 element appeared, but the video doesn't buffer.

It would be great to have a wiki page with instructions for streaming video with WebTorrent in the browser, as well as how to seed the video while it buffers if it's possible.

@feross

This comment has been minimized.

Copy link
Member

@feross feross commented Dec 31, 2014

WebTorrent is making an assumption about the codec used. You can see this auto-detection code here: https://github.com/feross/webtorrent/blob/master/lib/file-stream.js#L106

In the coming months, @jhiesey is going to implement automatic codec detection so lots more .mp4 files should work.

@feross feross changed the title Video streaming issue Automatic codec detection Dec 31, 2014
@feross

This comment has been minimized.

Copy link
Member

@feross feross commented Dec 31, 2014

Related issue: webtorrent/instant.io#10 (Repackage video files on the fly to support streaming to tag)

@jakefb

This comment has been minimized.

Copy link
Contributor Author

@jakefb jakefb commented Jan 2, 2015

If anyone finds it helpful, this is how I encoded the mp4 files before converting them to MPEG-DASH. Set the bitrate to what you want depending on the video resolution, or you can use -crf 18 (visually lossless) instead of -b:v 8000k. ./ffmpeg -i video.mp4 -c:v h264 -preset slow -c:a aac -strict -2 -b:v 8000k -b:a 384k fcvideos/yosemite.mp4

@feross

This comment has been minimized.

Copy link
Member

@feross feross commented Jan 5, 2015

@jakefb Thanks for sharing the command.

@jakefb jakefb mentioned this issue Feb 7, 2015
@feross

This comment has been minimized.

Copy link
Member

@feross feross commented Apr 1, 2015

Good news! @jhiesey has gotten automatic MP4 repackaging working! He's published it as a module: videostream (highly work-in-progress).

It's currently being used on https://instant.io, which you'll be able to test when I get the site working again (sorry, broke it then went on a three-day sailing adventure with @dominictarr). Will try to get https://instant.io working again sometime today so you all can test it out!

cc @mafintosh @maxogden

@feross

This comment has been minimized.

Copy link
Member

@feross feross commented Apr 1, 2015

https://instant.io is working again.

@feross

This comment has been minimized.

Copy link
Member

@feross feross commented Jul 1, 2015

Automatic MP4 and M4A repackaging for playback in the <video> and <audio> tag has been working for a while, so I'm going to close this issue.

Take a look at https://instant.io to see it in action, and the source code is here.

@feross feross closed this Jul 1, 2015
@feross feross added the enhancement label Jul 1, 2015
@lock lock bot locked as resolved and limited conversation to collaborators May 6, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Linked pull requests

Successfully merging a pull request may close this issue.

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