国内从 Docker Hub 拉取镜像有时会遇到困难,此时可以配置镜像加速器。
Dockerized 实践 https://github.com/y0ngb1n/dockerized
国内从 Docker Hub 拉取镜像有时会遇到困难,此时可以配置镜像加速器。
Dockerized 实践 https://github.com/y0ngb1n/dockerized
| package demo; | |
| import static java.lang.reflect.Modifier.*; | |
| import java.util.Arrays; | |
| import java.util.Set; | |
| import org.springframework.beans.BeansException; | |
| import org.springframework.beans.factory.annotation.Value; | |
| import org.springframework.beans.factory.config.BeanExpressionResolver; |
| Terminal Commands: | |
| One webcam: | |
| ffmpeg -f alsa -ac 2 -i hw:1,0 -f v4l2 -s 1280x720 -r 10 -i /dev/video1 -vcodec libx264 -pix_fmt yuv420p -preset ultrafast -r 25 -g 20 -b:v 2500k -codec:a libmp3lame -ar 44100 -threads 6 -b:a 11025 -bufsize 512k -f flv rtmp://a.rtmp.youtube.com/live2/YOURSTREAMNAMEHERE | |
| Two webcam overlay: | |
| ffmpeg -f alsa -ac 2 -i hw:1,0 -f v4l2 -s 1280x720 -r 10 -i /dev/video1 -f v4l2 -s 320x240 -r 10 -i /dev/video0 -filter_complex "[1:v]setpts=PTS-STARTPTS[bg]; [2:v]setpts=PTS-STARTPTS[fg]; [bg][fg]overlay=shortest=1 [out]" -map "[out]" -map 0:a -vcodec libx264 -pix_fmt yuv420p -preset veryfast -r 25 -g 20 -b:v 2500k -codec:a libmp3lame -ar 44100 -threads 6 -b:a 11025 -bufsize 512k -f flv rtmp://a.rtmp.youtube.com/live2/YOURSTREAMNAMEHERE |
| 1. Convert our ".jks" file to ".p12" (PKCS12 key store format): | |
| keytool -importkeystore -srckeystore oldkeystore.jks -destkeystore newkeystore.p12 -deststoretype PKCS12 | |
| 1.1. List new keystore file contents: | |
| keytool -deststoretype PKCS12 -keystore newkeystore.p12 -list | |
| 2. Extract pem (certificate) from ".p12" keysotre file: | |
| import com.sun.jersey.spi.spring.container.servlet.SpringServlet; | |
| import com.sun.jersey.test.framework.AppDescriptor; | |
| import com.sun.jersey.test.framework.JerseyTest; | |
| import com.sun.jersey.test.framework.WebAppDescriptor; | |
| import org.junit.Test; | |
| import org.springframework.web.context.ContextLoaderListener; | |
| import org.springframework.web.context.request.RequestContextListener; | |
| import javax.ws.rs.core.MediaType; |
| public class ResourceOwnerAuthenticationProvider implements AuthenticationProvider { | |
| private String apiEndpoint; | |
| private String clientId; | |
| private String accessTokenUri; | |
| private String clientSecret; | |
| private List<String> scope; | |
| @Override |
| /* | |
| <dependency> | |
| <groupId>com.sun.jersey.jersey-test-framework</groupId> | |
| <artifactId>jersey-test-framework-grizzly2</artifactId> | |
| <version>${jersey.version}</version> | |
| <scope>test</scope> | |
| </dependency> | |
| */ | |
| package restful.server.resource; |