Updated for Ubuntu 22.04. Also fixed merge videos cmin check
[videoscripts/.git] / organize_videos.conf
1 # Force Emacs Perl Mode
2 # Local Variables: 
3 # mode: perl 
4 # End:
5
6 ################################################################################
7 # This is a perl module included by the perl scripts for this application.
8 # You must modify these values to match your system configuration.
9 # Create a new file called "organize_videos.conf.local" in the same dir as "organize_videos.conf"
10 # and only put in it the variables you wish to override.
11 # This will prevent your localized settings from being overwritten by future code updates.
12 ################################################################################
13
14 # Path to look for videos to move from
15 $srcpathname = "/naspool/dropbox/New Memories";
16
17 # Path to move the videos to
18 $dstpathname = "/naspool/videos/HomeVideos";
19
20 # Path to move the originals to
21 $origpathname = "/naspool/dropbox/Originals";
22 $originals_file_ext = qr/(mov|mp4)/i;
23 #$originals_no_copy_brands = qr/mp42avc1/i; # Don't copy videos from camcorder to Originals because we keep these videos on those cards
24 $originals_no_copy_brands = qr/none/i; # We no longer keep the cards
25 $save_originals = 1;
26
27 # Brands that store time as local vs UTC
28 $local_tz_brands = qr/mp42avc1/i; # the camcorder sets the creation time to the local time with no timezone (so UTC), so treat them as local timestamps, not UTC timestamps
29
30 # Path to a dir (or dirs separated by semis) to watch for videos to move to $srcpathname to be organized
31 $watchpathname = "/naspool/cloud/alan/files/InstantUpload/Camera;/naspool/cloud/mary/files/InstantUpload/Camera;";
32
33 # Path to nextcloud base dir where user dirs start
34 $nextcloudbase = "/naspool/cloud/";
35
36 # If there are file duplicates in srcpathname, should they be overwritten (assumes all files from phones will be named uniquely)
37 $overwrite_dest = 1;
38
39 # Path to nextcloud occ cmd script
40 $occ = "/naspool/www/pippins.net/nextcloud.custom/occ.cmd";
41
42 # Path to merge_videos_by_day script
43 $merge_videos_by_day = "/naspool/videos/bin/merge_videos_by_day";
44
45 # Flag to merge videos by modification date instead of the date parsed from the filename
46 $merge_by_modification_date = 0;
47
48 # Path to the make_mkv script
49 $make_mkv = "/naspool/videos/bin/make_mkv";
50
51 # mkvmerge path/command name
52 $mkvmerge = '/usr/bin/mkvmerge';
53
54 # ffmpeg path/command name
55 $ffmpeg = '/usr/bin/ffmpeg';
56 $ffprobe = '/usr/bin/ffprobe';
57 $avconv = '/usr/bin/avconv';
58
59 # handbrake path/command name
60 $handbrake = '/usr/bin/HandBrakeCLI';
61
62 # The pid file to use to indicate organize_videos is running
63 $pid_file = "/tmp/organize_videos.pid";
64
65 # The owner of the files after they are moved
66 $owner = "ajp";
67
68 # The group of the files after they are moved
69 $group = "pip";
70
71 # The mode to set on each file after they are moved
72 $mode = "664";
73
74 # The mode to set on each directory after they are created
75 $dirmode = "2775";
76
77 # The extension to use when creating playlist files
78 $playlist_extension = "pls";
79
80 # What number to start with when adding an incrementing suffix to the end of the final video clip to avoid name collisions
81 $video_suffix = "000";
82
83 # Which movie file extensions should be considered for merging
84 # NOTE: Script does not support merging multiple mkv files into a single mkv file
85 $movie_file_ext = "-iregex \".*\.mov\" -o -iregex \".*\.3gp\" -o -iregex \".*\.avi\" -o -iregex \".*\.mp4\" -o -iregex \".*\.mpg\" -o -iregex \".*\.mts\" -o -iregex \".*\.m4v\"";
86
87 # Which movie file extensions should not be recompressed for merging
88 $no_recompress_file_ext = qr/\.(mp4)$/i;
89
90 # Video file creation dates must not have changed in the last X minutes to process any of the video files
91 # This is done to ensure that all videos from a given upload from a camera have completed prior to looking for videos to merge
92 $minage = "+60";
93
94 # What command should be used to find files by move_videos_from_watchdir that have changed (are at least X minutes old) 
95 $find_changed_cmd = "find  \"$srcpathname/\" -not -cmin +5 -a \\( $movie_file_ext \\)";
96
97 # What command should be used to find all movie files
98 $find_cmd = "find \"$srcpathname/\" $movie_file_ext";
99 $find_cmd_with_mkv = "find \"$srcpathname/\" $movie_file_ext -o -iregex \".*\.mkv\"";
100 $find_mkv = "find \"$srcpathname/\" -iregex \".*\.mkv\"";
101
102 # Set the tmpfile to use, but remove the 0 byte file it creates, we'll create it if we need it
103 $tmpfile = `mktemp`; chomp($tmpfile); unlink "$tmpfile";
104
105 # Set the timezone to use
106 $timezone = `cat /etc/timezone`; chomp($timezone);
107
108 # handbrake options used when re-encoding the videos
109 $handbrake_requantize_options='--auto-anamorphic --crop 0:0:0:0 -E ac3';
110 $handbrake_recompress_options='--auto-anamorphic --crop 0:0:0:0 --denoise="weak" -e x264 -q 18 -x b-adapt=2:rc-lookahead=50 -v 2 -a 1 -6 dpl2 --preset="HQ 1080p30 Surround"';
111
112 # handbrake input file options
113 $input_file_options = "-S";
114
115 # handbrake output file options
116 $output_file_options = "--compression -1:none";
117
118 # handbrake quantization levels
119 $interlaced_requantize_quality=0.85;
120 $progressive_requantize_quality=0.75;
121
122 # Remote compute host to farm handbrake encode job off to (I need this since this script is run from a virtual machine)
123 $compute_host = "pippin.pippins.net";
124
125 # Set to 1 to use a remote compute host to run the mkvmerge command. Set to 0 to use the local host to run it.
126 $use_compute_host = 0;
127
128 # This will dramatically decrease the size of the video with minimal compute processing requirements.
129 $requantize_input_video=0; 
130 $recompress_input_video=1;
131
132 # What text to put on the front of the title for the merged video being created
133 $video_title_prefix = "HomeVideos:";
134
135 ####################################################################################################