top | item 30112595

Apple contributes to OBS to support screen capture using ScreenCaptureKit

722 points| frankjr | 4 years ago |github.com

188 comments

order
[+] pilif|4 years ago|reply
This commit in the PR

https://github.com/obsproject/obs-studio/pull/5875/commits/8...

provides an excellent example of why commit messages matter. This is more than 1000 lines diff to the build system (and thus potentially very dangerous because of possible supply chain attacks) which has the commit message of

"CI: Update build scripts and Github actions workflow"

Never say what you ware doing (it's obvious this commit is updating build scripts). Say why you are doing it, especially when your commit feels unrelated or at most very tangentially related to the objective of your PR.

[+] rkangel|4 years ago|reply
> Never say what you ware doing (it's obvious this commit is updating build scripts)

DEFINITELY say what you are doing. And then say why.

This blog post is a good description of the most prevalent convention in how to write good and useful messages (e.g. this is what the Linux Kernel does and given the history of git there's some flow down): https://cbea.ms/git-commit/

The key thing that means you should start with what is having a short one-line summary of what you're doing so you can look at a simple log and see which commit you're interested in.

[+] donatj|4 years ago|reply
We have a rule internally that a PR can’t be more than 1,000 loc. I personally find a 1,000 loc PR almost unreviewable. It takes me multiple days and a stack of notes, and still almost always ends up with effects I didn’t anticipate.

Trying to understand the changes and their full implications is nearly impossible. 100 loc is a better top end imho.

[+] rlt|4 years ago|reply
HN: big tech companies should contribute more to open source!

Also HN: no, not like that!

[+] ff133|4 years ago|reply
Question from a naive kiddo; When the PRs are this big, what are the steps taken to "get it in" the master ? Just blindly accept based on CD/CI jobs, or break it down to walk through every change ? "Ref: supply chain attacks"
[+] steerablesafe|4 years ago|reply
Just to chip in what should the commit message say: it should express the intent of the change and the reason of the change (latter could be reference to ticket). I don't think expressing how the intended change is achieved is important, that's what the diff is. If it's not clear in the diff how the intended change is achieved, try adding some comments.
[+] disintegrator|4 years ago|reply
I'm all for well presented PRs/commits but I'm not sure how a good commit message mitigates the risk of a supply chain attack in this case.
[+] Joeri|4 years ago|reply
Never say what you ware doing (it's obvious this commit is updating build scripts). Say why you are doing it

Don’t say what you were doing, say what the commit does. A good commit message completes the sentence “when merged this will …”.

Adding a more detailed description on the second line including why things were done is also not bad, but I have a strong opinion that design notes do not belong in the commit log but in code comments or markdown files that are in the repo, so that they can be found more easily and updated.

[+] emptybottle|4 years ago|reply
Yes, a good commit message should be a few concise paragraphs.

The subject describes what is being affected (think easily greppable keywords)

Then, then body should go into detail about the contents and rationale for the changes.

Use specific terms like “add” or “remove” and avoid subjective descriptions like “prepare” “clean” and “fix”

For example this patch says:

> Clean up consistency of tabs/spaces in include_directories.

Well, what does clean up tabs/spaces actually mean? Saying “remove tabs in favor of spaces” is much clearer.

[+] fnord77|4 years ago|reply
in the description of the PR, there's almost 1000 words of text describing in detail what is being done. I don't see the problem.
[+] i386|4 years ago|reply
Seems pretty fucking clear based on the message to me.
[+] ricardobeat|4 years ago|reply
Note that those commits seem to have been added by an OBS contributor on top of Apple's patch. The fact they touch the entire build system, in a PR that is 100% macOS focused, is much more concerning than the commit messages.
[+] yellow_lead|4 years ago|reply
It's a bit strange to open a pull request from "Developer-Ecosystem-Engineering" instead of an individual account. I wonder if every interaction from this account has to be approved by a board or something.
[+] onion2k|4 years ago|reply
Don't Apple have a policy that their developers aren't supposed to contribute to Open Source without explicit permission (https://news.ycombinator.com/item?id=22935263)? I imagine this is the result of that policy - if Apple wants to contribute to something as a business there isn't really anyone who would be able to use their individual account to do it without lots of people questioning why that person can when others can't.
[+] iSnow|4 years ago|reply
Could be related to the decision to remove individual names from the product about boxes back when Jobs came back to better control leaking of internal information and cut down on poaching. I would think that Apple does not want anyone to know who is working on the screen capture APIs as this PR would probably come from one member of that group

"When Steve came back, one of his company-wide edicts was that the names of individuals must be removed from about boxes."

https://bitsplitting.org/2014/01/24/cant-take-that-away/

[+] mr90210|4 years ago|reply
It's a valid point, however shall we at least celebrate a bit the fact that a Big Tech is actually contributing in the project?
[+] viraptor|4 years ago|reply
HP tried to do something similar when working with openstack. It was done for very bureaucratic reasons / company visibility. (Author was preserved, commit was by something like [email protected]) A slightly misguided idea by people who don't normally work with big open source. It was reverted since it messed with project statistics.
[+] helsinkiandrew|4 years ago|reply
From experience in a big company (not Apple) likely direct manager then senior manager then legal department. The justification and hoop jumping would take much more effort than the coding.

Well done to who ever it was.

[+] DangerousPie|4 years ago|reply
Well, given the amount of publicity this PR is getting it probably makes sense to not just let a random software engineer post whatever they feel like.
[+] SloopJon|4 years ago|reply
For those of you who have contributed to a Github (or similar) project in your capacity as an employee, do you use a work account separate from your own?
[+] olliej|4 years ago|reply
It’s very team dependent - look at llvm and webkit for instance.

It could also be that someone would rather not be out in public, which is also understandable.

[+] ripe|4 years ago|reply
For others like me who had no idea what "OBS" in the title refers to:

It's open-source software for video recording and live streaming.

https://obsproject.com/

[+] ru552|4 years ago|reply
It's actually some of the best software I've used for streaming. Also, the feature to record a browser tab is a life saver when I'm double booked and don't want to miss content from a meeting.
[+] oldiphone|4 years ago|reply
< The __MAC_10_15 define may not exist on devices running < 10.15, resulting in this section not being appropriately avoided during compilation. Swapping to 101500 should work for all versions of macOS.

So they are mindful of people with old Macs. This is good!

[+] Oddskar|4 years ago|reply
I find this PR an interesting opportunity to discuss different types of documentation.

I've internalized that there's a difference between the PR description, commit messages, and code comments. For me there's different intended audiences for all three, and their contents should thus be shaped accordingly. This PR basically combines all three into one and uses that as the commit message, and I'm not sure of what to make of it. Is this good practice?

Personally I find the contents of the "#### Summary of Changes" list to be super-neat and helpful. But should these not be more helpful as comments inside the code? On the other hand, it does explain what the code is doing at this snapshot in time: which makes it more precise than comments in the code -- since future changes might eventually make those comments incorrect.

What's your take?

[+] franga2000|4 years ago|reply
> On the other hand, it does explain what the code is doing at this snapshot in time: which makes it more precise than comments in the code -- since future changes might eventually make those comments incorrect.

If changes are made to the code, the comments should be updated accordingly. Getting from code to a PR text is a non-obvious and difficult process and when parts of the code are updated, the trail is easily lost.

[+] edgyquant|4 years ago|reply
Personally I like for the dev to do little commits that document each change to a file and then when the branch is merged in you do a squash merge and each commit msg becomes a bullet point.
[+] whazor|4 years ago|reply
Now I hope they improve the situation of virtual cameras. Now you need to code sign all kinds of applications in order for them to recognize your applications, which often breaks those applications.
[+] evanb|4 years ago|reply
I really want to use the virtual camera in FaceTime. But it's near-impossible to get it to work.
[+] Telemakhos|4 years ago|reply
I've still got an old iMac running High Sierra just so that can use virtual cameras. It used to work beautifully.
[+] veenified|4 years ago|reply
If anyone watches "Meet Kevin" youtube channel, you would know the bad publicity Apple gets with him attempting to stream on his relatively new Mac Pro system. Any effort to improve that capability would be in Apple's best interest. Streaming is not going away.
[+] avipars|4 years ago|reply
Nice to see them contribute to open source!
[+] jagger27|4 years ago|reply
I want to know if they’re using Rosetta on their M1 test machine or running it natively. Hopefully this patch leads to a proper darwin/arm64 release so I don’t have to use this weird fork[0] with a private GitHub Action to get a native build. The Rosetta version is considerably slower.

0: https://github.com/carlosonunez/obs-installer-for-apple-sili...

[+] lelandfe|4 years ago|reply
> I want to know if they’re using Rosetta on their M1 test machine or running it natively

Natively.

There's an open PR[0], #5155, to get OBS native on Apple Silicon. That's also what your weird fork uses.

Apple's PR is on top of that work: you'll see that there are 10 or so initial commits. Thus #5155 will need to be merged first, before Apple's.

#5155 is a huge PR and has been open for 5 months. Its release will also necessitate OBS get an M1 testing solution figured out. Here's a quote[2] from an OBS team member two days ago:

> [This PR is] top of our priority list once we release 27.2. We're keenly aware of how badly people want a native Apple Silicon build, and I can assure you that we will definitely be publishing official test builds of OBS with M1 support as soon as we are able.

I would nevertheless expect for all of this to take quite a while.

[0] https://github.com/obsproject/obs-studio/pull/5155

[1] https://github.com/obsproject/obs-studio/pull/5155#issuecomm...

[+] perryizgr8|4 years ago|reply
I wonder if this will provide a way to hide the yellow dot that appears in the corner (to indicate mic access). It is a great idea in most cases, but quite annoying to see on screen recordings.
[+] jscipione|4 years ago|reply
Does this mean I’ll finally be able to capture audio in OBS on macOS without third party tools like sound flower and blackhole?
[+] shantnutiwari|4 years ago|reply
Maybe OBS will work on my Mac now. I struggled to get it working, everything recording as I wanted. Thought it was just "crappy open source" stuff, so gave up.

Some time later, I tried OBS on Windows, and it just worked, first time, no fiddling required. And I realised the problem was on the Mac side, not Obs.

I know, its just one anecdote.

[+] programmarchy|4 years ago|reply
In the PR description, if you expand the sections "Baldur’s Gate 3 Demo", "Shadow of the Tomb Raider", etc. it shows the performance improvement of capturing the respective games. Looks like a very significant improvement.
[+] robbrown451|4 years ago|reply
Should this allow OBS to not capture the actual OBS window itself? I'd think it would be nice to eliminate that from what is captured, for those poor people who only have a single monitor. :)
[+] stoicjumbotron|4 years ago|reply
How does one go about reviewing such a PR? If the PR consists of smaller commits then it would probably be easier. But if a large commit is made, then what would be the flow to review it?