Kann Folgendes mit Automator oder einem anderen Tool/Skript unter macOS durchgeführt werden?
.mp4
).Also, wenn ich die Datei habe video-to-html.mp4
, möchte ich am Ende eine ZIP-Datei mit zwei Dateien haben:
video-to-html/video-to-html.html
video-to-html/video-to-html.mp4
Der Inhalt der HTML-Datei würde wie folgt aussehen:
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Lorem ipsum</title>
</head>
<body>
<video autoplay controls>
<source src="video-to-html.mp4" type="video/mp4">
</video>
</body>
</html>
Ich bin kein Entwickler, also verstehe ich nicht viel Codierung.
Sie können dies einfach mit einem kurzen Shell-Skript erreichen:
#!/bin/bash
for v do
base=${v%%.mp4}
cat >>"${base}.html" <<EOF
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Lorem ipsum</title>
</head>
<body>
<video autoplay controls>
<source src="$v" type="video/mp4">
</video>
</body>
</html>
EOF
rm -f "${base}.zip"
zip "${base}.zip" "${base}.html" "$v"
done
Speichern Sie es als Shell-Skript an einem geeigneten Ort, öffnen Sie das Terminal, führen Sie es aus chmod +x name-of-script
und führen Sie es aus als./name-of-script *.mp4
.mp4
Dateien einfach per Drag & Drop auf das Programmsymbol ziehen. Danke schön!for filename do base=${filename%%.mp4} cat >>"${base}-HTML-Wrap.html" <<EOF <!DOCTYPE html> <html> <head> <meta charset="UTF-8"> <title>Lorem ipsum</title> </head> <body> <video autoplay controls loop> <source src= "${base##*/}.mp4" type="video/mp4"> </video> </body> </html> EOF zip -j "${base}-HTML-Wrap.zip" "${base}-HTML-Wrap.html" "$filename" rm -f "${base}-HTML-Wrap.html" done
Joonas
Jon Denier
Joonas