TE
科技回声
首页24小时热榜最新最佳问答展示工作
GitHubTwitter
首页

科技回声

基于 Next.js 构建的科技新闻平台,提供全球科技新闻和讨论内容。

GitHubTwitter

首页

首页最新最佳问答展示工作

资源链接

HackerNews API原版 HackerNewsNext.js

© 2025 科技回声. 版权所有。

FFmpeg to WebRTC

215 点作者 ashellunts超过 3 年前

19 条评论

ryanar超过 3 年前
Note 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&#x27;s streaming guide [0].<p>If you are trying to stream desktop, camera, and microphone to the browser, I would recommend pion&#x27;s mediadevices package [1].<p>[0] - <a href="https:&#x2F;&#x2F;trac.ffmpeg.org&#x2F;wiki&#x2F;StreamingGuide" rel="nofollow">https:&#x2F;&#x2F;trac.ffmpeg.org&#x2F;wiki&#x2F;StreamingGuide</a><p>[1] - <a href="https:&#x2F;&#x2F;github.com&#x2F;pion&#x2F;mediadevices" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;pion&#x2F;mediadevices</a>
评论 #28616268 未加载
j1elo超过 3 年前
My all time question about FFmpeg is what are all those timestamp correction flags and synchronization options for:<p>* -fflags +genpts, +igndts, +ignidx<p>* -vsync<p>* -copyts<p>* -use_wallclock_as_timestamps 1<p>* And more that you find even when you thought you had seen all flags that might be related.<p>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&#x27;s like the kind of frowned upon code comments such as &quot;ignidx ignores the index; genpts generates PTS&quot;. No surprises there... but no real explanation, either.<p>What I&#x27;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.<p>Especially for the case of recording live video that comes from an unreliable connection (RTP through UDP) <i>and storing it as-is (no transcoding whatsoever)</i>: 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.<p>For now I&#x27;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.
评论 #28625383 未加载
_Gyan_超过 3 年前
For `-f h264`, `-bsf:v h264_mp4toannexb` is not needed. It will be automatically inserted as needed, with ffmpeg 4.0 or later.<p>For latency, specify a short GOP size, e.g. `-g 50`
评论 #28615320 未加载
milankragujevic超过 3 年前
I personally use this project to proxy IP camera RTSP stream via Web Sockets as fragmented MP4 - <a href="https:&#x2F;&#x2F;github.com&#x2F;deepch&#x2F;RTSPtoWSMP4f" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;deepch&#x2F;RTSPtoWSMP4f</a><p>I&#x27;m not affiliated with the project, it&#x27;s just really performant and reliable.
评论 #28625993 未加载
whoisjohnkid超过 3 年前
Nice stuff; I did something similar with ffmpeg and pion.<p>It was for audio and it was webrtc to ffmpeg. I was streaming a group chat directly to s3.<p>It mostly worked, but the only problem I ran into was syncing issues if a user had a spotty connection. The solution seemed to involve using rtmp to synchronize but I didn’t have a chance to go down that rabbit hole.
nerdbaggy超过 3 年前
Hopefully WHIP takes off. It’s a standard protocol that would easily allow things to interface with WebRTC.<p><a href="https:&#x2F;&#x2F;www.meetecho.com&#x2F;blog&#x2F;whip-janus&#x2F;" rel="nofollow">https:&#x2F;&#x2F;www.meetecho.com&#x2F;blog&#x2F;whip-janus&#x2F;</a><p><a href="https:&#x2F;&#x2F;millicast.medium.com&#x2F;whip-the-magic-bullet-for-webrtc-media-ingest-57c2b98fb285" rel="nofollow">https:&#x2F;&#x2F;millicast.medium.com&#x2F;whip-the-magic-bullet-for-webrt...</a>
ChrisMarshallNY超过 3 年前
I did something similar for Mac, a while back[0]. I never really developed it much farther, because of the latency issues. Since it was for surveillance cameras, that was a showstopper.<p>[0] <a href="https:&#x2F;&#x2F;github.com&#x2F;RiftValleySoftware&#x2F;RVS_MediaServer" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;RiftValleySoftware&#x2F;RVS_MediaServer</a>
评论 #28615163 未加载
j1elo超过 3 年前
To the author: if you really want to be permissive about what others can do with your software, a MIT, BSD, or Apache 2 license (which is more complete in that it even includes a patent grant) seem to be more widely recognized and well tested than the Unlicense. Unless you did choose that license for some solid reasons, I&#x27;d suggest to consider switching to one of the other better regarded licences.<p>* <a href="https:&#x2F;&#x2F;softwareengineering.stackexchange.com&#x2F;questions&#x2F;147111&#x2F;what-is-wrong-with-the-unlicense" rel="nofollow">https:&#x2F;&#x2F;softwareengineering.stackexchange.com&#x2F;questions&#x2F;1471...</a><p>* <a href="https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=3610208" rel="nofollow">https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=3610208</a>
shireboy超过 3 年前
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&#x2F;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 that do rtsp to both hls&#x2F;webrtc?
评论 #28619675 未加载
wiradikusuma超过 3 年前
Since we&#x27;re on this topic, I want to ask a question:<p>How do I play video files stored in my VPS to Chromecast?<p>I want my mom to watch a video, from her TV, but I can&#x27;t upload it to YouTube due to copyrighted content (yes, even if you set unlisted, YouTube will block it).
评论 #28615787 未加载
评论 #28615883 未加载
评论 #28615700 未加载
yboris超过 3 年前
[help request]<p>I created a commercial product <i>Video Hub App</i> 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.<p>Does anyone have suggestions &#x2F; ideas?<p><a href="https:&#x2F;&#x2F;github.com&#x2F;whyboris&#x2F;Video-Hub-App" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;whyboris&#x2F;Video-Hub-App</a><p><a href="https:&#x2F;&#x2F;github.com&#x2F;whyboris&#x2F;Video-Hub-App-remote" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;whyboris&#x2F;Video-Hub-App-remote</a>
评论 #28616972 未加载
评论 #28621856 未加载
mg超过 3 年前
Since there are probably some people experienced with ffmpeg here, is it possible to to image zooms with ffmpg that go deeper then zoom factor 10?<p>I can zoom up to factor 10 like this:<p>ffmpeg -i someimage.jpg -vf &quot;zoompan=z=&#x27;10-on&#x2F;100&#x27;:d=1000:x=&#x27;iw&#x2F;2-(iw&#x2F;zoom&#x2F;2)&#x27;:y=&#x27;ih&#x2F;2-(ih&#x2F;zoom&#x2F;2)&#x27;:s=1920x1437&quot; zoom.mp4<p>But everything above a zoom of 10 seems to fail. Is there a hard limit in the code for some reason? Some way to overcome this?<p>Or is there another nice linux or online tool to do zooms into images?
评论 #28615998 未加载
Sean-Der超过 3 年前
Great work! This makes WebRTC much more accessible, it not being available in ffmpeg makes people default to worse alternatives.
评论 #28615980 未加载
est超过 3 年前
Offtopic, are there any streaming gateway to automatically insert CC subtitles into the video container on the fly?
vanillax超过 3 年前
As someone completely new to go, how do I run this? I have go installed but I cant seem to get any of the sample commands to work. I pulled the repo, cd&#x27;d into directory and ran the GO sample command that was provided in the source, but the terminal just hangs and blinks with no output.
smokenadmirrors超过 3 年前
This is what I got for<p>go run . -rtbufsize 100M -f dshow -i video=&quot;Integrated Webcam&quot; -pix_fmt yuv420p -c:v libx264 -bsf:v h264_mp4toannexb -b:v 2M -max_delay 0 -bf 0 - &lt; SDP<p>Connection State has changed failed<p>Peer Connection State has changed: failed<p>Peer Connection has gone to failed exiting
评论 #28620438 未加载
defied超过 3 年前
Would using gstreamer instead of ffmpeg offer better or worse performance? (Less CPU usage on the sender side?) If anyone has experience with this setup, I’d love to know.
baxuz超过 3 年前
Cool! I wish there was an easy way to consume browser streams in FFmpeg — the other way around.
评论 #28632221 未加载
at0mic22超过 3 年前
Sending one frame per message is quite expensive, I&#x27;d do some buffer aggregation instead