--- /dev/null
+#!/bin/sh
+
+# Start TeleCaster video channel
+
+#WIDTH=640
+#HEIGHT=360
+WIDTH=864
+HEIGHT=480
+#WIDTH=1280
+#HEIGHT=720
+FRAMERATE=24
+
+v4l2-ctl -d 0 -c power_line_frequency=1
+v4l2-ctl -d 0 -c zoom_absolute=135
+v4l2-ctl -d 0 -c focus_auto=0
+v4l2-ctl -d 0 -c focus_absolute=1
+v4l2-ctl -d 0 -c sharpness=100
+
+# ! queue ! videoflip method=rotate-180 \
+
+gst-launch-1.0 v4l2src device=/dev/video0 ! video/x-raw, format=YUY2, width=$WIDTH, height=$HEIGHT, framerate=$FRAMERATE/1 \
+ ! queue ! videoflip method=rotate-180 \
+ ! queue ! videoconvert \
+ ! queue ! vp8enc threads=4 deadline=2 \
+ ! queue ! muxout. \
+ jackaudiosrc connect=1 ! audio/x-raw, format=F32LE, channels=1 \
+ ! queue ! audiocheblimit mode=high-pass cutoff=120 poles=4 \
+ ! queue ! audiodynamic characteristics=soft-knee mode=compressor threshold=0.16 ratio=0.15 \
+ ! queue ! rgvolume pre-amp=6.0 headroom=1.0 \
+ ! queue ! rglimiter \
+ ! queue ! audioconvert \
+ ! queue ! opusenc bitrate=96000 \
+ ! queue ! muxout. \
+ webmmux streamable=true name=muxout \
+ ! queue ! tcpserversink host=127.0.0.1 port=9000 blocksize=65536 sync-method=1 \
+ > /dev/null
#!/bin/bash
rsync -aq /home/telecaster/archives/Pre-Barreau/ /mnt/nile/Pre-Barreau/
-#rsync -aq /home/telecaster/archives/Pre-Barreau/ admin-tech@Nile:/volume1/archives/Pre-Barreau/
+rsync -aq /home/telecaster/kdenlive/ /mnt/nile/Pre-Barreau/Pro-Barreau/kdenlive/
--- /dev/null
+#!/usr/bin/python
+
+import os, sys, string
+import logging
+import datetime
+
+
+class Logger:
+ """A logging object"""
+
+ def __init__(self, file):
+ self.logger = logging.getLogger('myapp')
+ self.hdlr = logging.FileHandler(file)
+ self.formatter = logging.Formatter('%(asctime)s %(message)s')
+ self.hdlr.setFormatter(self.formatter)
+ self.logger.addHandler(self.hdlr)
+ self.logger.setLevel(logging.INFO)
+
+
+class TelemetaTranscode(object):
+ """docstring for TelemetaTranscode"""
+
+ source_formats = ['mp4',]
+ dest_formats = {
+ 'mp3' : '-vn -acodec libmp3lame -aq 6',
+ 'png' : '-ss 0:1:0',
+ }
+
+ date_limit = datetime.datetime(year=2021, month=6, day=24)
+
+ def __init__(self, args):
+ self.args = args
+ self.log_file = args[-1]
+ self.root_dir = args[-2]
+ self.logger = Logger(self.log_file)
+
+ def get_ext_in_dir(self, extension, root):
+ files = os.listdir(root)
+ exts = []
+ for f in files:
+ name, ext = os.path.splitext(f)
+ ext = ext[1:]
+ if not ext in exts:
+ exts.append(ext)
+ return extension in exts
+
+ def run(self):
+ for root, dirs, files in os.walk(self.root_dir):
+ for file in files:
+ path = os.path.abspath(root + os.sep + file)
+ name, ext = os.path.splitext(file)
+ ext = ext[1:]
+ date_dir = datetime.datetime.fromtimestamp(os.path.getmtime(path))
+ if ext in self.source_formats and date_dir > self.date_limit:
+ for format, ffmpeg_args in self.dest_formats.items():
+ local_file = name + '.' + format
+ dest = os.path.abspath(root + os.sep + local_file)
+ local_files = os.listdir(root)
+ if not (local_file in local_files or self.get_ext_in_dir(format, root)) or '--force' in self.args:
+ if ext == 'webm' and format == 'ogg':
+ ffmpeg_args = '-vn -acodec copy'
+ if format == 'png':
+ command = '/usr/local/bin/ffmpeg -loglevel 0 ' + ffmpeg_args + ' -i "' + path + '" -frames:v 1 -y "' + dest + '"'
+ else:
+ command = '/usr/local/bin/ffmpeg -loglevel 0 -i "' + path + '" ' + ffmpeg_args + ' -y "' + dest + '"'
+ self.logger.logger.info(command)
+ if not '--dry-run' in self.args:
+ os.system(command)
+ print(command)
+
+
+if __name__ == '__main__':
+ t = TelemetaTranscode(sys.argv[1:])
+ t.run()
import os, sys, string
import logging
+import datetime
class Logger:
class TelemetaTranscode(object):
"""docstring for TelemetaTranscode"""
- threads = 4
- source_formats = ['webm', 'mp4']
+ source_formats = ['webm',]
dest_formats = {
'mp3' : '-vn -acodec libmp3lame -aq 6',
- 'ogg' : '-vn -acodec libvorbis -aq 6',
- 'mp4' : '-vcodec libx264 -threads ' + str(threads) + \
- ' -c:v libx264 -crf 17 -maxrate 1100k -bufsize 1835k -acodec aac -strict -2 -ab 96k',
- 'png' : '-ss 0:0:10',
- 'webm' : '-vcodec libvpx -threads ' + str(threads) + \
- ' -c:v libvpx -crf 17 -b:v 1100k',
+ 'mp4' : '-c:v libx264 -maxrate 1100k -c:a aac -b:a 128k',
+ 'png' : '-ss 0:5:0',
}
+ date_limit = datetime.datetime(year=2021, month=6, day=24)
def __init__(self, args):
self.args = args
self.root_dir = args[-2]
self.logger = Logger(self.log_file)
-
def get_ext_in_dir(self, extension, root):
files = os.listdir(root)
exts = []
path = os.path.abspath(root + os.sep + file)
name, ext = os.path.splitext(file)
ext = ext[1:]
- if ext in self.source_formats:
- for format, ffmpeg_args in self.dest_formats.iteritems():
+ date_dir = datetime.datetime.fromtimestamp(os.path.getmtime(path))
+ if ext in self.source_formats and date_dir > self.date_limit:
+ for format, ffmpeg_args in self.dest_formats.items():
local_file = name + '.' + format
dest = os.path.abspath(root + os.sep + local_file)
local_files = os.listdir(root)
if not (local_file in local_files or self.get_ext_in_dir(format, root)) or '--force' in self.args:
if ext == 'webm' and format == 'ogg':
ffmpeg_args = '-vn -acodec copy'
- command = 'ffmpeg -loglevel 0 -i "' + path + '" ' + ffmpeg_args + ' -y "' + dest + '"'
+ if format == 'png':
+ command = '/usr/local/bin/ffmpeg -loglevel 0 ' + ffmpeg_args + ' -i "' + path + '" -frames:v 1 -y "' + dest + '"'
+ else:
+ command = '/usr/local/bin/ffmpeg -loglevel 0 -i "' + path + '" ' + ffmpeg_args + ' -y "' + dest + '"'
self.logger.logger.info(command)
if not '--dry-run' in self.args:
os.system(command)
- else:
- print command
+ print(command)
if __name__ == '__main__':
--- /dev/null
+#!/usr/bin/python
+
+import os, sys, string
+import logging
+
+
+class Logger:
+ """A logging object"""
+
+ def __init__(self, file):
+ self.logger = logging.getLogger('myapp')
+ self.hdlr = logging.FileHandler(file)
+ self.formatter = logging.Formatter('%(asctime)s %(message)s')
+ self.hdlr.setFormatter(self.formatter)
+ self.logger.addHandler(self.hdlr)
+ self.logger.setLevel(logging.INFO)
+
+
+class TelemetaTranscode(object):
+ """docstring for TelemetaTranscode"""
+
+ threads = 4
+ source_formats = ['webm', 'mp4']
+ dest_formats = {
+ 'mp3' : '-vn -acodec libmp3lame -aq 6',
+ 'ogg' : '-vn -acodec libvorbis -aq 6',
+ 'mp4' : '-vcodec libx264 -threads ' + str(threads) + \
+ ' -c:v libx264 -crf 17 -maxrate 1100k -bufsize 1835k -acodec aac -strict -2 -ab 96k',
+ 'png' : '-ss 0:0:10',
+ 'webm' : '-vcodec libvpx -threads ' + str(threads) + \
+ ' -c:v libvpx -crf 17 -b:v 1100k',
+ }
+
+
+ def __init__(self, args):
+ self.args = args
+ self.log_file = args[-1]
+ self.root_dir = args[-2]
+ self.logger = Logger(self.log_file)
+
+
+ def get_ext_in_dir(self, extension, root):
+ files = os.listdir(root)
+ exts = []
+ for f in files:
+ name, ext = os.path.splitext(f)
+ ext = ext[1:]
+ if not ext in exts:
+ exts.append(ext)
+ return extension in exts
+
+ def run(self):
+ for root, dirs, files in os.walk(self.root_dir):
+ for file in files:
+ path = os.path.abspath(root + os.sep + file)
+ name, ext = os.path.splitext(file)
+ ext = ext[1:]
+ if ext in self.source_formats:
+ for format, ffmpeg_args in self.dest_formats.iteritems():
+ local_file = name + '.' + format
+ dest = os.path.abspath(root + os.sep + local_file)
+ local_files = os.listdir(root)
+ if not (local_file in local_files or self.get_ext_in_dir(format, root)) or '--force' in self.args:
+ if ext == 'webm' and format == 'ogg':
+ ffmpeg_args = '-vn -acodec copy'
+ command = 'ffmpeg -loglevel 0 -i "' + path + '" ' + ffmpeg_args + ' -y "' + dest + '"'
+ self.logger.logger.info(command)
+ if not '--dry-run' in self.args:
+ os.system(command)
+ else:
+ print command
+
+
+if __name__ == '__main__':
+ t = TelemetaTranscode(sys.argv[1:])
+ t.run()
--- /dev/null
+#!/usr/bin/python
+
+import os, sys, string
+import logging
+
+
+class Logger:
+ """A logging object"""
+
+ def __init__(self, file):
+ self.logger = logging.getLogger('myapp')
+ self.hdlr = logging.FileHandler(file)
+ self.formatter = logging.Formatter('%(asctime)s %(message)s')
+ self.hdlr.setFormatter(self.formatter)
+ self.logger.addHandler(self.hdlr)
+ self.logger.setLevel(logging.INFO)
+
+
+class TelemetaTranscode(object):
+ """docstring for TelemetaTranscode"""
+
+ threads = 15
+ source_formats = ['mp4']
+ dest_formats = {
+ 'mp3' : '-vn -acodec libmp3lame -aq 6',
+ 'ogg' : '-vn -acodec libvorbis -aq 6',
+ 'png' : '-ss 0:0:10',
+ 'webm' : '-vcodec libvpx -threads ' + str(threads) + \
+ ' -c:v libvpx -crf 17 -b:v 1100k',
+ }
+
+
+ def __init__(self, args):
+ self.args = args
+ self.log_file = args[-1]
+ self.root_dir = args[-2]
+ self.logger = Logger(self.log_file)
+
+
+ def get_ext_in_dir(self, extension, root):
+ files = os.listdir(root)
+ exts = []
+ for f in files:
+ name, ext = os.path.splitext(f)
+ ext = ext[1:]
+ if not ext in exts:
+ exts.append(ext)
+ return extension in exts
+
+ def run(self):
+ for root, dirs, files in os.walk(self.root_dir):
+ for file in files:
+ path = os.path.abspath(root + os.sep + file)
+ name, ext = os.path.splitext(file)
+ ext = ext[1:]
+ if ext in self.source_formats:
+ for format, ffmpeg_args in self.dest_formats.iteritems():
+ local_file = name + '.' + format
+ dest = os.path.abspath(root + os.sep + local_file)
+ local_files = os.listdir(root)
+ if not (local_file in local_files or self.get_ext_in_dir(format, root)) or '--force' in self.args:
+ if ext == 'webm' and format == 'ogg':
+ ffmpeg_args = '-vn -acodec copy'
+ command = 'ffmpeg -loglevel 0 -i "' + path + '" ' + ffmpeg_args + ' -y "' + dest + '"'
+ self.logger.logger.info(command)
+ if not '--dry-run' in self.args:
+ os.system(command)
+ else:
+ print command
+
+
+if __name__ == '__main__':
+ t = TelemetaTranscode(sys.argv[1:])
+ t.run()
subject="TeleCaster remux (CRFPA)"
bwlimit=20000
-python apps/telecaster/telecaster-server/bin/remux_fix_media.py $media_dir $tmp_dir > $tmp_log
+python ~/bin/py/remux_fix_media.py $media_dir $tmp_dir > $tmp_log
cat $tmp_log >> $remux_log
#echo `date` >> ~/log/transcode-crfpa.log
-python ~/apps/telecaster/telecaster-server/bin/transcode_nv.py $media_dir $transcode_log
+python ~/bin/py/transcode.py $media_dir $transcode_log
#find $backup_dir -type d -exec chmod 755 {} \;
#find $backup_dir -type f -exec chmod 644 {} \;
#bash ~/apps/Telemeta/scripts/kdenlive/mlt_fix_threads.sh $script_dir
#python ~/apps/Telemeta/scripts/kdenlive/mlt_process_batch.py --fading $script_dir >> $log_dir/mlt.log
- python ~/apps/Telemeta/scripts/transcode/remux_fix_media.py $archives_dir $tmp_dir >> $log_dir/remux-pro.log
- python ~/apps/Telemeta/scripts/transcode/transcode_nv.py $media_dir $log_dir/transcode-pro.log
+ #python ~/apps/Telemeta/scripts/transcode/remux_fix_media.py $archives_dir $tmp_dir >> $log_dir/remux-pro.log
+ #python ~/apps/Telemeta/scripts/transcode/transcode.py $media_dir $log_dir/transcode-pro.log
+
+ python ~/bin/py/remux_fix_media.py $archives_dir $tmp_dir >> $log_dir/remux-pro.log
+ python ~/bin/py/transcode-pro.py $media_dir $log_dir/transcode-pro.log
chmod -fR 664 $media_dir; chmod -fR +rX $media_dir
rsync -aquLKP --bwlimit=15000 --delete --exclude="@eaDir" $media_dir $server:$server_media_dir