Answer the question
In order to leave comments, you need to log in
How to create htp.Client if access-token exists?
golang.org/x/oauth2
There is a ClientID, ClientSecret and access token that I get by hand. We need to implement a function
buildOAuthHTTPClient(scope string) (*http.Client, error)
config := &oauth2.Config{
ClientID: cfg.Installed.ClientID,
ClientSecret: cfg.Installed.ClientSecret,
Scopes: []string{scope},
Endpoint: oauth2.Endpoint{
AuthURL: cfg.Installed.AuthURI,
TokenURL: cfg.Installed.TokenURI,
},
RedirectURL: redirectUri,
}
config.Client(oauth2.NoContext, token)
Answer the question
In order to leave comments, you need to log in
https://trac.ffmpeg.org/wiki/Encode/H.264#twopass
ffmpeg -y -i input -c:v libx264 -preset medium -b:v 555k -pass 1 -c:a libfdk_aac -b:a 128k -f mp4 /dev/null && \
ffmpeg -i input -c:v libx264 -preset medium -b:v 555k -pass 2 -c:a libfdk_aac -b:a 128k output.mp4
-pass 2
-f mp4
you need to specify if your input is badly recognized by ffmpeg
All fields are just strings that you can enter by hand if you know them.
config := &oauth2.Config{
ClientID: "YourClientID",
ClientSecret: "YourClientSecret",
Scopes: []string{scope},
Endpoint: oauth2.Endpoint{
AuthURL: "YourAuthURL",
TokenURL: "YourTokenURL",
},
RedirectURL: "YourredirectUri",
}
token:=oauth2.Token{
AccessToken: "Youraccess token"
TokenType "Bearer",
}
/*
или если у вас на руках не access token а authorization code
то можно попробовать
token:=config.Exchange(oauth2.NoContext, "authorization code")
*/
client, err:=config.Client(oauth2.NoContext, token)
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question