I was just looking for something to do this, but couldn’t find much. I need to serve up about 1000 cameras to both hls (for public) and webrtc (for low latency/ptz admin use). Today we do it with paid packages, but I was exploring just using ffmpeg + nginx. Hls is easy enough, but since webrtc is not http, needs its own piece. Anyone have ideas on this? I’m familiar with Wowza and Ant. Any other open source utilities…
FFmpeg to WebRTC
31–40 of 50 posts
Re: FFmpeg to WebRTC
#32This is what I got for go run . -rtbufsize 100M -f dshow -i video="Integrated Webcam" -pix_fmt yuv420p -c:v libx264 -bsf:v h264_mp4toannexb -b:v 2M -max_delay 0 -bf 0 - Connection State has changed failed Peer Connection State has changed: failed Peer Connection has gone to failed exiting
Re: FFmpeg to WebRTC
#33Re: FFmpeg to WebRTC
#34[help request] I created a commercial product Video Hub App and have been trying for a year to get streaming a video from a PC to an iPhone working (through a PWA, not a dedicated iOS app) and have had 0 success. I could get the video stream to play on a separate laptop through Chrome, but iOS Safari kicks my ass. Does anyone have suggestions / ideas? https://github.com/whyboris/Video-Hub-App https://github.com/whybo…
Re: FFmpeg to WebRTC
#35* -fflags +genpts, +igndts, +ignidx
* -vsync
* -copyts
* -use_wallclock_as_timestamps 1
* And more that you find even when you thought you had seen all flags that might be related.
FFmpeg docs are a strange beast, they cover a lot of topics, but are extremely shallow in most of them, so the overall quality ends up being pretty poor. I mean it's like the kind of frowned upon code comments such as "ignidx ignores the index; genpts generates PTS". No surprises there... but no real explanation, either.
What I'd love is for a real, technical explanation of what are the consequences of each flag, and more importantly, the kind of scenarios where they would make a desirable difference.
Especially for the case of recording live video that comes from an unreliable connection (RTP through UDP) and storing it as-is (no transcoding whatsoever): what is the best, or recommended set of flags that FFmpeg authors would recommend? Given that packets can get lost, or timestamps can get garbled, UDP packets reordered in the network, or any combination of funny stuff.
For now I've sort of decided on using genpts+igndts and use_wallclock_as_timestamps, but all comes from intuition and simple tests, and not from actual evidence and guided by technical documentation of each flag.
Re: FFmpeg to WebRTC
#36* https://softwareengineering.stackexchange.com/questions/1471...
Re: FFmpeg to WebRTC
#37Note that there are a lot of tunings that you may need depending on what your latency tolerance and picture quality tolerance is. I would recommend following FFmpeg's streaming guide [0]. If you are trying to stream desktop, camera, and microphone to the browser, I would recommend pion's mediadevices package [1]. [0] - https://trac.ffmpeg.org/wiki/StreamingGuide [1] - https://github.com/pion/mediadevices
Thanks! I've been wanting to build a hackday project that takes images captured from our satellites and builds a video stream. (we gets hundreds of new shots from space every minute, for fun create a screensaver-like streaming video feed of interesting pictures) perhaps I can build it with either ffmpeg or pion (using pkg/driver/screen as a model to create a virtual canvas to draw on)
Re: FFmpeg to WebRTC
#38Earlier quoted context omitted.
Thanks! I've been wanting to build a hackday project that takes images captured from our satellites and builds a video stream. (we gets hundreds of new shots from space every minute, for fun create a screensaver-like streaming video feed of interesting pictures) perhaps I can build it with either ffmpeg or pion (using pkg/driver/screen as a model to create a virtual canvas to draw on)
What industry do you work in? Sounds interesting to have many satellite images streaming in!
Re: FFmpeg to WebRTC
#39I was just looking for something to do this, but couldn’t find much. I need to serve up about 1000 cameras to both hls (for public) and webrtc (for low latency/ptz admin use). Today we do it with paid packages, but I was exploring just using ffmpeg + nginx. Hls is easy enough, but since webrtc is not http, needs its own piece. Anyone have ideas on this? I’m familiar with Wowza and Ant. Any other open source utilities…
Would you mind sharing the paid packages you use?
Re: FFmpeg to WebRTC
#40My all time question about FFmpeg is what are all those timestamp correction flags and synchronization options for: * -fflags +genpts, +igndts, +ignidx * -vsync * -copyts * -use_wallclock_as_timestamps 1 * And more that you find even when you thought you had seen all flags that might be related. FFmpeg docs are a strange beast, they cover a lot of topics, but are extremely shallow in most of them, so the overall qual…
A universal translator framework cannot provide a bespoke translation engine for all possible permutations of source and target language. Instead it provides a common engine which is meant to be suitable enough for the most common traits shared across languages.
When converting any two languages at random, there will be quirks of the language or errors/ambiguity in the source prose which the engine cannot hope to all automatically recognize and accommodate, so there are all these options that do one specific thing and allow users to modify a step of the translation process. The docs cannot go in detail because the downstream ramifications of the option can vary based on the exact properties of the source-target pair and the transformations requested of ffmpeg. Instead the docs will describe the exact change directly triggered by the option.
----
As for the specific options,
* -fflags +genpts, +igndts, +ignidx
All of these apply to inputs only.
genpts: if input packets have missing presentation timestamps, this option will assign the decoding timestamp as PTS, if present.
igndts will unset dts if packet's pts is set.
ignidx is only applied to a few formats. These provide a keyframe index, which ffmpeg uses to populate its internal KF index for the stream. This option makes ffmpeg ignore the supplied index.
* -vsync
The option is misnamed. It's better called fpsmode. Most commonly used to drop or duplicate frames to achieve a constant framerate stream.
* -copyts
FFmpeg will, by default, remove any starting offset to input timestamps or adjust timestamps if they overflow (roll over) or have a large gap. copyts stops all that and relays input timestamps. Basically used if one wishes to manually examine and adjust timestamps using setpts filter or setts bitstream filter.
* -use_wallclock_as_timestamps 1
Discards input timestamps and assign system clock time at time of handling packet as its pts.