Skip to content

Instantly share code, notes, and snippets.

@aksinghdce
Created April 9, 2023 20:45
Show Gist options
  • Save aksinghdce/19b48f2d31b905f7d06c58f0bfd162ee to your computer and use it in GitHub Desktop.
Save aksinghdce/19b48f2d31b905f7d06c58f0bfd162ee to your computer and use it in GitHub Desktop.
render video with blender and upload to youtube with OAuth2.0 credentials

Code:

#!/usr/bin/env bash
while getopts s:e:t:d:k: flag
do
	case "${flag}" in 
		s) start_frame=${OPTARG};;
		e) end_frame=${OPTARG};;
		t) title=${OPTARG};;
		d) description=${OPTARG};;
		k) keywords=${OPTARG};;
	esac
done
/home/amit/Documents/2-devata/blender/blender-3.3.1-linux-x64/blender -b /home/amit/Documents/pendrive/Career-Template/7-podcasts-blender/2-personal-youtube-channel/private/Camera-dump/0.blend -a; python upload_video.py --file=/tmp/"${start_frame}"-"${end_frame}".mp4     --title="${title}" --description="${description}" --keywords="${keywords}" --category="22" --privacyStatus="private"

This is how to call the command. Make sure that your YouTube API credential file is present in the same directory.

./render_and_upload.sh -s 194014 -e 200079 -t 'bhajan at the temple nageshwar mahadev rakkar' -d 'one of the most interesting events at the temple adjoining to public school ground in Rakkar Village, Dharamshala, Himachal Pradesh' -k "bhajan, temple, social"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment