pldubouilh / live-torrent

Simple proof-of-concept for a live streaming solution based on webtorrent
MIT License
168 stars 39 forks source link

CLI tool is throwing errors #4

Closed Er-rchydy closed 6 years ago

Er-rchydy commented 6 years ago

I installed the CLI tool in Centos7 and i tried it with my feed, but it didn't work it gives me this errors :

Starting server

(node:5468) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 1): StatusCodeError: 401 - "ERROR."
(node:5468) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
(node:5468) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 2): StatusCodeError: 401 - "ERROR."
(node:5468) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 3): StatusCodeError: 401 - "ERROR."
(node:5468) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 4): StatusCodeError: 401 - "ERROR."

Then i tried with the example you give : live-torrent -u http://wms.shared.streamshow.it/carinatv/carinatv/ -p playlist.m3u8 T got the same errors like above. One more question, is it important to have HTTPS in order for this to work ? and thanks for the great work

pldubouilh commented 6 years ago

Hey, thanks for the feedback !

I installed the CLI tool in Centos7 and i tried it with my feed, but it didn't work it gives me this errors

It seems like the the CLI tool can't fetch the manifest : 401 - "ERROR."

Testing with the carinatv stream is a bit wobbly (for instance it's been off today), I'm actually changing that, can you give me the output with my own stream ?

live-torrent -u https://live.computer/ -p manifest.m3u8

There are still some caveats as well, only simple manifests are supported for now. Also the trailing slash on the -u argument is needed... How is your manifest like ?

One more question, is it important to have HTTPS in order for this to work ?

Depends, technically it's only a requirement for the serviceworker. The service worker needs the site with the videoplayer to run on HTTPS, but your stream (manifest and chunks) can be served with HTTP.

Er-rchydy commented 6 years ago

@pldubouilh My bad i didn't understand the idea of the CLI, i though you can give it a live feed, like a MPEG-PS something like this : live-torrent -u https://live.computer/live_feed.ts -p manifest.m3u8 i didn't notice that -u point to a location of the manifest. It will be good to integrate this library with ffmpeg like to received video chunks directly from the ffmpeg output and make torrent from them. I try to make video chunks with ffmpeg and in the meantime run the script, but ffmpeg need some time to write the data, so live-torrent serve those video chunks quicker than ffmpeg made them, what do i need to edit so if the next chunk haven't been made yet to serve the last chunk again, so the player play the last 10 seconds again until ffmpeg make more chunk , my English is terrible i hope you understand what i mean.

pldubouilh commented 6 years ago

It will be good to integrate this library with ffmpeg like to received video chunks directly from the ffmpeg output and make torrent from them.

Right, I just pushed a nice refactor. Now it both allows you to:

  1. run from a feed that's hosted somewhere,
  2. or run directly from a folder with .ts files. Folder is read and new chunks pushed to the manifests it's being generated.

example 1: live-torrent -v -u https://live.computer -p manifest.m3u8 example 2: live-torrent -v -f feed/

I try to make video chunks with ffmpeg and in the meantime run the script, but ffmpeg need some time to write the data, so live-torrent serve those video chunks quicker than ffmpeg made them, what do i need to edit so if the next chunk haven't been made yet to serve the last chunk again, so the player play the last 10 seconds again until ffmpeg make more chunk

Now it waits until there's no more changes in the folder for some time before proceeding the chunk :+1:

kiemrong08 commented 6 years ago

how it can live from rmtp protocol feed ?

pldubouilh commented 6 years ago

how it can live from rmtp protocol feed ?

Can't do that, only HLS for now. Please make a new issue for new questions :)

Er-rchydy commented 6 years ago

it's working great, thanks