concat video and upload Youtube
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# source directory / папка с исходными видео | |
dirstart="DCIM/100MEDIA/" | |
# date format for new file / формат даты для названия нового файла | |
firstfile=`date -u -r $dirstart$(ls $dirstart | head -n 1) +"%Y%m%d %H:%M"` | |
lastfile=`date -u -r $dirstart$(ls $dirstart | tail -n 1) +"%Y%m%d %H:%M"` | |
echo -n "Введите название видео: " | |
read name | |
echo -n "Введите теги: " | |
read tags | |
echo -n "Введите описание: " | |
read desc | |
newnamefile="$firstfile - $lastfile $name" | |
echo "Сборка $newnamefile началась | |
Теги: $tags | |
Описание: $desc | |
" | |
# destination directory / папка назначения | |
dirend="~/video" | |
newdirnamefile="$dirend""youtube_upload/$newnamefile"".mp4" | |
# building files with MP4Box / сборка файлов с помощью MP4Box | |
# https://gpac.wp.imt.fr/mp4box/ | |
filesList="" | |
for file in $(ls $dirstart*.mp4|sort -n);do | |
filesList="$filesList -cat $file" | |
done | |
MP4Box $filesList -new "$newdirnamefile" | |
# create a log file with data about files through mediainfo / создаём лог файл данными о файлах через mediainfo | |
mediainfo --LogFile="$newdirnamefile.txt" $dirstart*.mp4 | |
# upload to Youtube using python script / выгружаем на Ютуб с помощью python скрипта | |
# https://blog.g63.ru/?p=2226 | |
# https://developers.google.com/youtube/v3/quickstart/python | |
python "$dirend/youtube-upload.py" \ | |
--file="$newdirnamefile" \ | |
--title="$newnamefile" \ | |
--category='2' \ | |
--keywords="$tags" \ | |
--description="$desc" \ | |
--privacyStatus="private" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment