Merge branch 'redesign2018' of /media/sdb1/gitRepositories/judo into redesign2018
Conflicts: homepage/redesign2018/markdownExperiment/src/Makefiles/Makefile.vidstabTest
This commit is contained in:
@@ -62,6 +62,8 @@ $endif$
|
||||
$if(quotes)$
|
||||
<style>
|
||||
q { quotes: "“" "”" "‘" "’"; }
|
||||
.fontSizeXxSmall{font-size: xx-small;}
|
||||
.displayNone{display: none;}
|
||||
</style>
|
||||
$endif$
|
||||
$if(highlighting-css)$
|
||||
@@ -69,6 +71,9 @@ $if(highlighting-css)$
|
||||
$highlighting-css$
|
||||
</style>
|
||||
$endif$
|
||||
$for(css)$
|
||||
<link rel="stylesheet" href="/$css$">
|
||||
$endfor$
|
||||
$for(extraCss)$
|
||||
<link rel="stylesheet" href="$extraCss$">
|
||||
$endfor$
|
||||
|
||||
@@ -0,0 +1,183 @@
|
||||
# Makefile für die Verarbeitung der Wettkampfvideos
|
||||
#
|
||||
# devVersion für:
|
||||
# - Beschleunigung der ganzen Sache
|
||||
# - Reihenfolge der Filter
|
||||
# - Einbeziehen des Uploads
|
||||
# - zwei verschiedene Server
|
||||
# - der erste Pass kommt auf den Hauptserver, auch wenn er größer
|
||||
# ist; er wird aber auch wieder gelöscht, wenn die nächste
|
||||
# Videogalerie kommt
|
||||
# - der zweite Pass kommt auf den Medienserver (unter
|
||||
# Berücksichtigung der Limitationen wie Einzeldateigrößen)
|
||||
|
||||
|
||||
# Systemspezifische Anpassungen (gehören eigentlich in ein
|
||||
# Makefile.cfg, aber in jedem Wettkampordner eines anlegen, ist wieder
|
||||
# mühsam)
|
||||
FFMPEG = /c/proggis/media/editoren/ffmpeg-4.0.2-win64-static/bin/ffmpeg.exe
|
||||
#FFMPEG = ffmpeg
|
||||
GUETZLI = /d/projekte/tests/guetzli.git/bin/Release/guetzli.exe
|
||||
#GUETZLI = /home/marko/proggis/guetzli/bin/Release/guetzli
|
||||
|
||||
DEFAULT_FFMPEG = ffmpeg
|
||||
#DEFAULT_FFMPEG = /c/proggis/media/editoren/ffmpeg-4.0.2-win64-static/bin/ffmpeg.exe
|
||||
|
||||
GET_VIDEO_DURATION_JSON = /d/temp/cwsvJudo/homepage/redesign2018/markdownExperiment/src/galleryHelper/getVideoDurationJson.py
|
||||
|
||||
|
||||
# Für eine schnelle Komprimierung libvpx, sonst vp9
|
||||
DEFAULT_VID_CODEC_HEIGHT = 360
|
||||
DEFAULT_VID_CODEC_WIDTH = -2
|
||||
DEFAULT_VID_CODEC_BITRATE = 500k
|
||||
DEFAULT_VID_CODEC = libvpx-vp9
|
||||
|
||||
# Standardwerte auf die benutzen Variablen schreiben, falls diese noch
|
||||
# nicht (z.B. aus dem Terminal heraus oder über ein IncludeCfgFile)
|
||||
# gesetzt worden sind
|
||||
VID_CODEC_BITRATE := $(if $(VID_CODEC_BITRATE),$(VID_CODEC_BITRATE),$(DEFAULT_VID_CODEC_BITRATE))
|
||||
VID_CODEC_HEIGHT := $(if $(VID_CODEC_HEIGHT),$(VID_CODEC_HEIGHT),$(DEFAULT_VID_CODEC_HEIGHT))
|
||||
VID_CODEC_WIDTH := $(if $(VID_CODEC_WIDTH),$(VID_CODEC_WIDTH),$(DEFAULT_VID_CODEC_WIDTH))
|
||||
VID_CODEC := $(if $(VID_CODEC),$(VID_CODEC),$(DEFAULT_VID_CODEC))
|
||||
|
||||
defaultTargetSourceDirectories = $(sort $(dir $(wildcard ./videos/aufnahmen/*/)))
|
||||
VID_CODEC_DEADLINE := -deadline best
|
||||
#VID_CODEC_DEADLINE := -deadline realtime
|
||||
|
||||
targetSourceDirectories = $(sort $(dir $(wildcard ./videos/aufnahmen/*/)))
|
||||
|
||||
targetSourceDirectories := $(if $(targetSourceDirectories), $(targetSourceDirectories), $(defaultTargetSourceDirectories))
|
||||
sourceVideos = $(wildcard videos/.forCompressing/*.video)
|
||||
|
||||
vidstabLogs = $(addsuffix .trf, $(basename $(sourceVideos)))
|
||||
firstPassLogs = $(addsuffix .firstPassLog-0.log, $(basename $(sourceVideos)))
|
||||
webmVideos = $(addprefix videos/webm/, $(addsuffix .webm, $(basename $(notdir $(sourceVideos)))))
|
||||
jpegThumbs = $(addprefix videos/thumbnails/, $(addsuffix .jpg, $(basename $(notdir $(sourceVideos)))))
|
||||
|
||||
# das result= fehlt absichtlich
|
||||
ffmpegVideoFilterVidstabDetect = vidstabdetect=shakiness=10:accuracy=15
|
||||
# das input= fehlt absichtlich
|
||||
ffmpegVideoFilterVidstabTransform = vidstabtransform=optzoom=2:interpol=bicubic:smoothing=30
|
||||
|
||||
# Der deinterlaceFilter sollte immer der erste sein!
|
||||
ffmpegVideoFilterDeinterlace = yadif,
|
||||
# Der einzige Grund, den ich für Skalierung zuerst gefunden habe, ist,
|
||||
# dass beim Hochskalieren das Rasschen zunimmt. Mache ich aber nicht.
|
||||
ffmpegVideoScaleFilter = scale=$(VID_CODEC_WIDTH):$(VID_CODEC_HEIGHT):sws_flags=lanczos,
|
||||
# nlmeans soll klar besser sein, aber hqdn3d sehr viel schneller
|
||||
ffmpegVideoFilterDenoise = hqdn3d,
|
||||
#ffmpegVideoFilterDenoise = hqdn3d,
|
||||
# Aspect ratio ist eigentlich nur notwendig, wenn das
|
||||
# Pixelseitenverhältnis nicht 1:1 ist
|
||||
ffmpegVideoFilterUnsharp = unsharp=5:5:0.8:3:3:0.4
|
||||
ffmpegDisplayAspectRatio = 16:9
|
||||
#ffmpegDisplayAspectRatio = 9:16
|
||||
|
||||
|
||||
.SECONDARY: $(vidstabLogs) $(firstPassLogs)
|
||||
|
||||
.PHONY: all clean
|
||||
all: $(webmVideos) $(jpegThumbs)
|
||||
|
||||
clean:
|
||||
$(RM) \
|
||||
$(vidstabLogs) \
|
||||
$(firstPassLogs) \
|
||||
$(webmVideos) \
|
||||
$(jpegThumbs)
|
||||
|
||||
.PHONY: thumbnails
|
||||
thumbnails: $(jpegThumbs)
|
||||
|
||||
.PHONY: echo
|
||||
echo:
|
||||
@echo $(webmVideos)
|
||||
@echo $(firstPassLogs)
|
||||
@echo $(targetSourceDirectories)
|
||||
|
||||
|
||||
# Erzeugen der Targets
|
||||
.PHONY: targets
|
||||
targets:
|
||||
mkdir -p videos/.forCompressing
|
||||
for directory in $(targetSourceDirectories) ;\
|
||||
do for file in $${directory}/*.*;\
|
||||
do \
|
||||
checkSum=$$(sha512sum $${file});\
|
||||
ln -f $${file} videos/.forCompressing/$${checkSum%%\ *}.video;\
|
||||
done;\
|
||||
done;
|
||||
|
||||
# Die Stabilisierungsberechnung:
|
||||
# eventuell sollte hier die Skalierung vorgeschaltet werden...
|
||||
# @toDo: Ist es mit vorheriger Skalierung schneller, oder langsamer?
|
||||
# Denoise ist in der Stabilisation eigentlich unnötig, ebenso das unsharp
|
||||
# Die Skalierung sollte vieleicht vor der Stabilisierung stattfinden (und braucht nicht hochwertig zu sein?)
|
||||
videos/.forCompressing/%.trf: videos/.forCompressing/%.video
|
||||
$(FFMPEG) -i $^ \
|
||||
-filter:v $(ffmpegVideoFilterDeinterlace)$(ffmpegVideoScaleFilter)$(ffmpegVideoFilterVidstabDetect):result="$@" \
|
||||
-f null \
|
||||
-
|
||||
|
||||
videos/.forCompressing/%.firstPassLog-0.log: videos/.forCompressing/%.video videos/.forCompressing/%.trf
|
||||
# -b:v $(VID_CODEC_BITRATE) \
|
||||
# -filter:v $(ffmpegVideoFilterDeinterlace)$(ffmpegVideoFilterDenoise)$(ffmpegVideoFilterVidstabTransform):input="$(basename $<).trf",nlmeans=s=6:p=5:r=7,$(ffmpegVideoScaleFilter)unsharp=5:5:0.8:3:3:0.4 \
|
||||
# wir speichern mal schon den ersten pass, damit haben wir zwar eine
|
||||
# größere Dateigröße, aber können bereits etwas hochladen
|
||||
# /dev/null
|
||||
# First Pass
|
||||
$(FFMPEG) -i $< \
|
||||
-filter:v $(ffmpegVideoFilterDeinterlace)$(ffmpegVideoScaleFilter)$(ffmpegVideoFilterDenoise)$(ffmpegVideoFilterVidstabTransform):input="$(basename $<).trf",$(ffmpegVideoFilterUnsharp) \
|
||||
-codec:v $(VID_CODEC) \
|
||||
-pass 1 \
|
||||
-passlogfile "$(basename $<).firstPassLog" \
|
||||
-aspect $(ffmpegDisplayAspectRatio) \
|
||||
-threads 1 \
|
||||
-speed 4 \
|
||||
-tile-columns 0 \
|
||||
-frame-parallel 0 \
|
||||
-g 9999 \
|
||||
-aq-mode 0 \
|
||||
-an \
|
||||
-f webm \
|
||||
-y \
|
||||
"$(basename $<).webm"
|
||||
|
||||
# target und dependencies müssen noch angepasst werden
|
||||
# Die erste Abhängigkeit muss das quellVideo sein!
|
||||
videos/webm/%.webm: videos/.forCompressing/%.video videos/.forCompressing/%.trf videos/.forCompressing/%.firstPassLog-0.log
|
||||
mkdir -p videos/webm
|
||||
$(GET_VIDEO_DURATION_JSON) $<
|
||||
# -b:v $(VID_CODEC_BITRATE) \
|
||||
# Second Pass
|
||||
$(FFMPEG) -i $< \
|
||||
-filter:v $(ffmpegVideoFilterDeinterlace)$(ffmpegVideoScaleFilter)$(ffmpegVideoFilterDenoise)$(ffmpegVideoFilterVidstabTransform):input="$(basename $<).trf",$(ffmpegVideoScaleFilter)unsharp=5:5:0.8:3:3:0.4 \
|
||||
-codec:v $(VID_CODEC) \
|
||||
-pass 2 \
|
||||
-passlogfile "$(basename $<).firstPassLog" \
|
||||
$(VID_CODEC_DEADLINE) \
|
||||
-b:v $(shell $(GET_VIDEO_DURATION_JSON) $<)k \
|
||||
-aspect $(ffmpegDisplayAspectRatio)\
|
||||
-threads 1 \
|
||||
-speed 0 \
|
||||
-tile-columns 0 \
|
||||
-frame-parallel 0 \
|
||||
-auto-alt-ref 1 \
|
||||
-lag-in-frames 25 \
|
||||
-g 9999 \
|
||||
-aq-mode 0 \
|
||||
-an \
|
||||
-f webm \
|
||||
$@
|
||||
|
||||
#videos/thumbnails/%.png: videos/.forCompressing/%.video
|
||||
videos/thumbnails/%.png: videos/webm/%.webm
|
||||
mkdir -p videos/thumbnails
|
||||
# $(FFMPEG) -i "$<" -vf "select=gt(scene\,0.4)" -frames:v 5 -vsync vfr -vf $(ffmpegVideoScaleFilter)fps=fps=1/600 "$@"
|
||||
# $(FFMPEG) -i "$<" -vf $(ffmpegVideoScaleFilter)thumbnail -frames:v 1 "$@"
|
||||
# $(FFMPEG) -i "$<" -filter:v $(ffmpegVideoFilterDeinterlace)$(ffmpegVideoFilterDenoise)$(ffmpegVideoFilterVidstabTransform):input="$(basename $<).trf",$(ffmpegVideoScaleFilter)unsharp=5:5:0.8:3:3:0.4,thumbnail -frames:v 1 "$@"
|
||||
$(FFMPEG) -i "$<" -aspect $(ffmpegDisplayAspectRatio) -filter:v $(ffmpegVideoFilterDeinterlace)$(ffmpegVideoScaleFilter)thumbnail -frames:v 1 "$@"
|
||||
|
||||
videos/thumbnails/%.jpg: videos/thumbnails/%.png
|
||||
$(GUETZLI) --quality 90 "$<" "$@"
|
||||
# convert "$<" "$@"
|
||||
@@ -257,16 +257,16 @@ videos/webm/%.webm: videos/aufnahmen/elly/%.mp4
|
||||
-an \
|
||||
-f webm \
|
||||
"$@"
|
||||
curl \
|
||||
--upload-file "$@" \
|
||||
--user cwsvjudo:Dee4oquu \
|
||||
"ftp://cwsvjudo.square7.net/videoalben/videoalben.2018/$(VID_GAL_DIR)/$(patsubst videos/%,%,$@)" \
|
||||
--ftp-create-dirs
|
||||
curl \
|
||||
--upload-file "$@" \
|
||||
--user cwsvjudo:***REMOVED*** \
|
||||
"ftp://cwsvjudo.bplaced.net/www/videoalben/videoalben.2018/$(VID_GAL_DIR)/$(patsubst videos/%,%,$@)" \
|
||||
--ftp-create-dirs
|
||||
# curl \
|
||||
# --upload-file "$@" \
|
||||
# --user cwsvjudo:Dee4oquu \
|
||||
# "ftp://cwsvjudo.square7.net/videoalben/videoalben.2018/$(VID_GAL_DIR)/$(patsubst videos/%,%,$@)" \
|
||||
# --ftp-create-dirs
|
||||
# curl \
|
||||
# --upload-file "$@" \
|
||||
# --user cwsvjudo:***REMOVED*** \
|
||||
# "ftp://cwsvjudo.bplaced.net/www/videoalben/videoalben.2018/$(VID_GAL_DIR)/$(patsubst videos/%,%,$@)" \
|
||||
# --ftp-create-dirs
|
||||
|
||||
videos/thumbnails/%.jpg: videos/webm/%.webm
|
||||
mkdir -p videos/thumbnails
|
||||
|
||||
@@ -1,11 +1,14 @@
|
||||
#FFMPEG = /c/proggis/media/editoren/ffmpeg-4.0.2-win64-static/bin/ffmpeg.exe
|
||||
FFMPEG = ~/proggis/ffmpeg/ffmpeg-4.1.1-amd64-static/ffmpeg
|
||||
#FFMPEG = ~/proggis/ffmpeg/ffmpeg-4.1.1-amd64-static/ffmpeg
|
||||
#GUETZLI = /d/projekte/tests/guetzli.git/bin/Release/guetzli.exe
|
||||
GUETZLI = /home/marko/proggis/guetzli/bin/Release/guetzli
|
||||
|
||||
DEFAULT_FFMPEG = ffmpeg
|
||||
#DEFAULT_FFMPEG = /c/proggis/media/editoren/ffmpeg-4.0.2-win64-static/bin/ffmpeg.exe
|
||||
|
||||
GET_VIDEO_DURATION_JSON = /d/temp/cwsvJudo/homepage/redesign2018/markdownExperiment/src/galleryHelper/getVideoDurationJson.py
|
||||
|
||||
|
||||
# Für eine schnelle Komprimierung libvpx, sonst vp9
|
||||
DEFAULT_VID_CODEC_HEIGHT = 360
|
||||
DEFAULT_VID_CODEC_WIDTH = -2
|
||||
@@ -88,6 +91,7 @@ targets:
|
||||
|
||||
# Die Stabilisierungsberechnung:
|
||||
# eventuell sollte hier die Skalierung vorgeschaltet werden...
|
||||
# @toDo: Ist es mit vorheriger Skalierung schneller, oder langsamer?
|
||||
videos/.forCompressing/%.trf: videos/.forCompressing/%.video
|
||||
$(FFMPEG) -i $^ \
|
||||
-filter:v $(ffmpegVideoFilterDeinterlace)$(ffmpegVideoFilterDenoise)$(ffmpegVideoFilterVidstabDetect):result="$@" \
|
||||
@@ -120,7 +124,7 @@ videos/.forCompressing/%.firstPassLog-0.log: videos/.forCompressing/%.video vide
|
||||
# Die erste Abhängigkeit muss das quellVideo sein!
|
||||
videos/webm/%.webm: videos/.forCompressing/%.video videos/.forCompressing/%.trf videos/.forCompressing/%.firstPassLog-0.log
|
||||
mkdir -p videos/webm
|
||||
~/keeper/judo/homepage/redesign2018/markdownExperiment/src/galleryHelper/getVideoDurationJson.py $<
|
||||
$(GET_VIDEO_DURATION_JSON) $<
|
||||
# -b:v $(VID_CODEC_BITRATE) \
|
||||
# Second Pass
|
||||
$(FFMPEG) -i $< \
|
||||
@@ -129,8 +133,8 @@ videos/webm/%.webm: videos/.forCompressing/%.video videos/.forCompressing/%.trf
|
||||
-pass 2 \
|
||||
-passlogfile "$(basename $<).firstPassLog" \
|
||||
$(VID_CODEC_DEADLINE) \
|
||||
-b:v $(shell ~/keeper/judo/homepage/redesign2018/markdownExperiment/src/galleryHelper/getVideoDurationJson.py $<)k \
|
||||
-aspect 16:9 \
|
||||
-b:v $(shell $(GET_VIDEO_DURATION_JSON) $<)k \
|
||||
-aspect $(ffmpegDisplayAspectRatio)\
|
||||
-threads 1 \
|
||||
-speed 0 \
|
||||
-tile-columns 0 \
|
||||
@@ -148,7 +152,7 @@ videos/thumbnails/%.png: videos/.forCompressing/%.video
|
||||
# $(FFMPEG) -i "$<" -vf "select=gt(scene\,0.4)" -frames:v 5 -vsync vfr -vf $(ffmpegVideoScaleFilter)fps=fps=1/600 "$@"
|
||||
# $(FFMPEG) -i "$<" -vf $(ffmpegVideoScaleFilter)thumbnail -frames:v 1 "$@"
|
||||
# $(FFMPEG) -i "$<" -filter:v $(ffmpegVideoFilterDeinterlace)$(ffmpegVideoFilterDenoise)$(ffmpegVideoFilterVidstabTransform):input="$(basename $<).trf",$(ffmpegVideoScaleFilter)unsharp=5:5:0.8:3:3:0.4,thumbnail -frames:v 1 "$@"
|
||||
$(FFMPEG) -i "$<" -filter:v $(ffmpegVideoFilterDeinterlace)$(ffmpegVideoScaleFilter)thumbnail -frames:v 1 "$@"
|
||||
$(FFMPEG) -i "$<" -aspect $(ffmpegDisplayAspectRatio) -filter:v $(ffmpegVideoFilterDeinterlace)$(ffmpegVideoScaleFilter)thumbnail -frames:v 1 "$@"
|
||||
|
||||
videos/thumbnails/%.jpg: videos/thumbnails/%.png
|
||||
$(GUETZLI) --quality 90 "$<" "$@"
|
||||
|
||||
@@ -0,0 +1,158 @@
|
||||
FFMPEG = /c/proggis/media/editoren/ffmpeg-4.0.2-win64-static/bin/ffmpeg.exe
|
||||
#FFMPEG = ffmpeg
|
||||
GUETZLI = /d/projekte/tests/guetzli.git/bin/Release/guetzli.exe
|
||||
#GUETZLI = /home/marko/proggis/guetzli/bin/Release/guetzli
|
||||
|
||||
DEFAULT_FFMPEG = ffmpeg
|
||||
DEFAULT_GUETZLI = guetzli
|
||||
|
||||
GET_VIDEO_DURATION_JSON = /d/temp/cwsvJudo/homepage/redesign2018/markdownExperiment/src/galleryHelper/getVideoDurationJson.py
|
||||
|
||||
# Für eine schnelle Komprimierung libvpx, sonst vp9
|
||||
DEFAULT_VID_CODEC_HEIGHT = 360
|
||||
DEFAULT_VID_CODEC_WIDTH = -2
|
||||
DEFAULT_VID_CODEC_BITRATE = 500k
|
||||
DEFAULT_VID_CODEC = libvpx-vp9
|
||||
|
||||
# Standardwerte auf die benutzen Variablen schreiben, falls diese noch
|
||||
# nicht (z.B. aus dem Terminal heraus oder über ein IncludeCfgFile)
|
||||
# gesetzt worden sind
|
||||
VID_CODEC_BITRATE := $(if $(VID_CODEC_BITRATE),$(VID_CODEC_BITRATE),$(DEFAULT_VID_CODEC_BITRATE))
|
||||
VID_CODEC_HEIGHT := $(if $(VID_CODEC_HEIGHT),$(VID_CODEC_HEIGHT),$(DEFAULT_VID_CODEC_HEIGHT))
|
||||
VID_CODEC_WIDTH := $(if $(VID_CODEC_WIDTH),$(VID_CODEC_WIDTH),$(DEFAULT_VID_CODEC_WIDTH))
|
||||
VID_CODEC := $(if $(VID_CODEC),$(VID_CODEC),$(DEFAULT_VID_CODEC))
|
||||
|
||||
defaultTargetSourceDirectories = $(sort $(dir $(wildcard ./videos/aufnahmen/*/)))
|
||||
VID_CODEC_DEADLINE := -deadline good
|
||||
#VID_CODEC_DEADLINE := -deadline best
|
||||
#VID_CODEC_DEADLINE := -deadline good
|
||||
#VID_CODEC_DEADLINE := -deadline realtime
|
||||
|
||||
targetSourceDirectories = $(sort $(dir $(wildcard ./videos/aufnahmen/*/)))
|
||||
|
||||
targetSourceDirectories := $(if $(targetSourceDirectories), $(targetSourceDirectories), $(defaultTargetSourceDirectories))
|
||||
sourceVideos = $(wildcard videos/.forCompressing/*.video)
|
||||
|
||||
vidstabLogs = $(addsuffix .trf, $(basename $(sourceVideos)))
|
||||
firstPassLogs = $(addsuffix .firstPassLog-0.log, $(basename $(sourceVideos)))
|
||||
webmVideos = $(addprefix videos/webm/, $(addsuffix .webm, $(basename $(notdir $(sourceVideos)))))
|
||||
jpegThumbs = $(addprefix videos/thumbnails/, $(addsuffix .jpg, $(basename $(notdir $(sourceVideos)))))
|
||||
|
||||
# das result= fehlt absichtlich
|
||||
ffmpegVideoFilterVidstabDetect = vidstabdetect=shakiness=10:accuracy=15
|
||||
# das input= fehlt absichtlich
|
||||
ffmpegVideoFilterVidstabTransform = vidstabtransform=optzoom=2:interpol=bicubic:smoothing=30
|
||||
|
||||
ffmpegVideoScaleFilter = scale=$(VID_CODEC_WIDTH):$(VID_CODEC_HEIGHT):sws_flags=lanczos,
|
||||
ffmpegVideoFilterDeinterlace = yadif,
|
||||
ffmpegVideoFilterDenoise = nlmeans,
|
||||
#ffmpegVideoFilterDenoise = hqdn3d,
|
||||
ffmpegDisplayAspectRatio = 16:9
|
||||
#ffmpegDisplayAspectRatio = 9:16
|
||||
ffmpegVideoFilterUnsharp = unsharp=5:5:0.8:3:3:0.4
|
||||
|
||||
.SECONDARY: $(vidstabLogs) $(firstPassLogs)
|
||||
|
||||
.PHONY: all clean
|
||||
all: $(webmVideos) $(jpegThumbs)
|
||||
|
||||
clean:
|
||||
$(RM) \
|
||||
$(vidstabLogs) \
|
||||
$(firstPassLogs) \
|
||||
$(webmVideos) \
|
||||
$(jpegThumbs)
|
||||
|
||||
.PHONY: thumbnails
|
||||
thumbnails: $(jpegThumbs)
|
||||
|
||||
.PHONY: echo
|
||||
echo:
|
||||
@echo $(webmVideos)
|
||||
@echo $(firstPassLogs)
|
||||
@echo $(targetSourceDirectories)
|
||||
|
||||
|
||||
# Erzeugen der Targets
|
||||
.PHONY: targets
|
||||
targets:
|
||||
mkdir -p videos/.forCompressing
|
||||
for directory in $(targetSourceDirectories) ;\
|
||||
do for file in $${directory}/*.*;\
|
||||
do \
|
||||
checkSum=$$(sha512sum $${file});\
|
||||
ln -f $${file} videos/.forCompressing/$${checkSum%%\ *}.video;\
|
||||
done;\
|
||||
done;
|
||||
|
||||
# Die Stabilisierungsberechnung:
|
||||
# eventuell sollte hier die Skalierung vorgeschaltet werden...
|
||||
# @toDo: Ist es mit vorheriger Skalierung schneller, oder langsamer?
|
||||
# Denoise ist in der Stabilisation eigentlich unnötig, ebenso das unsharp
|
||||
# Die Skalierung sollte vieleicht vor der Stabilisierung stattfinden (und braucht nicht hochwertig zu sein?)
|
||||
videos/.forCompressing/%.trf: videos/.forCompressing/%.video
|
||||
$(FFMPEG) -i $^ \
|
||||
-filter:v $(ffmpegVideoFilterDeinterlace)$(ffmpegVideoFilterVidstabDetect):result="$@" \
|
||||
-f null \
|
||||
-
|
||||
|
||||
videos/.forCompressing/%.firstPassLog-0.log: videos/.forCompressing/%.video videos/.forCompressing/%.trf
|
||||
# wir speichern mal schon den ersten pass, damit haben wir zwar eine
|
||||
# größere Dateigröße, aber können bereits etwas hochladen
|
||||
# "$(basename $<).webm"
|
||||
# First Pass
|
||||
$(FFMPEG) -i $< \
|
||||
-filter:v $(ffmpegVideoFilterDeinterlace)$(ffmpegVideoFilterDenoise)$(ffmpegVideoFilterVidstabTransform):input="$(basename $<).trf",$(ffmpegVideoScaleFilter)unsharp=5:5:0.8:3:3:0.4 \
|
||||
-codec:v $(VID_CODEC) \
|
||||
$(VID_CODEC_DEADLINE) \
|
||||
-pass 1 \
|
||||
-b:v $(shell $(GET_VIDEO_DURATION_JSON) $<)k \
|
||||
-passlogfile "$(basename $<).firstPassLog" \
|
||||
-aspect $(ffmpegDisplayAspectRatio) \
|
||||
-threads 1 \
|
||||
-speed 4 \
|
||||
-tile-columns 0 \
|
||||
-frame-parallel 0 \
|
||||
-g 9999 \
|
||||
-aq-mode 0 \
|
||||
-an \
|
||||
-f webm \
|
||||
-y \
|
||||
/dev/null
|
||||
|
||||
# Second Pass
|
||||
# target und dependencies müssen noch angepasst werden
|
||||
# Die erste Abhängigkeit muss das quellVideo sein!
|
||||
videos/webm/%.webm: videos/.forCompressing/%.video videos/.forCompressing/%.trf videos/.forCompressing/%.firstPassLog-0.log
|
||||
mkdir -p videos/webm
|
||||
$(FFMPEG) -i $< \
|
||||
-filter:v $(ffmpegVideoFilterDeinterlace)$(ffmpegVideoFilterDenoise)$(ffmpegVideoFilterVidstabTransform):input="$(basename $<).trf",$(ffmpegVideoScaleFilter)unsharp=5:5:0.8:3:3:0.4 \
|
||||
-codec:v $(VID_CODEC) \
|
||||
-pass 2 \
|
||||
-passlogfile "$(basename $<).firstPassLog" \
|
||||
$(VID_CODEC_DEADLINE) \
|
||||
-b:v $(shell $(GET_VIDEO_DURATION_JSON) $<)k \
|
||||
-aspect $(ffmpegDisplayAspectRatio)\
|
||||
-threads 1 \
|
||||
-speed 0 \
|
||||
-tile-columns 0 \
|
||||
-frame-parallel 0 \
|
||||
-auto-alt-ref 1 \
|
||||
-lag-in-frames 25 \
|
||||
-g 9999 \
|
||||
-aq-mode 0 \
|
||||
-an \
|
||||
-f webm \
|
||||
$@
|
||||
|
||||
videos/thumbnails/%.png: videos/.forCompressing/%.video
|
||||
#videos/thumbnails/%.png: videos/webm/%.webm
|
||||
mkdir -p videos/thumbnails
|
||||
# $(FFMPEG) -i "$<" -vf "select=gt(scene\,0.4)" -frames:v 5 -vsync vfr -vf $(ffmpegVideoScaleFilter)fps=fps=1/600 "$@"
|
||||
# $(FFMPEG) -i "$<" -vf $(ffmpegVideoScaleFilter)thumbnail -frames:v 1 "$@"
|
||||
# $(FFMPEG) -i "$<" -filter:v $(ffmpegVideoFilterDeinterlace)$(ffmpegVideoFilterDenoise)$(ffmpegVideoFilterVidstabTransform):input="$(basename $<).trf",$(ffmpegVideoScaleFilter)unsharp=5:5:0.8:3:3:0.4,thumbnail -frames:v 1 "$@"
|
||||
$(FFMPEG) -i "$<" -aspect $(ffmpegDisplayAspectRatio) -filter:v $(ffmpegVideoFilterDeinterlace)$(ffmpegVideoScaleFilter)thumbnail -frames:v 1 "$@"
|
||||
|
||||
videos/thumbnails/%.jpg: videos/thumbnails/%.png
|
||||
$(GUETZLI) --quality 90 "$<" "$@"
|
||||
# convert "$<" "$@"
|
||||
@@ -0,0 +1,9 @@
|
||||
include Makefile.cfg
|
||||
|
||||
recTestVar = Hallo
|
||||
#export recTestVar
|
||||
|
||||
.PHONY: recTest
|
||||
recTest:
|
||||
echo ${recTestVar}
|
||||
make -e --file=Makefile.sub
|
||||
@@ -0,0 +1 @@
|
||||
recTestVar = Hallo
|
||||
@@ -0,0 +1,3 @@
|
||||
.PHONY: echo
|
||||
echo:
|
||||
echo ${recTestVar}
|
||||
@@ -0,0 +1,42 @@
|
||||
include ${makefileDir}/Makefile.vidGal.cfg
|
||||
|
||||
.PHONY: all clean
|
||||
all: $(webmVideos) $(jpegThumbs)
|
||||
|
||||
clean:
|
||||
$(RM) \
|
||||
$(vidstabLogs) \
|
||||
$(firstPassLogs) \
|
||||
$(webmVideos) \
|
||||
$(jpegThumbs)
|
||||
|
||||
.PHONY: thumbnails
|
||||
thumbnails: $(jpegThumbs)
|
||||
|
||||
videos/thumbnails/%.jpg: videos/.forCompressing/%.video
|
||||
make --include-dir=${makefileDir} --file=${makefileDir}/Makefile.webmCompress $@
|
||||
|
||||
.PHONY: echo
|
||||
echo:
|
||||
@echo $(webmVideos)
|
||||
@echo $(firstPassLogs)
|
||||
@echo $(targetSourceDirectories)
|
||||
|
||||
# Erzeugen der Targets
|
||||
# @todo das muss ich immer noch einzeln aufrufen ...
|
||||
.PHONY: targetSources
|
||||
targetSources:
|
||||
mkdir -p videos/.forCompressing
|
||||
for directory in $(targetSourceDirectories) ;\
|
||||
do for file in $${directory}/*.*;\
|
||||
do \
|
||||
checkSum=$$(sha512sum $${file});\
|
||||
ln -f $${file} videos/.forCompressing/$${checkSum%%\ *}.video;\
|
||||
done;\
|
||||
done;
|
||||
|
||||
# target und dependencies müssen noch angepasst werden
|
||||
# Die erste Abhängigkeit muss das quellVideo sein!
|
||||
videos/webm/%.webm: videos/.forCompressing/%.video
|
||||
make --include-dir=${makefileDir} --file=${makefileDir}/Makefile.webmCompress $@
|
||||
|
||||
@@ -0,0 +1,19 @@
|
||||
defaultTargetSourceDirectories = $(sort $(dir $(wildcard ./videos/aufnahmen/*/)))
|
||||
#targetSourceDirectories = $(sort $(dir $(wildcard ./videos/aufnahmen/*/)))
|
||||
|
||||
targetSourceDirectories := $(if $(targetSourceDirectories), $(targetSourceDirectories), $(defaultTargetSourceDirectories))
|
||||
|
||||
sourceVideos = $(wildcard videos/.forCompressing/*.video)
|
||||
|
||||
# Zwischentargets, für ein clean
|
||||
vidstabLogs = $(addsuffix .trf, $(basename $(sourceVideos)))
|
||||
firstPassLogs = $(addsuffix .firstPassLog-0.log, $(basename $(sourceVideos)))
|
||||
|
||||
webmVideos = $(addprefix videos/webm/, $(addsuffix .webm, $(basename $(notdir $(sourceVideos)))))
|
||||
jpegThumbs = $(addprefix videos/thumbnails/, $(addsuffix .jpg, $(basename $(notdir $(sourceVideos)))))
|
||||
|
||||
#makefileDir = /d/temp/cwsvJudo/homepage/redesign2018/markdownExperiment/src/Makefiles/Makefiles.vidGal.d
|
||||
makefileDir = ~/keeper/cwsvJudo/homepage/redesign2018/markdownExperiment/src/Makefiles/Makefiles.vidGal.d
|
||||
|
||||
FFMPEG = /home/marko/Downloads/ffmpeg-4.1.3-amd64-static/ffmpeg
|
||||
|
||||
@@ -0,0 +1,78 @@
|
||||
include Makefile.webmCompress.cfg
|
||||
|
||||
.SECONDARY: $(vidstabLogs) $(firstPassLogs)
|
||||
|
||||
.DEFAULT: info
|
||||
info:
|
||||
@echo Es muss ein Target übergeben werden!
|
||||
|
||||
# Die Stabilisierungsberechnung:
|
||||
# eventuell sollte hier die Skalierung vorgeschaltet werden...
|
||||
# @toDo: Ist es mit vorheriger Skalierung schneller, oder langsamer?
|
||||
videos/.forCompressing/%.trf: videos/.forCompressing/%.video
|
||||
$(FFMPEG) -i $^ \
|
||||
-filter:v $(ffmpegVideoFilterDeinterlace),$(ffmpegVideoScaleFilter),$(ffmpegVideoFilterVidstabDetect):result="$@" \
|
||||
-f null \
|
||||
-
|
||||
|
||||
# First Pass
|
||||
# @todo: irgendwo habe ich mal gelesen, dass man den ersten Pass auch
|
||||
# als ansehbares Video (mit höchster Qualittätseinstellung) speichern
|
||||
# kann. Wäre praktisch für eine leicht schnellere Verfügbarkeit.
|
||||
videos/.forCompressing/%.firstPassLog-0.log: videos/.forCompressing/%.video videos/.forCompressing/%.trf
|
||||
$(FFMPEG) -i $< \
|
||||
-filter:v $(ffmpegVideoFilterDeinterlace),$(ffmpegVideoScaleFilter),$(ffmpegVideoFilterDenoise),$(ffmpegVideoFilterVidstabTransform):input="$(basename $<).trf",$(ffmpegVideoFilterUnsharp),$(ffmpegVideoScaleFilter) \
|
||||
-codec:v $(VID_CODEC) \
|
||||
-pass 1 \
|
||||
-passlogfile "$(basename $<).firstPassLog" \
|
||||
-threads 1 \
|
||||
-speed 4 \
|
||||
-tile-columns 0 \
|
||||
-frame-parallel 0 \
|
||||
-g 9999 \
|
||||
-aq-mode 0 \
|
||||
-an \
|
||||
-f webm \
|
||||
-y \
|
||||
/dev/null
|
||||
|
||||
# Second Pass
|
||||
# - Die erste Abhängigkeit muss das quellVideo sein!
|
||||
videos/webm/%.webm: videos/.forCompressing/%.video videos/.forCompressing/%.trf videos/.forCompressing/%.firstPassLog-0.log
|
||||
mkdir -p videos/webm
|
||||
$(FFMPEG) -i $< \
|
||||
-filter:v $(ffmpegVideoFilterDeinterlace),$(ffmpegVideoScaleFilter),$(ffmpegVideoFilterDenoise),$(ffmpegVideoFilterVidstabTransform):input="$(basename $<).trf",$(ffmpegVideoFilterUnsharp) \
|
||||
-codec:v $(VID_CODEC) \
|
||||
-pass 2 \
|
||||
-passlogfile "$(basename $<).firstPassLog" \
|
||||
$(VID_CODEC_DEADLINE) \
|
||||
-b:v $(shell $(getTargetParameter) $< videoBitrate)k \
|
||||
-threads 1 \
|
||||
-speed 0 \
|
||||
-tile-columns 0 \
|
||||
-frame-parallel 0 \
|
||||
-auto-alt-ref 1 \
|
||||
-lag-in-frames 25 \
|
||||
-g 9999 \
|
||||
-aq-mode 0 \
|
||||
-an \
|
||||
-f webm \
|
||||
$@
|
||||
|
||||
videos/thumbnails/%.png: videos/.forCompressing/%.video
|
||||
mkdir -p videos/thumbnails
|
||||
# $(FFMPEG) -i "$<" -vf "select=gt(scene\,0.4)" -frames:v 5 -vsync vfr -vf $(ffmpegVideoScaleFilter)fps=fps=1/600 "$@"
|
||||
# $(FFMPEG) -i "$<" -vf $(ffmpegVideoScaleFilter)thumbnail -frames:v 1 "$@"
|
||||
# $(FFMPEG) -i "$<" -filter:v $(ffmpegVideoFilterDeinterlace)$(ffmpegVideoFilterDenoise)$(ffmpegVideoFilterVidstabTransform):input="$(basename $<).trf",$(ffmpegVideoScaleFilter)unsharp=5:5:0.8:3:3:0.4,thumbnail -frames:v 1 "$@"
|
||||
# $(FFMPEG) -i "$<" -aspect $(ffmpegDisplayAspectRatio) -filter:v $(ffmpegVideoFilterDeinterlace)$(ffmpegVideoScaleFilter)thumbnail -frames:v 1 "$@"
|
||||
$(FFMPEG) -i "$<" \
|
||||
-filter:v $(ffmpegVideoFilterDeinterlace),$(ffmpegVideoScaleFilter),thumbnail \
|
||||
-frames:v 1 "$@"
|
||||
|
||||
videos/thumbnails/%.jpg: videos/thumbnails/%.png
|
||||
$(GUETZLI) --quality 90 "$<" "$@"
|
||||
# convert "$<" "$@"
|
||||
|
||||
.PHONY: echo
|
||||
echo:
|
||||
echo $(GET_VIDEO_DURATION_JSON)
|
||||
@@ -0,0 +1,62 @@
|
||||
#FFMPEG = /c/proggis/media/editoren/ffmpeg-4.0.2-win64-static/bin/ffmpeg.exe
|
||||
#FFMPEG = ffmpeg
|
||||
FFMPEG = /home/marko/Downloads/ffmpeg-4.1.3-amd64-static/ffmpeg
|
||||
|
||||
GUETZLI = ~/tmp/guetzli/bin/Release/guetzli
|
||||
#GUETZLI = /d/projekte/tests/guetzli.git/bin/Release/guetzli.exe
|
||||
#GUETZLI = /home/marko/proggis/guetzli/bin/Release/guetzli
|
||||
|
||||
DEFAULT_FFMPEG = ffmpeg
|
||||
#DEFAULT_FFMPEG = /c/proggis/media/editoren/ffmpeg-4.0.2-win64-static/bin/ffmpeg.exe
|
||||
|
||||
GET_VIDEO_DURATION_JSON = /d/temp/cwsvJudo/homepage/redesign2018/markdownExperiment/src/galleryHelper/getVideoDurationJson.py
|
||||
#GET_VIDEO_DURATION_JSON = ~/keeper/cwsvJudo/homepage/redesign2018/markdownExperiment/src/galleryHelper/getVideoDurationJson.py
|
||||
|
||||
getTargetParameter = /d/temp/cwsvJudo/homepage/redesign2018/markdownExperiment/src/galleryHelper/getFfmpegFlags.py
|
||||
|
||||
|
||||
# Für eine schnelle Komprimierung libvpx, sonst vp9
|
||||
DEFAULT_VID_CODEC_HEIGHT = 360
|
||||
DEFAULT_VID_CODEC_WIDTH = -2
|
||||
DEFAULT_VID_CODEC_BITRATE = 500k
|
||||
DEFAULT_VID_CODEC = libvpx-vp9
|
||||
|
||||
# Standardwerte auf die benutzen Variablen schreiben, falls diese noch
|
||||
# nicht (z.B. aus dem Terminal heraus oder über ein IncludeCfgFile)
|
||||
# gesetzt worden sind
|
||||
VID_CODEC_BITRATE := $(if $(VID_CODEC_BITRATE),$(VID_CODEC_BITRATE),$(DEFAULT_VID_CODEC_BITRATE))
|
||||
VID_CODEC_HEIGHT := $(if $(VID_CODEC_HEIGHT),$(VID_CODEC_HEIGHT),$(DEFAULT_VID_CODEC_HEIGHT))
|
||||
VID_CODEC_WIDTH := $(if $(VID_CODEC_WIDTH),$(VID_CODEC_WIDTH),$(DEFAULT_VID_CODEC_WIDTH))
|
||||
VID_CODEC := $(if $(VID_CODEC),$(VID_CODEC),$(DEFAULT_VID_CODEC))
|
||||
|
||||
defaultTargetSourceDirectories = $(sort $(dir $(wildcard ./videos/aufnahmen/*/)))
|
||||
VID_CODEC_DEADLINE := -deadline best
|
||||
#VID_CODEC_DEADLINE := -deadline realtime
|
||||
|
||||
targetSourceDirectories = $(sort $(dir $(wildcard ./videos/aufnahmen/*/)))
|
||||
|
||||
targetSourceDirectories := $(if $(targetSourceDirectories), $(targetSourceDirectories), $(defaultTargetSourceDirectories))
|
||||
sourceVideos = $(wildcard videos/.forCompressing/*.video)
|
||||
|
||||
vidstabLogs = $(addsuffix .trf, $(basename $(sourceVideos)))
|
||||
firstPassLogs = $(addsuffix .firstPassLog-0.log, $(basename $(sourceVideos)))
|
||||
webmVideos = $(addprefix videos/webm/, $(addsuffix .webm, $(basename $(notdir $(sourceVideos)))))
|
||||
jpegThumbs = $(addprefix videos/thumbnails/, $(addsuffix .jpg, $(basename $(notdir $(sourceVideos)))))
|
||||
|
||||
# das result= fehlt absichtlich
|
||||
ffmpegVideoFilterVidstabDetect = vidstabdetect=shakiness=10:accuracy=15
|
||||
# das input= fehlt absichtlich
|
||||
ffmpegVideoFilterVidstabTransform = vidstabtransform=optzoom=2:interpol=bicubic:smoothing=30
|
||||
# vidstab empfiehlt die Verwendung des unsharp-Filters bei vidstabtransform
|
||||
ffmpegVideoFilterUnsharp = unsharp=5:5:0.8:3:3:0.4
|
||||
|
||||
#ffmpegVideoScaleFilter = scale=$(VID_CODEC_WIDTH):$(VID_CODEC_HEIGHT):sws_flags=lanczos,
|
||||
#ffmpegVideoScaleFilter = scale=if\( gt\(in_w, in_h\), -2, $(VID_CODEC_HEIGHT) \):if\( gt\(in_w, in_h\), $(VID_CODEC_HEIGHT), -2\):sws_flags=lanczos
|
||||
#ffmpegVideoScaleFilter = scale="if\(gt\(in_w\,in_h\)\,-2\,$(VID_CODEC_HEIGHT)\)":"if\(gt\(in_w\,in_h\)\,$(VID_CODEC_HEIGHT)\,-2\)":sws_flags=bicubic
|
||||
ffmpegVideoScaleFilter = scale="if\(gt\(in_w\,in_h\)\,-2\,$(shell $(getTargetParameter) $< pixelSize)\)":"if\(gt\(in_w\,in_h\)\,$(shell $(getTargetParameter) $< pixelSize)\,-2\)":sws_flags=bicubic
|
||||
ffmpegVideoFilterDeinterlace = yadif
|
||||
ffmpegVideoFilterDenoise = nlmeans
|
||||
#ffmpegVideoFilterDenoise = hqdn3d,
|
||||
#ffmpegDisplayAspectRatio = 16:9
|
||||
#ffmpegDisplayAspectRatio = 9:16
|
||||
|
||||
@@ -809,7 +809,7 @@
|
||||
}
|
||||
.textoverlayedImage > div {
|
||||
z-index: 99;
|
||||
width: 70%;
|
||||
width: fit-content;
|
||||
position: absolute;
|
||||
top: 50%;
|
||||
left: 50%;
|
||||
@@ -834,6 +834,7 @@
|
||||
}
|
||||
.wkBoxMediaGallery > *{
|
||||
flex-basis:50%;
|
||||
padding: 5%;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1,91 @@
|
||||
#!/usr/bin/env python3
|
||||
|
||||
#
|
||||
# Command line use of 'ffprobe':
|
||||
#
|
||||
# ffprobe -loglevel quiet -print_format json \
|
||||
# -show_format -show_streams \
|
||||
# video-file-name.mp4
|
||||
#
|
||||
# man ffprobe # for more information about ffprobe
|
||||
#
|
||||
|
||||
import subprocess as sp
|
||||
import json
|
||||
import sys
|
||||
import argparse
|
||||
|
||||
|
||||
def probe(vid_file_path):
|
||||
''' Give a json from ffprobe command line
|
||||
|
||||
@vid_file_path : The absolute (full) path of the video file, string.
|
||||
'''
|
||||
if type(vid_file_path) != str:
|
||||
raise Exception('Give ffprobe a full file path of the video')
|
||||
return
|
||||
|
||||
command = ["ffprobe",
|
||||
"-loglevel", "quiet",
|
||||
"-print_format", "json",
|
||||
"-show_format",
|
||||
"-show_streams",
|
||||
vid_file_path
|
||||
]
|
||||
|
||||
pipe = sp.Popen(command, stdout=sp.PIPE, stderr=sp.STDOUT)
|
||||
out, err = pipe.communicate()
|
||||
return json.loads(out.decode('utf-8'))
|
||||
|
||||
def duration(vid_file_path):
|
||||
''' Video's duration in seconds, return a float number
|
||||
'''
|
||||
_json = probe(vid_file_path)
|
||||
|
||||
if 'format' in _json:
|
||||
if 'duration' in _json['format']:
|
||||
return float(_json['format']['duration'])
|
||||
|
||||
if 'streams' in _json:
|
||||
# commonly stream 0 is the video
|
||||
for s in _json['streams']:
|
||||
if 'duration' in s:
|
||||
return float(s['duration'])
|
||||
|
||||
# if everything didn't happen,
|
||||
# we got here because no single 'return' in the above happen.
|
||||
raise Exception('I found no duration')
|
||||
#return None
|
||||
|
||||
def getPixelSize(bitrate):
|
||||
if(bitrate >= 500):
|
||||
return 480
|
||||
if(bitrate >= 250):
|
||||
return 360
|
||||
return 240
|
||||
|
||||
if __name__ == "__main__":
|
||||
argParser = argparse.ArgumentParser(description='Calculate Bitrate and Pixelsize (height) for a encoding a video with limited (byte-)size')
|
||||
argParser.add_argument('inFile', help="file to be analysed")
|
||||
argParser.add_argument('flagToGet', help="Zielparameter wählen", choices=['pixelSize', 'videoBitrate'])
|
||||
argParser.add_argument('--audioBitrate', help="audio bitrate die abgezogen werden soll (in kbit/s)", default=0)
|
||||
argParser.add_argument('--targetSize', help="dateigröße der zieldatei in MB", default=10)
|
||||
argParser.add_argument('--overhead', help="prozentualer overhead in %", default=95)
|
||||
argParser.add_argument('--maxVidBitrate', help="Videobitrate, bei der gedeckelt werden soll", default=750)
|
||||
argv = argParser.parse_args()
|
||||
|
||||
video_file_path = argv.inFile
|
||||
|
||||
durationInSec = duration(video_file_path)
|
||||
|
||||
videoBitrateInKbPerSec = argv.overhead/100 * (argv.targetSize * 1000 * 8)/durationInSec - argv.audioBitrate
|
||||
videoBitrateInKbPerSec = int(min(argv.maxVidBitrate, videoBitrateInKbPerSec))
|
||||
|
||||
pixelSize = getPixelSize(videoBitrateInKbPerSec)
|
||||
|
||||
if(argv.flagToGet == "pixelSize"):
|
||||
print(pixelSize)
|
||||
|
||||
if(argv.flagToGet == "videoBitrate"):
|
||||
print(videoBitrateInKbPerSec)
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
---
|
||||
lang: de
|
||||
title: "Helferlein für das Juodtraining"
|
||||
title: "Helferlein für das Judotraining"
|
||||
description: "Kleine Helferlein für das Training, insbesondere das Judotraining"
|
||||
author: "marko"
|
||||
keywords:
|
||||
|
||||
@@ -6,5 +6,5 @@ subNav:
|
||||
- *galerien
|
||||
- *kontakt
|
||||
- *judoWiki
|
||||
- *extras
|
||||
- *tools
|
||||
...
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
<?php
|
||||
//var_dump($_POST);
|
||||
require_once('./local/db.php.inc');
|
||||
require_once('./local/wkParticipoConf.php.inc');
|
||||
require_once('./auth.php');
|
||||
require_once('./local/db.php.inc');
|
||||
require_once('./local/wkParticipoConf.php.inc');
|
||||
require_once('./auth.php');
|
||||
@@ -26,7 +28,6 @@
|
||||
);
|
||||
$result = $mysqli->query($query);
|
||||
if(!$result){
|
||||
//echo "Fehler bei der Meldung: " . mysql_error(); die($query);
|
||||
echo "Fehler bei der Meldung: "; die($query);
|
||||
}
|
||||
$message['success'] =
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -1,7 +1,6 @@
|
||||
<?php
|
||||
require_once('./local/db.php.inc');
|
||||
require_once('./local/wkParticipoConf.php.inc');
|
||||
// require_once('./auth.php');
|
||||
require_once('./lib/wkParticipoLib.inc.php');
|
||||
if (isset($_SESSION['login'])) {
|
||||
header('Location: http://' . $_SERVER['HTTP_HOST'] . '/index.php');
|
||||
@@ -36,8 +35,7 @@ if (isset($_SESSION['login'])) {
|
||||
),
|
||||
);
|
||||
$message['success'] = 'Anmeldung erfolgreich, <a href="index.php">weiter zum Inhalt.';
|
||||
|
||||
PHPCount::AddHit("wkParticipo - login - ".$row['loginName']);
|
||||
PHPCount::AddHit("wkParticipo-Login ".$_POST['f']['username']);
|
||||
header('Location: http://' . $_SERVER['HTTP_HOST'] . '/pages/desktop/wkParticipo/index.php?user=' . $_POST['f']['username']);
|
||||
} else {
|
||||
sleep(1);
|
||||
|
||||
223
homepage/redesign2018/markdownExperiment/wkParticipo/test.php
Normal file
223
homepage/redesign2018/markdownExperiment/wkParticipo/test.php
Normal file
@@ -0,0 +1,223 @@
|
||||
<?php
|
||||
require_once('./local/wkParticipoConf.php.inc');
|
||||
require_once('./auth.php');
|
||||
require_once('./local/db.php.inc');
|
||||
require_once('./lib/wkParticipoLib.php.inc');
|
||||
?>
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||
|
||||
<title>Wettkampfplanung der Judoka des CWSV</title>
|
||||
<link rel="stylesheet" href="style.css">
|
||||
</head>
|
||||
<body>
|
||||
<?php echo $login_status; ?>
|
||||
|
||||
<h1>Wettkampfplanung - Übersicht</h1>
|
||||
|
||||
|
||||
<h2>Springe zu den ...</h2>
|
||||
|
||||
<a class="touchLink" href="#meldungen"><div>abge­gebenen Meldungen.</div></a>
|
||||
<a class="touchLink" href="#mitfahrgelegenheiten"><div>angemel­deten Mitfahr­gelegen­heiten.</div></a>
|
||||
<a class="touchLink" href="#wettkaempfen"><div>kommenden Wett­kämpfen.</div></a>
|
||||
<hr />
|
||||
<?php
|
||||
$mysqli = @new mysqli($db_server, $db_user, $db_password, $db_name);
|
||||
if ($mysqli->connect_error) {
|
||||
$message['error'] = 'Datenbankverbindung fehlgeschlagen: ' . $mysqli->connect_error;
|
||||
echo $message['error']; die();
|
||||
}
|
||||
?>
|
||||
<h2 id="meldungen">Meldungen zu kommenden Wettkämpfen</h2>
|
||||
|
||||
<?php
|
||||
|
||||
foreach( explode( ',', getUserData($mysqli, $_SESSION['user']['userId'])['kinder']) as $kindId){
|
||||
$kindDaten = getUserData($mysqli, $kindId);
|
||||
?>
|
||||
<h3><?php echo $kindDaten['name'].", ".$kindDaten['vorname'].": ";?></h3>
|
||||
<?php
|
||||
// $wkEventData = getUsersCommingWkEvents($mysqli, $kindId);
|
||||
$wkEventData = getUsersWkEvents($mysqli, $kindId);
|
||||
if(empty($wkEventData)){
|
||||
?>
|
||||
<?php echo mb_convert_encoding($kindDaten['name'].", ".$kindDaten['vorname'], 'UTF-8');?> ist derzeit bei keinem Wettkampf eingeschrieben!
|
||||
<?php
|
||||
}
|
||||
else{
|
||||
foreach($wkEventData as $wkEvent){
|
||||
?>
|
||||
<h4><?php echo mb_convert_encoding($wkEvent['Veranstaltung'], 'UTF-8', 'ISO-8859-1');?></h4>
|
||||
<?php print_r($wkEvent);?>
|
||||
<ul>
|
||||
<li>Datum: <?php echo mb_convert_encoding($wkEvent['Datum'], 'UTF-8', 'ISO-8859-1');?></li>
|
||||
<li>Altersklassen: <?php echo mb_convert_encoding($wkEvent['Altersklassen'], 'UTF-8', 'ISO-8859-1');?></li>
|
||||
</ul>
|
||||
<a class="touchLink" href ="/ressourcen/phpLib/calendar.php?wkID=<?php echo $wkEvent['lfdeNr']?>"><div>Termin in Kalender übernehmen</div></a>
|
||||
<form action="./showWkEvent.php" method="post">
|
||||
<input type="hidden" name="f[eventId]" value="<?php echo (isset( $wkEvent['eventId'] ) ? $wkEvent['eventId'] : "");?>" />
|
||||
<button type="submit">Detailansicht</button>
|
||||
</form>
|
||||
<?php
|
||||
}
|
||||
echo "</ul>";
|
||||
}
|
||||
}
|
||||
?>
|
||||
|
||||
<h2 id="mitfahrgelegenheiten">Angemeldete Mitfahrgelegenheiten</h2>
|
||||
<?php
|
||||
$fahrten = array();
|
||||
$fahrten = getUsersCommingFahrten($mysqli, $_SESSION['user']['userId']);
|
||||
if( empty($fahrten) ){
|
||||
?>
|
||||
Keine Mitfahrangebote gefunden
|
||||
<?php
|
||||
}
|
||||
else{
|
||||
foreach($fahrten as $fahrt){
|
||||
$mitfahrerData = getMitfahrer($mysqli, $fahrt['id']);
|
||||
?>
|
||||
<div class="wkBox">
|
||||
<h3><?php echo (isset($fahrt['Veranstaltung']) ? mb_convert_encoding($fahrt['Veranstaltung'], 'UTF-8', 'ISO-8859-1') : "<fehlender Wettkampfname>" );?></h3>
|
||||
<ul>
|
||||
<li>Datum: <?php echo (isset($fahrt['Datum']) ? mb_convert_encoding($fahrt['Datum'], 'UTF-8', 'ISO-8859-1') : "<fehlendes Datum>" );?></li>
|
||||
<li>Meldefrist: <?php echo (isset($fahrt['meldefrist']) ? mb_convert_encoding($fahrt['meldefrist'], 'UTF-8', 'ISO-8859-1') : "<fehlende Meldefrist>" );?></li>
|
||||
<li>Altersklassen: <?php echo (isset($fahrt['Altersklassen']) ? mb_convert_encoding($fahrt['Altersklassen'], 'UTF-8', 'ISO-8859-1') : "<fehlende Altersklassen>" );?></li>
|
||||
<li>Ort: <a href="<?php echo (isset($fahrt['Routenplaner']) ? mb_convert_encoding($fahrt['Routenplaner'], 'UTF-8', 'ISO-8859-1') : "" );?>"><?php echo (isset($fahrt['Ort']) ? mb_convert_encoding($fahrt['Ort'], 'UTF-8', 'ISO-8859-1') : "<fehlender Ort>" );?></a></li>
|
||||
<li>Anzahl Plätze: <?php echo count($mitfahrerData)."/".$fahrt['plaetze'];?><ul><?php foreach($mitfahrerData as $mitfahrer){echo "<li>".$mitfahrer['name'].", ".$mitfahrer['vorname']."</li>";};?></ul></li>
|
||||
</ul>
|
||||
<a class="touchLink" href ="/ressourcen/phpLib/calendar.php?wkID=<?php echo $fahrt['lfdeNr']?>"><div>Termin in Kalender übernehmen</div></a>
|
||||
<form action="./showWkEvent.php" method="post">
|
||||
<input type="hidden" name="f[eventId]" value="<?php echo (isset( $fahrt['eventId'] ) ? $fahrt['eventId'] : "");?>" />
|
||||
<button type="submit">Detailansicht</button>
|
||||
</form>
|
||||
</div>
|
||||
<hr />
|
||||
|
||||
<?php
|
||||
}
|
||||
}
|
||||
?>
|
||||
<h2 id="wettkaempfen">Anstehende Wettkämpfe</h2>
|
||||
<?php
|
||||
$wkEvents = getCommingWkEvents($mysqli);
|
||||
|
||||
if( empty($wkEvents) ){
|
||||
?>
|
||||
<p>Momentan befinden sich anscheinend keine Wettkämpfe in Planung!</p>
|
||||
<?php
|
||||
}
|
||||
else{
|
||||
foreach( $wkEvents as $wk){
|
||||
//print_r($wk);
|
||||
?>
|
||||
<div class="wkBox"><ul>
|
||||
<li>Datum: <?php echo mb_convert_encoding($wk['Datum'], 'UTF-8', 'ISO-8859-1')?></li>
|
||||
<li>Wettkampf: <?php echo mb_convert_encoding($wk['Veranstaltung'], 'UTF-8', 'ISO-8859-1')?></li>
|
||||
<li>Altersklassen: <?php echo mb_convert_encoding($wk['Altersklassen'], 'UTF-8', 'ISO-8859-1')?></li>
|
||||
<li>Meldefrist: <?php echo mb_convert_encoding($wk['meldefrist'], 'UTF-8', 'ISO-8859-1')?></li>
|
||||
<li>angemeldete Starter:
|
||||
<?php
|
||||
$starters = getStarterForEvent($mysqli, $wk['id']);
|
||||
if( empty($starters) ){
|
||||
?>
|
||||
Noch hat sich niemand für diesen Wettkampf gemeldet!
|
||||
<?php
|
||||
}
|
||||
else{
|
||||
echo count($starters);
|
||||
}
|
||||
?>
|
||||
</li>
|
||||
<?php
|
||||
$fahrten = getFahrtenForEvent($mysqli, $wk['id']);
|
||||
$anzPlätze = 0;
|
||||
foreach($fahrten as $fahrt)
|
||||
$anzPlätze += $fahrt['plaetze'];
|
||||
echo "<li".( ($anzPlätze<count($starters)) ? " style=\"color: red\"" : "" ).">Anzahl Plätze: ".$anzPlätze."</li>";
|
||||
?>
|
||||
</ul>
|
||||
<form action="./showWkEvent.php" method="post">
|
||||
<input type="hidden" name="f[eventId]" value="<?php echo (isset( $wk['id'] ) ? $wk['id'] : "");?>" />
|
||||
<button type="submit">Detailansicht</button>
|
||||
</form>
|
||||
<hr />
|
||||
Für diesen Wettkampf ...
|
||||
<form action="./addStarter.php" method="post">
|
||||
<input type="hidden" name="f[eventId]" value=<?php echo ( isset( $wk['id'] ) ? $wk['id'] : "");?> />
|
||||
<?php
|
||||
if( date("Y-m-d") > $wk['meldefrist'] ){
|
||||
?>
|
||||
<button type="submit" disabled>ist die Meldefrist bereits abgelaufen!</button>
|
||||
<?php
|
||||
}
|
||||
else{
|
||||
?>
|
||||
<button type="submit">einen Starter melden</button>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
</form>
|
||||
<form action="./addFahrt.php" method="post">
|
||||
<input type="hidden" name="f[eventId]" value="<?php echo ( isset( $wk['id'] ) ? $wk['id'] : "" );?>" />
|
||||
<?php
|
||||
// print_r($wk);
|
||||
// echo $wk['id'];
|
||||
if($wk['Datum'] > date("Y-m-d")){
|
||||
?>
|
||||
<button type="submit">eine Mitfahrgelegenheiten melden.</button>
|
||||
<?php
|
||||
}
|
||||
else{
|
||||
?>
|
||||
<button type="submit" disabled>ist es leider zu spät, noch Mitfahrgelegenheiten hinzuzufügen.</button>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
</form>
|
||||
</div>
|
||||
<hr />
|
||||
<?php
|
||||
}
|
||||
}
|
||||
?>
|
||||
<h2 id="ergebnisse">Letzte Ergebnisse</h2>
|
||||
|
||||
<ul>
|
||||
<?php
|
||||
foreach( explode( ',', getUserData($mysqli, $_SESSION['user']['userId'])['kinder']) as $kindId){
|
||||
$kindDaten = getUserData($mysqli, $kindId);
|
||||
|
||||
echo "<li>".$kindDaten['name'].", ".$kindDaten['vorname'].":<ul>";
|
||||
$ergebnisse = getUsersErgebnisse($mysqli, $kindId);
|
||||
foreach( $ergebnisse as $ergebnis ){
|
||||
?>
|
||||
<li><?php echo mb_convert_encoding($ergebnis['Datum'], 'UTF-8', 'ISO-8859-1')?></li>
|
||||
<li><?php echo mb_convert_encoding($ergebnis['Veranstaltung'], 'UTF-8', 'ISO-8859-1');?></li>
|
||||
<li>Platz: <?php echo mb_convert_encoding($ergebnis['platz'], 'UTF-8', 'ISO-8859-1'); ?></li>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
</ul></li>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
</ul>
|
||||
<?php
|
||||
$mysqli->close();
|
||||
?>
|
||||
|
||||
<!--Beginn der Einbindung des Counters-->
|
||||
<?php
|
||||
$chCounter_page_title = "Wettkampfplaner -- Übersicht";
|
||||
$chCounter_page_url = $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'] . "?user=".$_SESSION['user']['username'];
|
||||
$chCounter_visible=0;
|
||||
// include( $_SERVER['DOCUMENT_ROOT'].'/expCounter/counter.php');
|
||||
?>
|
||||
</body>
|
||||
</html>
|
||||
Reference in New Issue
Block a user