ArtUrlWWW 0 Posted May 3, 2020 Share Posted May 3, 2020 Hello. I need to convert RTSP stream to HTTP Video Stream, that Google Chrome browser could play. I am newbie in such question, so I Googled this https://trac.ffmpeg.org/wiki/StreamingGuide and installed Emby server just now. Now I see in Emby Server Version 4.4.2.0 checkEmby Server is up to date Running on http port 8096. In-Home (LAN) access: http://192.168.31.11:8096 Remote (WAN) access: ******************* My RTSP is only in private LAN, so I Googled RTSP stream for tests too: rtsp://170.93.143.139/rtplive/470011e600ef003a004ee33696235daa . When I am running ffmpeg -i "rtsp://170.93.143.139/rtplive/470011e600ef003a004ee33696235daa" -preset ultrafast -vcodec libx264 -tune zerolatency -b 900k -f mpegts http://192.168.31.11:8096/ I see output with error c:\temp\FFmpeg>ffmpeg -i "rtsp://170.93.143.139/rtplive/470011e600ef003a004ee33696235daa" -preset ultrafast -vcodec libx264 -tune zerolatency -b 900k -f mpegts http://192.168.31.11:8096/ ffmpeg version git-2020-05-01-39fb1e9 Copyright (c) 2000-2020 the FFmpeg developers built with gcc 9.3.1 (GCC) 20200328 configuration: --enable-gpl --enable-version3 --enable-sdl2 --enable-fontconfig --enable-gnutls --enable-iconv --enable-libass --enable-libdav1d --enable-libbluray --enable-libfreetype --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-libopus --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libsrt --enable-libtheora --enable-libtwolame --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxml2 --enable-libzimg --enable-lzma --enable-zlib --enable-gmp --enable-libvidstab --enable-libvmaf --enable-libvorbis --enable-libvo-amrwbenc --enable-libmysofa --enable-libspeex --enable-libxvid --enable-libaom --disable-w32threads --enable-libmfx --enable-ffnvcodec --enable-cuda-llvm --enable-cuvid --enable-d3d11va --enable-nvenc --enable-nvdec --enable-dxva2 --enable-avisynth --enable-libopenmpt --enable-amf libavutil 56. 43.100 / 56. 43.100 libavcodec 58. 82.100 / 58. 82.100 libavformat 58. 42.101 / 58. 42.101 libavdevice 58. 9.103 / 58. 9.103 libavfilter 7. 80.100 / 7. 80.100 libswscale 5. 6.101 / 5. 6.101 libswresample 3. 6.100 / 3. 6.100 libpostproc 55. 6.100 / 55. 6.100 Input #0, rtsp, from 'rtsp://170.93.143.139/rtplive/470011e600ef003a004ee33696235daa': Metadata: title : 470011e600ef003a004ee33696235daa.stream Duration: N/A, start: 0.334000, bitrate: N/A Stream #0:0: Video: h264 (Baseline), yuv420p(progressive), 352x240, 14.99 tbr, 90k tbn, 180k tbc Please use -b:a or -b:v, -b is ambiguous Stream mapping: Stream #0:0 -> #0:0 (h264 (native) -> h264 (libx264)) Press [q] to stop, [?] for help [libx264 @ 000001aa672b6180] using cpu capabilities: MMX2 SSE2Fast SSSE3 SSE4.2 AVX FMA3 BMI2 AVX2 [libx264 @ 000001aa672b6180] profile Constrained Baseline, level 2.0, 4:2:0, 8-bit Output #0, mpegts, to 'http://192.168.31.11:8096/': Metadata: title : 470011e600ef003a004ee33696235daa.stream encoder : Lavf58.42.101 Stream #0:0: Video: h264 (libx264), yuv420p, 352x240, q=-1--1, 900 kb/s, 14.99 fps, 90k tbn, 14.99 tbc Metadata: encoder : Lavc58.82.100 libx264 Side data: cpb: bitrate max/min/avg: 0/0/900000 buffer size: 0 vbv_delay: N/A av_interleaved_write_frame(): Unknown error Error writing trailer of http://192.168.31.11:8096/: Error number -10053 occurred frame= 1 fps=0.0 q=13.0 Lsize= 24kB time=00:00:00.00 bitrate=17637818.2kbits/s speed=0.00158x video:22kB audio:0kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 5.411397% [http @ 000001aa672b4480] URL read error: Error number -10053 occurred [libx264 @ 000001aa672b6180] frame I:1 Avg QP:13.00 size: 23007 [libx264 @ 000001aa672b6180] mb I I16..4: 100.0% 0.0% 0.0% [libx264 @ 000001aa672b6180] final ratefactor: 14.69 [libx264 @ 000001aa672b6180] coded y,uvDC,uvAC intra: 95.2% 45.8% 26.4% [libx264 @ 000001aa672b6180] i16 v,h,dc,p: 14% 42% 29% 15% [libx264 @ 000001aa672b6180] i8c dc,h,v,p: 66% 21% 10% 3% [libx264 @ 000001aa672b6180] kb/s:2758.08 Conversion failed! c:\temp\FFmpeg> I also tried to pass auth params to server, but it didn't solve the issue: ffmpeg -i "rtsp://170.93.143.139/rtplive/470011e600ef003a004ee33696235daa" -preset ultrafast -vcodec libx264 -tune zerolatency -b 900k -f mpegts http://root:qqqqqqq@192.168.31.11:8096/ ffmpeg version git-2020-05-01-39fb1e9 Copyright (c) 2000-2020 the FFmpeg developers built with gcc 9.3.1 (GCC) 20200328 configuration: --enable-gpl --enable-version3 --enable-sdl2 --enable-fontconfig --enable-gnutls --enable-iconv --enable-libass --enable-libdav1d --enable-libbluray --enable-libfreetype --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-libopus --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libsrt --enable-libtheora --enable-libtwolame --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxml2 --enable-libzimg --enable-lzma --enable-zlib --enable-gmp --enable-libvidstab --enable-libvmaf --enable-libvorbis --enable-libvo-amrwbenc --enable-libmysofa --enable-libspeex --enable-libxvid --enable-libaom --disable-w32threads --enable-libmfx --enable-ffnvcodec --enable-cuda-llvm --enable-cuvid --enable-d3d11va --enable-nvenc --enable-nvdec --enable-dxva2 --enable-avisynth --enable-libopenmpt --enable-amf libavutil 56. 43.100 / 56. 43.100 libavcodec 58. 82.100 / 58. 82.100 libavformat 58. 42.101 / 58. 42.101 libavdevice 58. 9.103 / 58. 9.103 libavfilter 7. 80.100 / 7. 80.100 libswscale 5. 6.101 / 5. 6.101 libswresample 3. 6.100 / 3. 6.100 libpostproc 55. 6.100 / 55. 6.100 Input #0, rtsp, from 'rtsp://170.93.143.139/rtplive/470011e600ef003a004ee33696235daa': Metadata: title : 470011e600ef003a004ee33696235daa.stream Duration: N/A, start: 0.600000, bitrate: N/A Stream #0:0: Video: h264 (Baseline), yuv420p(progressive), 352x240, 14.99 tbr, 90k tbn, 180k tbc Please use -b:a or -b:v, -b is ambiguous Stream mapping: Stream #0:0 -> #0:0 (h264 (native) -> h264 (libx264)) Press [q] to stop, [?] for help [libx264 @ 0000020a43c46300] using cpu capabilities: MMX2 SSE2Fast SSSE3 SSE4.2 AVX FMA3 BMI2 AVX2 [libx264 @ 0000020a43c46300] profile Constrained Baseline, level 2.0, 4:2:0, 8-bit Output #0, mpegts, to 'http://root:qqqqqqq@192.168.31.11:8096/': Metadata: title : 470011e600ef003a004ee33696235daa.stream encoder : Lavf58.42.101 Stream #0:0: Video: h264 (libx264), yuv420p, 352x240, q=-1--1, 900 kb/s, 14.99 fps, 90k tbn, 14.99 tbc Metadata: encoder : Lavc58.82.100 libx264 Side data: cpb: bitrate max/min/avg: 0/0/900000 buffer size: 0 vbv_delay: N/A av_interleaved_write_frame(): Unknown error Error writing trailer of http://root:qqqqqqq@192.168.31.11:8096/: Error number -10053 occurred frame= 1 fps=0.0 q=13.0 Lsize= 24kB time=00:00:00.00 bitrate=17501090.9kbits/s speed=0.000115x video:22kB audio:0kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 5.202413% [http @ 0000020a43c46d80] URL read error: Error number -10053 occurred [libx264 @ 0000020a43c46300] frame I:1 Avg QP:13.00 size: 22874 [libx264 @ 0000020a43c46300] mb I I16..4: 100.0% 0.0% 0.0% [libx264 @ 0000020a43c46300] final ratefactor: 14.65 [libx264 @ 0000020a43c46300] coded y,uvDC,uvAC intra: 94.8% 47.6% 25.8% [libx264 @ 0000020a43c46300] i16 v,h,dc,p: 13% 43% 30% 14% [libx264 @ 0000020a43c46300] i8c dc,h,v,p: 62% 23% 13% 3% [libx264 @ 0000020a43c46300] kb/s:2742.14 Conversion failed! c:\temp\FFmpeg> Can you tell me please, how to make HTTP video stream from RTSP stream with Emby server? Link to comment Share on other sites More sharing options...
pünktchen 1258 Posted May 3, 2020 Share Posted May 3, 2020 Because of C:\temp i guess you are on windows. Ffmpeg cannot output to http on windows, only on Linux. So you have to output to a normal file and host it with a seperate http server software. Link to comment Share on other sites More sharing options...
mastrmind11 717 Posted May 3, 2020 Share Posted May 3, 2020 not sure what any of this has to do with emby. seems like an ffmpeg question Link to comment Share on other sites More sharing options...
ArtUrlWWW 0 Posted May 3, 2020 Author Share Posted May 3, 2020 Tried to run from Linux host to Windows machine with Emby Server installed: ubuntu@ubuntu:~$ ffmpeg -i "rtsp://170.93.143.139/rtplive/470011e600ef003a004ee33696235daa" -preset ultrafast -vcodec libx264 -tune zerolatency -b 900k -f mpegts http://192.168.31.11:8096/ ffmpeg version 4.2.2-1ubuntu1 Copyright (c) 2000-2019 the FFmpeg developers built with gcc 9 (Ubuntu 9.3.0-3ubuntu1) configuration: --prefix=/usr --extra-version=1ubuntu1 --toolchain=hardened --libdir=/usr/lib/aarch64-linux-gnu --incdir=/usr/include/aarch64-linux-gnu --arch=arm64 --enable-gpl --disable-stripping --enable-avresample --disable-filter=resample --enable-avisynth --enable-gnutls --enable-ladspa --enable-libaom --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libcdio --enable-libcodec2 --enable-libflite --enable-libfontconfig --enable-libfreetype --enable-libfribidi --enable-libgme --enable-libgsm --enable-libjack --enable-libmp3lame --enable-libmysofa --enable-libopenjpeg --enable-libopenmpt --enable-libopus --enable-libpulse --enable-librsvg --enable-librubberband --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libssh --enable-libtheora --enable-libtwolame --enable-libvidstab --enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx265 --enable-libxml2 --enable-libxvid --enable-libzmq --enable-libzvbi --enable-lv2 --enable-omx --enable-openal --enable-opencl --enable-opengl --enable-sdl2 --enable-libdc1394 --enable-libdrm --enable-libiec61883 --enable-chromaprint --enable-frei0r --enable-libx264 --enable-shared libavutil 56. 31.100 / 56. 31.100 libavcodec 58. 54.100 / 58. 54.100 libavformat 58. 29.100 / 58. 29.100 libavdevice 58. 8.100 / 58. 8.100 libavfilter 7. 57.100 / 7. 57.100 libavresample 4. 0. 0 / 4. 0. 0 libswscale 5. 5.100 / 5. 5.100 libswresample 3. 5.100 / 3. 5.100 libpostproc 55. 5.100 / 55. 5.100 Input #0, rtsp, from 'rtsp://170.93.143.139/rtplive/470011e600ef003a004ee33696235daa': Metadata: title : 470011e600ef003a004ee33696235daa.stream Duration: N/A, start: 1.001000, bitrate: N/A Stream #0:0: Video: h264 (Baseline), yuv420p(progressive), 352x240, 14.99 tbr, 90k tbn, 180k tbc Please use -b:a or -b:v, -b is ambiguous Stream mapping: Stream #0:0 -> #0:0 (h264 (native) -> h264 (libx264)) Press [q] to stop, [?] for help [libx264 @ 0xaaaae331b5d0] using cpu capabilities: ARMv8 NEON [libx264 @ 0xaaaae331b5d0] profile Constrained Baseline, level 2.0 Output #0, mpegts, to 'http://192.168.31.11:8096/': Metadata: title : 470011e600ef003a004ee33696235daa.stream encoder : Lavf58.29.100 Stream #0:0: Video: h264 (libx264), yuv420p, 352x240, q=-1--1, 900 kb/s, 14.99 fps, 90k tbn, 14.99 tbc Metadata: encoder : Lavc58.54.100 libx264 Side data: cpb: bitrate max/min/avg: 0/0/900000 buffer size: 0 vbv_delay: -1 av_interleaved_write_frame(): Broken pipe Error writing trailer of http://192.168.31.11:8096/: Broken pipe frame= 1 fps=0.0 q=14.0 Lsize= 25kB time=00:00:00.00 bitrate=18321454.5kbits/s speed=0.000458x video:22kB audio:0kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 10.220511% [libx264 @ 0xaaaae331b5d0] frame I:1 Avg QP:14.00 size: 22856 [libx264 @ 0xaaaae331b5d0] mb I I16..4: 100.0% 0.0% 0.0% [libx264 @ 0xaaaae331b5d0] final ratefactor: 14.65 [libx264 @ 0xaaaae331b5d0] coded y,uvDC,uvAC intra: 94.2% 46.4% 23.9% [libx264 @ 0xaaaae331b5d0] i16 v,h,dc,p: 12% 45% 32% 12% [libx264 @ 0xaaaae331b5d0] i8c dc,h,v,p: 59% 26% 12% 4% [libx264 @ 0xaaaae331b5d0] kb/s:2739.98 Conversion failed! Should I pass login:password@@HOST in link to Embe server or only IP of Emby Server machine? ubuntu@ubuntu:~$ ffmpeg -i "rtsp://170.93.143.139/rtplive/470011e600ef003a004ee33696235daa" -preset ultrafast -vcodec libx264 -tune zerolatency -b 900k -f mpegts http://root:qqqqqqq@192.168.31.11:8096/ ffmpeg version 4.2.2-1ubuntu1 Copyright (c) 2000-2019 the FFmpeg developers built with gcc 9 (Ubuntu 9.3.0-3ubuntu1) configuration: --prefix=/usr --extra-version=1ubuntu1 --toolchain=hardened --libdir=/usr/lib/aarch64-linux-gnu --incdir=/usr/include/aarch64-linux-gnu --arch=arm64 --enable-gpl --disable-stripping --enable-avresample --disable-filter=resample --enable-avisynth --enable-gnutls --enable-ladspa --enable-libaom --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libcdio --enable-libcodec2 --enable-libflite --enable-libfontconfig --enable-libfreetype --enable-libfribidi --enable-libgme --enable-libgsm --enable-libjack --enable-libmp3lame --enable-libmysofa --enable-libopenjpeg --enable-libopenmpt --enable-libopus --enable-libpulse --enable-librsvg --enable-librubberband --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libssh --enable-libtheora --enable-libtwolame --enable-libvidstab --enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx265 --enable-libxml2 --enable-libxvid --enable-libzmq --enable-libzvbi --enable-lv2 --enable-omx --enable-openal --enable-opencl --enable-opengl --enable-sdl2 --enable-libdc1394 --enable-libdrm --enable-libiec61883 --enable-chromaprint --enable-frei0r --enable-libx264 --enable-shared libavutil 56. 31.100 / 56. 31.100 libavcodec 58. 54.100 / 58. 54.100 libavformat 58. 29.100 / 58. 29.100 libavdevice 58. 8.100 / 58. 8.100 libavfilter 7. 57.100 / 7. 57.100 libavresample 4. 0. 0 / 4. 0. 0 libswscale 5. 5.100 / 5. 5.100 libswresample 3. 5.100 / 3. 5.100 libpostproc 55. 5.100 / 55. 5.100 Input #0, rtsp, from 'rtsp://170.93.143.139/rtplive/470011e600ef003a004ee33696235daa': Metadata: title : 470011e600ef003a004ee33696235daa.stream Duration: N/A, start: 0.601000, bitrate: N/A Stream #0:0: Video: h264 (Baseline), yuv420p(progressive), 352x240, 14.99 tbr, 90k tbn, 180k tbc Please use -b:a or -b:v, -b is ambiguous Stream mapping: Stream #0:0 -> #0:0 (h264 (native) -> h264 (libx264)) Press [q] to stop, [?] for help [libx264 @ 0xaaaabe01a480] using cpu capabilities: ARMv8 NEON [libx264 @ 0xaaaabe01a480] profile Constrained Baseline, level 2.0 Output #0, mpegts, to 'http://root:qqqqqqq@192.168.31.11:8096/': Metadata: title : 470011e600ef003a004ee33696235daa.stream encoder : Lavf58.29.100 Stream #0:0: Video: h264 (libx264), yuv420p, 352x240, q=-1--1, 900 kb/s, 14.99 fps, 90k tbn, 14.99 tbc Metadata: encoder : Lavc58.54.100 libx264 Side data: cpb: bitrate max/min/avg: 0/0/900000 buffer size: 0 vbv_delay: -1 av_interleaved_write_frame(): Broken pipe Error writing trailer of http://root:qqqqqqq@192.168.31.11:8096/: Broken pipe frame= 1 fps=0.0 q=13.0 Lsize= 26kB time=00:00:00.00 bitrate=19141818.2kbits/s speed=0.000441x video:24kB audio:0kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 9.356822% [libx264 @ 0xaaaabe01a480] frame I:1 Avg QP:13.00 size: 24068 [libx264 @ 0xaaaabe01a480] mb I I16..4: 100.0% 0.0% 0.0% [libx264 @ 0xaaaabe01a480] final ratefactor: 14.99 [libx264 @ 0xaaaabe01a480] coded y,uvDC,uvAC intra: 93.9% 40.9% 22.7% [libx264 @ 0xaaaabe01a480] i16 v,h,dc,p: 17% 45% 26% 12% [libx264 @ 0xaaaabe01a480] i8c dc,h,v,p: 64% 23% 10% 3% [libx264 @ 0xaaaabe01a480] kb/s:2885.27 Conversion failed! OK, if it's ffmpeg question, any other way to convert RTSP to HTTP stream, with other tools and Emby? Link to comment Share on other sites More sharing options...
Luke 37063 Posted May 3, 2020 Share Posted May 3, 2020 You should be able to import this into emby using our strm file feature: https://support.emby.media/support/solutions/articles/44001159147-strm-files From there, the server will make it available to play in your emby apps. Link to comment Share on other sites More sharing options...
ArtUrlWWW 0 Posted May 3, 2020 Author Share Posted May 3, 2020 Thank you for your reply. Too complex for hobby project of smart home. Solved with ffmpeg+nginx+videojs. Link to comment Share on other sites More sharing options...
Luke 37063 Posted May 3, 2020 Share Posted May 3, 2020 Ok, I think what I suggested would be just as easy, if not easier. A strm file is just a text file with the rtsp url inside. Link to comment Share on other sites More sharing options...
pir8radio 1292 Posted May 5, 2020 Share Posted May 5, 2020 sounds like he is just getting access to his IP security cameras........ or something.. cant you just use VLC to restream? However the strm file luke said above would work too... Link to comment Share on other sites More sharing options...
Solution pwhodges 1529 Posted May 6, 2020 Solution Share Posted May 6, 2020 I was delighted to see this thread, as I have tried and failed in the past to find a way to view the output of a webcam I use from outside the network. It turns out all I had to do was to put the URL that the dedicated viewer uses into a strm file and away it went! rtsp://192.168.1.9:554/user=admin_password=xxxxxxxx_channel=1_stream=0.sdp?real_stream I have shown that to encourage anyone who is put off trying it because their URL is not much like that which the Emby documentation suggests is required: This should look like:...rtsp://host/path/stream Paul 1 Link to comment Share on other sites More sharing options...
pwhodges 1529 Posted May 10, 2020 Share Posted May 10, 2020 PS - this appeared to fail when away from the local network (infinite rotating circle). But I'll continue this in the beta forum. Paul Link to comment Share on other sites More sharing options...
pir8radio 1292 Posted May 11, 2020 Share Posted May 11, 2020 PS - this appeared to fail when away from the local network (infinite rotating circle). But I'll continue this in the beta forum. Paul Some of these IP camera streams are "goofy" ive seen ffmpeg not be able to handle them. Might be a case where you need to share the transcode, or direct logs to see whats going on... Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now