SynoCommunity / spksrc

Cross compilation framework to create native packages for the Synology's NAS
https://synocommunity.com
Other
3.03k stars 1.23k forks source link

RTMP protocol with FFMPEG #4911

Closed Garikover closed 3 years ago

Garikover commented 3 years ago

Setup

Package Name: ffmpeg Package Version: 4.3.2-38

NAS Model: DS420+ NAS Architecture: INTEL Celeron J4025 DSM version: 7.0.1-42218

I want to stream file to a rtmp server like youtube or twitch...

ffmpeg -re -i /volume1/Media/test.avi -c copy -f flv rtmp://localhost/live/test

But when i send the command : rtmp://localhost/live/test: Protocol not found

ffmpeg version 4.1.6 Copyright (c) 2000-2020 the FFmpeg developers built with gcc 7.5.0 (GCC) configuration: --prefix=/usr --incdir='${prefix}/include/ffmpeg' --arch=i686 --target-os=linux --cross-prefix=/usr/local/x86_64-pc-linux-gnu/bin/x86_64-pc-linux-gnu- --enable-cross-compile --enable-optimizations --enable-pic --enable-gpl --enable-shared --disable-static --disable-stripping --enable-version3 --enable-encoders --enable-pthreads --disable-protocols --disable-protocol=rtp --enable-protocol=file --enable-protocol=pipe --disable-muxer=image2 --disable-muxer=image2pipe --disable-swscale-alpha --disable-ffplay --disable-ffprobe --disable-doc --disable-devices --disable-bzlib --disable-altivec --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libmp3lame --disable-vaapi --disable-cuvid --disable-nvenc --disable-decoder=amrnb --disable-decoder=ac3 --disable-decoder=ac3_fixed --disable-encoder=zmbv --disable-encoder=dca --disable-decoder=dca --disable-encoder=ac3 --disable-encoder=ac3_fixed --disable-encoder=eac3 --disable-decoder=eac3 --disable-encoder=truehd --disable-decoder=truehd --disable-encoder=hevc_vaapi --disable-decoder=hevc --disable-muxer=hevc --disable-demuxer=hevc --disable-parser=hevc --disable-bsf=hevc_mp4toannexb --x86asmexe=yasm --cc=/usr/local/x86_64-pc-linux-gnu/bin/x86_64-pc-linux-gnu-wrap-gcc --enable-yasm --enable-libx264 --enable-encoder=libx264 libavutil 56. 22.100 / 56. 22.100 libavcodec 58. 35.100 / 58. 35.100 libavformat 58. 20.100 / 58. 20.100 libavdevice 58. 5.100 / 58. 5.100 libavfilter 7. 40.101 / 7. 40.101 libswscale 5. 3.100 / 5. 3.100 libswresample 3. 3.100 / 3. 3.100 libpostproc 55. 3.100 / 55. 3.100 Input #0, avi, from '/volume1/Media/test.avi': Metadata: encoder : FairUse Wizard - http://fairusewizard.com Duration: 01:32:11.68, start: 0.000000, bitrate: 1060 kb/s Stream #0:0: Video: mpeg4 (Advanced Simple Profile) (XVID / 0x44495658), yuv420p, 640x352 [SAR 1:1 DAR 20:11], 930 kb/s, 25 fps, 25 tbr, 25 tbn, 25 tbc Stream #0:1: Audio: mp3 (U[0][0][0] / 0x0055), 48000 Hz, stereo, fltp, 116 kb/s rtmp://localhost/live/test: Protocol not found

After with "ffmpeg -protocols", Input and Output are both : file, pipe.

rtmp is missing

Can i add it ?

Thanks

hgy59 commented 3 years ago

As of your log you use the ffmpeg of DSM and not the one of synocommunity.

You need the full path for sc version of ffmpeg /var/packages/ffmpeg/target/bin/ffmpeg

Not sure, whether sc ffmpeg supports rtmp.

Garikover commented 3 years ago

Ok, it's the problem.

With the real package, the rtmp is enable.

How can i change the default ffmpeg path ?

BenjV commented 3 years ago

There is no such thing as a default ffmpeg path. Synology just put their ffmpeg binary in the default location for DSM binaries. Those binaries are found via the Path environment variable.

I would not advise you to change that, most likely there is Synology software that relay on that. Also replacing the Synology version with the SynoComunity version is na very bad idea.

Just use the full path if you need the SynoCommunity version or create a simlink or create your own environment variable to point to the SynoCommunity ffmpeg version..

th0ma7 commented 3 years ago

You can also simply do something such as (which tells you the primary location where the binary is found):

$ which ffmpeg
/bin/ffmpeg                   <<<--- default Synology
$ export PATH=/var/packages/ffmpeg/target/bin:$PATH
$ which ffmpeg
/var/packages/ffmpeg/target/bin/ffmpeg              <<<--- SynoCommunity ffmpeg

Or add it to your .profile environment to be permanent for a specific user such as:

$ which ffmpeg
/bin/ffmpeg
$ echo 'export PATH=/var/packages/ffmpeg/target/bin:$PATH' >> .profile
[ logout/login ]
$ which ffmpeg
/var/packages/ffmpeg/target/bin/ffmpeg
BenjV commented 3 years ago

If you do it that way if an a Synology package like for example VideoStation needs ffmpeg and depend on the specific Synology version of ffmpeg it will find the SynoCommunity version.

I don't say that VideoStation expliciet needs the Synology version, I only say be carefull to replace DSM's own binaries.