streamaserver / streama

Self hosted streaming media server. https://docs.streama-project.com/
MIT License
9.65k stars 986 forks source link

[Feature Request] Transcoding video #839

Open KwikFlix opened 5 years ago

KwikFlix commented 5 years ago

Really am enjoying this project and progress, thanks ;-). I have been looking about for an elegant solution to introduce transcoding functionality. I have seen some really complicated suggestions to resolve this. May I suggest looking at Pytranscoder as it seems to be most flexible and suitable for the watch-folder transcoding scenario. I have worked with pytranscoder, use it and I really enjoy the fact that you can off load transcoding jobs to your GPU or other machines, not effecting the front-end performance for streama for users.

Ircas commented 5 years ago

I really hope streama supports its own re encoding software or plugin. Right now I am using 3rd party programs to re encode all videos as mp4.

I have one question that is relevant with this.

I am trying to find the correct codecs settings containers or whatever to make it work.

I need a way for smart tvs to play streama with their native browser (samsung browser, LG browser etc) The same goes for ps4 native browser.

This is possible because for instance openloads videos all play really good on native browsers. I hope someone could tell me what to look for.

Tried all codecs... Tried adding flags. Changing the audio. The quality. Cabac version. The resolution but nothing seems to work.

I once downloaded a video from ION (they are a ripper/uploader team) and it worked. With no re encoding whatsoever. Unfortunately I dont remember the filename.

So its possible... But I need someone that is into re encoding.

My setup is for family and friends to be able to access and view movies and shows without the need of a smartphone laptop or androidbox.

KwikFlix commented 5 years ago

Samsung's are happy with h264 codec, how ever you need to take a look at your video profile. Samsung TV browsers are a little picky with profile. Regarding audio, very few TVs support any audio codecs other than PCM and AC3 (Dolby Digital). Hope this helps.

Ircas commented 5 years ago

@KwikFlix can you share the ffmpeg code line that I can try out? Or even a program I could try.

If I can find a way for all smart tvs to play streama right through the browser will be a life changer...

scsrat commented 5 years ago

I really hope streama supports its own re encoding software or plugin. Right now I am using 3rd party programs to re encode all videos as mp4.

I have one question that is relevant with this.

I am trying to find the correct codecs settings containers or whatever to make it work.

I need a way for smart tvs to play streama with their native browser (samsung browser, LG browser etc) The same goes for ps4 native browser.

This is possible because for instance openloads videos all play really good on native browsers. I hope someone could tell me what to look for.

Tried all codecs... Tried adding flags. Changing the audio. The quality. Cabac version. The resolution but nothing seems to work.

I once downloaded a video from ION (they are a ripper/uploader team) and it worked. With no re encoding whatsoever. Unfortunately I dont remember the filename.

So its possible... But I need someone that is into re encoding.

My setup is for family and friends to be able to access and view movies and shows without the need of a smartphone laptop or androidbox.

I am in this with you my friend, I am trying to make it work in the browser of LG and also I am not getting in case one of us finds the solution please pass .. and thanks for the attention ..

KwikFlix commented 5 years ago

H.264 was standardised, the profile and level for the encoding defines many key features of the media. Ircas you're looking at 4.1 and High as the maximum settings, but this is dependant on media source. This may help to understand as each level and profile carries key feature that your player requires. The same goes for most players. http://blog.mediacoderhq.com/h264-profiles-and-levels/

KwikFlix commented 5 years ago

ffmpeg -threads 4 -hwaccel cuvid -c:v h264_cuvid -i "input.file" \ -filter:v scale_npp=w=1920:h=1080:format=yuv420p:interp_algo=lanczos \ -c:v h264_nvenc -preset:v llhq -profile:v main -level:v 4.1 -rc:v ll_2pass_quality -rc-lookahead:v 32 -temporal-aq:v 1 -weighted_pred:v 1 -coder:v cabac -c:a aac -movflags faststart \ -f mp4 "output.mp4"

mp4box -inter 500 "output.mp4"

I believe the above example should give you required, however you could still improve example to suite needs (framerates...ect).

scsrat commented 5 years ago

ffmpeg -threads 4 -hwaccel cuvid -c:v h264_cuvid -i "input.file" -filter:v scale_npp=w=1920:h=1080:format=yuv420p:interp_algo=lanczos -c:v h264_nvenc -preset:v llhq -profile:v main -level:v 4.1 -rc:v ll_2pass_quality -rc-lookahead:v 32 -temporal-aq:v 1 -weighted_pred:v 1 -coder:v cabac -c:a aac -movflags faststart
-f mp4 "output.mp4"

mp4box -inter 500 "output.mp4"

I believe the above example should give you required, however you could still improve example to suite needs (framerates...ect).

Infelizmente não deu certo com estas configurações e outras 30 diferentes.. peço ajuda pra tentar compatibilidade com navegador (no meu caso Smart TV LG WebOS).. Abraços!