I have this exact same problem. I've been doing a lot of research into the issue. I think one problem is FCP is using the older Google client api. This is the user agent FCP sends to Google:
User-Agent: com.apple.qmaster.SwampTypes/4.2.1 google-api-objc-client/2.0 MacOSX/10.12 (gzip)
See:
https://github.com/google/google-api-objectivec-client/blob/b5dc047cbf6f95ced74c 765eb9038c5a053ee3ff/Source/Objects/GTLService.m#L285
https://github.com/google/google-api-objectivec-client/blob/b5dc047cbf6f95ced74c 765eb9038c5a053ee3ff/Source/Utilities/GTLFramework.m#L20
This says the library has been replaced: https://github.com/google/google-api-objectivec-client/blob/b5dc047cbf6f95ced74c 765eb9038c5a053ee3ff/Source/Utilities/GTLFramework.m#L20
By this: https://github.com/google/google-api-objectivec-client-for-rest
I decoded the HTTPS that FCP uses to upload the video to YouTube and I can see these transfers:
REQUEST
POST /upload/rpc?uploadType=resumable&prettyPrint=false HTTP/1.1
Host: www.googleapis.com
Accept: application/json-rpc
Authorization: Bearer ~~~~REDACTED~~~
X-Upload-Content-Length: 8609244742
Accept-Encoding: gzip, deflate
Cache-Control: no-cache
Accept-Language: en-us
Content-Type: application/json-rpc; charset=utf-8
Content-Length: 282
User-Agent: com.apple.qmaster.SwampTypes/4.2.1 google-api-objc-client/2.0 MacOSX/10.12 (gzip)
Connection: keep-alive
X-Upload-Content-Type: video/quicktime
{
"jsonrpc": "2.0",
"method": "youtube.videos.insert",
"id": "gtl_3",
"params": {
"part": "snippet,status",
"resource": {
"status": {
"privacyStatus": "unlisted"
},
"snippet": {
"tags": [
"10-4-16"
],
"title": "BHS vs FHS",
"categoryId": "17",
"description": "BHS vs FHS"
}
}
},
"apiVersion": "v3"
}
Response
HTTP/1.1 200 OK
X-GUploader-UploadID: ~~REDACTED~~
Location: https://www.googleapis.com/upload/rpc?uploadType=resumable&prettyPrint=false&upl oad_id=~~REDACTED~~~
ETag: "~~REDACTED~~"
Vary: Origin
Vary: X-Origin
X-Goog-Correlation-Id: QMfcesWzMYU
Cache-Control: no-cache, no-store, max-age=0, must-revalidate
Pragma: no-cache
Expires: Mon, 01 Jan 1990 00:00:00 GMT
Date: Fri, 07 Oct 2016 14:59:49 GMT
Content-Length: 0
Server: UploadServer
Content-Type: text/html; charset=UTF-8
Alt-Svc: quic=":443"; ma=2592000; v="36,35,34,33,32"
Connection: Keep-alive
This all looks good to me. After that FCP start batch uploading the video like this:
POST Request
PUT /upload/rpc?uploadType=resumable&prettyPrint=false&upload_id=~~REDACTED~~ HTTP/1.1
Host: www.googleapis.com
Content-Type: video/quicktime
Connection: keep-alive
Content-Range: bytes 0-26214399/8609244742
Accept: */*
User-Agent: com.apple.qmaster.SwampTypes/4.2.1 google-api-objc-client/2.0 MacOSX/10.12 (gzip)
Content-Length: 26214400
Accept-Language: en-us
Accept-Encoding: gzip, deflate
[BINARY BLOB]
RESPONSE
HTTP/1.1 308 Resume Incomplete
X-GUploader-UploadID: ~~REDACTED~~
Range: bytes=0-26214399
X-Range-MD5: c62639bde0e3c250e50e1fdf50bcc10a
Content-Length: 0
Date: Fri, 07 Oct 2016 15:00:10 GMT
Server: UploadServer
Content-Type: text/html; charset=UTF-8
Alt-Svc: quic=":443"; ma=2592000; v="36,35,34,33,32"
Connection: Keep-alive
This is good too. But after it did 10 batches I get this:
POST REQUEST
PUT /upload/rpc?uploadType=resumable&prettyPrint=false&upload_id=~~REDACTED~~ HTTP/1.1
Host: www.googleapis.com
Content-Type: video/quicktime
Connection: keep-alive
Content-Range: bytes 104857600-131071999/8609244742
Accept: */*
User-Agent: com.apple.qmaster.SwampTypes/4.2.1 google-api-objc-client/2.0 MacOSX/10.12 (gzip)
Content-Length: 26214400
Accept-Language: en-us
Accept-Encoding: gzip, deflate
[BINARY DATA]
But FCP stalls after only sending 22.31 MB (23,396,352 bytes) instead of the full 25.00 MB (26,214,400 bytes). Eventually the socket times out and I get a popup that says:

So this is clearly an issue with FCP. I made sure all the power setting were set to never sleep. I can manually upload the video through the browser and I never have a problem. I built a little upload tool and it also passes every time on same machine and using the exact same API FCP is. To make sure I used the exact same video that FCP failed with that was found in the .../cache/shared folder for FCP.
My recommendation to the FCP dev team is if you get an error you should retry the frame some number of times before giving up and throwing the error dialog. I actually expect the real problem is the byte range transmitter hung. But retry should recover from this condition.
I've had this problem for over a month on every video I've tried to upload. Sometimes it works on a second try after the video has already been encoded but only about 15% of the time. First upload try is failing 100% of the time.