4

Often discussed but so far never working on windows with the current versions of vlc or ffmpeg.

These are my stream's properties:

enter image description here

How to do it with vlc or ffmpeg?

I tried a lot. Way too much to list.

Aurelius Schnitzler
  • 511
  • 2
  • 8
  • 18

1 Answers1

10

I use this to convert a remote RTSP source to a local HLS streaming with ffmpeg and it works ok:

ffmpeg -i "rtsp://yourRtspStreamSource" -hls_time 3 -hls_wrap 10 "yourOutputDir/streaming.m3u8"

Also I use -t and -stimeout options to control the timeout of that proccess.

More info about HLS ffmpeg in docs: https://ffmpeg.org/ffmpeg-formats.html#hls-1

Hokusai
  • 2,219
  • 1
  • 21
  • 22
  • "rtsp://192.168.42.1/live: Invalid data found when processing input" – Aurelius Schnitzler Jan 24 '17 at 20:20
  • I have tested just now with a valid rtsp source and it works ok. Are `hls` available in your ffmpeg formats list? run this command `ffmpeg -formats` and see if you have muxing and demuxing support por `hls` format (Apple HTTP Live Streaming) – Hokusai Jan 24 '17 at 20:30
  • Did you try with another source?, "Invalid data found when processing input" seems problem is related with that source. – Hokusai Jan 25 '17 at 08:40
  • Test it with this source `rtsp://184.72.239.149/vod/mp4:BigBuckBunny_175k.mov` for example: `ffmpeg -i "rtsp://184.72.239.149/vod/mp4:BigBuckBunny_175k.mov" -hls_time 3 -hls_wrap 10 "C:\streaming.m3u8"` it should works. – Hokusai Jan 25 '17 at 17:01
  • "Could not write header for output file #0 (incorrect codec parameters ?): Permission denied" - Full: http://pastebin.com/i2hWi4nD – Aurelius Schnitzler Jan 25 '17 at 17:25
  • Permission denied on writting is a OS issue. Try running the ffmpeg command as administrator or use another target folder which ffmpeg has permission to write. C:\ surely is protected for writting permission. – Hokusai Jan 25 '17 at 17:40
  • You are right, now that works - kind of: http://pastebin.com/nMPCSqzM What is the http url for that? – Aurelius Schnitzler Jan 25 '17 at 17:43
  • What is the http url for that? – Aurelius Schnitzler Jan 30 '17 at 00:39
  • Put in your output part of your ffmpeg command a route to a public directory of your web server. For example, suppose your public directory of your web server is `C:\wamp\www\ ` your ffmpeg command could be: `ffmpeg -i "rtsp://184.72.239.149/vod/mp4:BigBuckBunny_175k.mov" -hls_time 3 -hls_wrap 10 "C:\wamp\www\streaming.m3u8" `then you could access your streaming by `http://127.0.0.1/streaming.m3u8` when accessing from your localhost, if you are accessing from another host change the ip to the public ip of you web server, if your server ip is 1.2.3.4, then `http://1.2.3.4/streaming.m3u8` – Hokusai Jan 30 '17 at 08:49
  • m3u8 cannot be read by manycam and using `ffmpeg -i "rtsp://184.72.239.149/vod/mp4:BigBuckBunny_175k.mov" "C:\wamp\www\streaming.mjpeg"` creates a file that gets bigger and bigger and manycam shows an endless time-lapsed loop of what the camera records. Any ideas? PS: I am using SimpleHTTPServer by python for serving the file. I heard, that manycam only accepts mjpeg. – Aurelius Schnitzler Jan 31 '17 at 00:53
  • Take a look to hls ffmpeg options in https://ffmpeg.org/ffmpeg-formats.html#Options-4 you can control the size of segments and the quantity using options `-hls_time` and `-hls_wrap` – Hokusai Jan 31 '17 at 09:02
  • Hi I want to shows the live stream on my webpage when should I implement the ffmpeg command and how do I implement that in my page? – utdev Jun 22 '17 at 10:10
  • @utdev implement it on your server side. You can use php (or another server side language) to invoke the execution of ffmpeg command when a user make a http request, for example when user loads your web page. – Hokusai Jun 22 '17 at 11:32
  • ok and how do I show the stream for example inside of a video object? – utdev Jun 22 '17 at 11:45
  • You can't do it directly in `video` object. Use a plugin or a js player. Here more info https://stackoverflow.com/questions/18434803/how-can-i-play-apple-hls-live-stream-using-html5-video-tag – Hokusai Jun 22 '17 at 12:17