簡體   English   中英

在github上可視化git存儲庫

[英]Visualize git repository on github

我在github上有一個存儲庫,我想要一個生成可視化視頻的工具,如下所示:

Koha圖書館軟件歷史可視化

有沒有一步一步的教程在Windows中制作這樣的視頻?

gource維基有很好的信息,如何做到這一點。

文檔中沒有解釋的東西; 在標准的Windows GIT安裝中,默認情況下,git二進制文件的路徑不會添加到Windows PATH環境變量中。 相反,GIT在Windows上使用它自己的命令提示符。 因此,從Windows命令提示符運行gource將導致找不到git。

要從標准Windows命令提示符啟用git,您需要將其添加到PATH環境變量中。

從Windows命令提示符類型(其中C:\\ Program Files(x86)\\ Git \\ bin是計算機上git的路徑):

set path=%path%;C:\Program Files (x86)\Git\bin

如果有人只想要一個襯里復制粘貼,請使用它(需要ffmpeglibx264 ):

gource -1280x720 -o - | ffmpeg -y -r 60 -f image2pipe -vcodec ppm -i - -vcodec libx264 -preset ultrafast -crf 1 -threads 0 -bf 0 gource.mp4

要在Windows中生成實際視頻(使用Gource),請查看http://code.google.com/p/gource/wiki/Videos的Windows部分。 在Windows上的Gource的舊SO帖子上運行了一個相關的命令。 這里的說明: http ://nooshu.com/visualising-subversion-with-gource顯示如何為svn生成一個gource日志文件,然后gource可以回放。 git變體應該類似。 請注意,原始問題涉及Gource。

#!/bin/bash
# This is script of the generation video from "Gource".

# project: Screensaver Kodi Universe (http://berserk.tv)
# This script creates a ZIP archive of a Kodi screensaver.
# GNU GENERAL PUBLIC LICENSE. Version 2, June 1991
# 
OUT_DIR="output"
OUT="kodi-universe.mkv"
NAME_PROJ="screensaver.kodi.universe"
MEDIA_PATH="${NAME_PROJ}/resources/skins/default/media"
NAME_REP="https://github.com/berserktv/${NAME_PROJ}.git"

GSFILE="output.ppm"
SECONDS_PER_DAY="1"
GOURCE_FRAME_RATE="30"
RESOLUTION="-1920x1080"
CODEC_OUT_FRAME_RATE="25"

FFPARAM="-vcodec libx264 -profile:v high422 -pix_fmt yuv420p"
GSPARAM1="--camera-mode track ${RESOLUTION} --stop-position 1.0 --seconds-per-day ${SECONDS_PER_DAY}"
GSPARAM2="--git-branch origin/master --multi-sampling --stop-at-end --hide-filenames"
GSPARAM3="--highlight-users --file-idle-time 13 --max-files 0 --hide date"
GSPARAM4="--title Kodi --bloom-multiplier 1.0 --bloom-intensity 1.0"

VIS="visualize"
GIT_REP="https://github.com/xbmc/xbmc.git"
# arg1 - Git Project PATH
# example: ./create.sh "https://github.com/facebook/react.git"
if [ -n "$1" ]; then GIT_REP="$1"; fi

# INSTALL PACKAGE git zip ffmpeg gource
packages="git zip ffmpeg gource"
for i in $packages; do
  if ! dpkg -s $i | grep -q "install ok installed"; then sudo apt-get install -y $i; fi
done 

test -d ${OUT_DIR} || mkdir -p ${OUT_DIR}
cd ${OUT_DIR}
# download screensaver Kodi Universe и GIT for Visualization
if ! git clone ${NAME_REP} ${NAME_PROJ}; then echo "Error, not load ${NAME_REP}, exit ..."; exit 1; fi
if ! git clone ${GIT_REP} ${VIS};        then echo "Error, not load ${GIT_REP},  exit ..."; exit 2; fi


gource ${VIS} ${GSPARAM1} ${GSPARAM2} ${GSPARAM3} ${GSPARAM4} --output-framerate ${GOURCE_FRAME_RATE} --output-ppm-stream ${GSFILE}
ffmpeg -y -r ${GOURCE_FRAME_RATE} -f image2pipe -vcodec ppm -i ${GSFILE} ${FFPARAM} -r ${CODEC_OUT_FRAME_RATE} ${OUT} && sync
mv -f ${OUT} ${MEDIA_PATH}
rm -f ${GSFILE}
zip -r ${NAME_PROJ}.zip ${NAME_PROJ}

那個視頻是用Gource創建的。 它了解Git日志,並且有Windows版本。 此外,還有一篇關於用它創建視頻的Wiki文章

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM