master
huanghai 5 years ago
parent be0c2a3460
commit 05cdbae1b8

80
.gitignore vendored

@ -1,39 +1,41 @@
/dsBaseRpc/.idea/
/dsBaseRpc/build/
/dsBaseRpc/WinBuild/
/dsBaseRpc/Logs/
/dsAutoCode/Logs/
/dsAutoCode/.idea/
/dsAutoCode/build/
/dsAutoCode/WinBuild/
/dsAutoCode/lastupdate.log
/dsBaseWeb/.idea/
/dsBaseWeb/build/
/dsBaseWeb/WinBuild/
/dsBaseWeb/Logs/
/dsBaseWeb/dsBaseRpc.log
/dsData/.idea/
/dsData/build/
/dsData/WinBuild/
/dsData/Logs/
/dsSso/.idea/
/dsSso/build/
/dsSso/WinBuild/
/dsSso/Logs/
/dsTools/.idea/
/dsTools/build/
/dsTools/WinBuild/
/dsWatch/.idea/
/dsWatch/build/
/dsWatch/WinBuild/
/dsBaseRpc/Java调用示例/JavaGRpc/target/
/dsWatch/Logs/
/dsAutoCode/.idea/
/dsBaseRpc/.idea/
/dsBaseRpc/build/
/dsBaseRpc/WinBuild/
/dsBaseRpc/Logs/
/dsAutoCode/Logs/
/dsAutoCode/.idea/
/dsAutoCode/build/
/dsAutoCode/WinBuild/
/dsAutoCode/lastupdate.log
/dsBaseWeb/.idea/
/dsBaseWeb/build/
/dsBaseWeb/WinBuild/
/dsBaseWeb/Logs/
/dsBaseWeb/dsBaseRpc.log
/dsData/.idea/
/dsData/build/
/dsData/WinBuild/
/dsData/Logs/
/dsSso/.idea/
/dsSso/build/
/dsSso/WinBuild/
/dsSso/Logs/
/dsTools/.idea/
/dsTools/build/
/dsTools/WinBuild/
/dsWatch/.idea/
/dsWatch/build/
/dsWatch/WinBuild/
/dsBaseRpc/Java调用示例/JavaGRpc/target/
/dsWatch/Logs/
/dsAutoCode/.idea/
/dsSupport/Source/
/dsSupport/Target/

@ -0,0 +1,8 @@
# Default ignored files
/shelf/
/workspace.xml
# Datasource local storage ignored files
/dataSources/
/dataSources.local.xml
# Editor-based HTTP Client requests
/httpRequests/

@ -0,0 +1,9 @@
<?xml version="1.0" encoding="UTF-8"?>
<module type="WEB_MODULE" version="4">
<component name="Go" enabled="true" />
<component name="NewModuleRootManager">
<content url="file://$MODULE_DIR$" />
<orderEntry type="inheritedJdk" />
<orderEntry type="sourceFolder" forTests="false" />
</component>
</module>

@ -0,0 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="JavaScriptSettings">
<option name="languageLevel" value="ES6" />
</component>
</project>

@ -0,0 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ProjectModuleManager">
<modules>
<module fileurl="file://$PROJECT_DIR$/.idea/dsSupport.iml" filepath="$PROJECT_DIR$/.idea/dsSupport.iml" />
</modules>
</component>
</project>

@ -0,0 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="VcsDirectoryMappings">
<mapping directory="$PROJECT_DIR$/.." vcs="Git" />
</component>
</project>

@ -0,0 +1,35 @@
package main
import (
"fmt"
"os"
"os/exec"
"path/filepath"
"strings"
)
func main(){
dir, _ := os.Getwd()
//1、视频文件名称
movie:=dir+"/Source/1.wmv"
//2、输出的文件通配名称
target:=dir+`/Target/piece_%03d.wmv`
//3、对视频文件进行切片
cmdLine:=dir+`\ffmpeg\ffmpeg.exe -fflags +genpts -i `+movie+` -acodec copy -vcodec copy -f segment -segment_time 300 -reset_timestamps 1 -map 0:0 -map 0:1 `+target
cmd := exec.Command("cmd.exe", "/c", "start " + cmdLine)
err := cmd.Run()
fmt.Printf("%s, error:%v \n", cmdLine, err)
//4、切片完成后尝试进行转码
//获取当前目录下的文件或目录名(包含路径)
filepathNames,_ := filepath.Glob(filepath.Join(dir+`/Target`,"*"))
for i := range filepathNames {
cmdLine=dir+`\ffmpeg\ffmpeg.exe -i `+filepathNames[i]+` -c:v libx264 -strict -2 `+strings.Replace(filepathNames[i],".wmv",".mp4",-1)
cmd = exec.Command("cmd.exe", "/c", "start " + cmdLine)
err = cmd.Run()
fmt.Printf("%s, error:%v \n", cmdLine, err)
}
}

Binary file not shown.

Binary file not shown.
Loading…
Cancel
Save