scivision / PyLivestream

Pure Python FFmpeg-based live video / audio streaming to YouTube, Facebook, Periscope, Twitch, and more
Apache License 2.0
707 stars 156 forks source link

[Feature request] File-stream "copy" without encode #42

Closed Hoerli1337 closed 4 years ago

Hoerli1337 commented 4 years ago

Is it possible to create a setup for file streaming that only passes the copy parameter? I have all the videos I want to stream in one folder. They all have the same resolution, fps and data rates. I would like to stream them via -codec copy, so that the CPU is not heavily loaded and still the best quality is streamed. So you can create a FullHD stream with a Raspberry Pi or a cheap vServer for example.

The command for ffmpeg looks like this ffmpeg -re -i /root/Videos/01.mp4 -codec copy -f flv rtmp://stream-server/key

So far I have not found an easy way to adjust the parameters. The script also wants the parameters for the data rate for picture and sound in the pylivestream.ini. Unfortunately I myself have no idea about python and cannot say which line in which file I would have to change to get the result.

scivision commented 4 years ago

Since PyLivestream is just a command line generator for FFmpeg, I would take the command line output and just manually add the settings you suggest above.

I didn't consider this case as the streaming services have parameters that have to be met that might not match the user videos in general.

Hoerli1337 commented 4 years ago

Can you give me an example? I do not understand your code :S

scivision commented 4 years ago

PyLivestream is oriented to remote streaming services, so the codec is auto-determined. The suggested application would require users to know their video is properly encoded for the service. This is probably something that's better done by directly invoking FFmpeg.

https://trac.ffmpeg.org/wiki/StreamingGuide