This file contains hidden or 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 | |
| # $1 = filelocation | |
| # Renames filename.vtt to filename.srt besides converting it | |
| sed -i "/WEBVTT/d" $1 | |
| for i in `grep -n "\-\->" $1 | cut -d: -f1`; do sed -i "${i}s/\([0-9]\)\.\([0-9]\)/\1,\2/g" $1; done | |
| newname=`echo $1 | sed "s/vtt/srt/g"` | |
| mv $1 $newname | |
| x=1;for i in `grep -n "^$" $newname | cut -d: -f1`; do sed -i "${i}s/.*/crashlaker${x}/" $newname; x=$((x+1)); done |
This file contains hidden or 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 | |
| # $1 = filename | |
| rm -f ${1}.mp4 | |
| a=1;for file in `ls ${1}*.mp4`; do ffmpeg -i $file -c copy -bsf:v h264_mp4toannexb -f mpegts tmpfile${a}.ts; a=$((a+1)); done | |
| ffmpeg -i "concat:`ls tmpfile*.ts | paste -s -d\"|\"`" -c copy -bsf:a aac_adtstoasc ${1}.mp4 |
This file contains hidden or 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 | |
| #$2 .mp3 | |
| ffmpeg -i $1 -acodec libmp3lame -aq 4 $2 | |
| #https://ubuntuforums.org/showthread.php?t=1493682 |
This file contains hidden or 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
| import datetime | |
| import time | |
| date = datetime.datetime(2019,5,1) # date object | |
| print(date) # 2019-05-01 00:00:00 | |
| ts = time.mktime(date.timetuple()) # timestamp in seconds | |
| print(ts) # 1556668800.0 |
This file contains hidden or 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
| import datetime | |
| timestamp = 1556668800.0 | |
| date = datetime.datetime.utcfromtimestamp(timestamp) | |
| print(date) # 2019-05-01 00:00:00 |
This file contains hidden or 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
| import datetime | |
| import pytz | |
| timestamp = 1556668800.0 | |
| date = datetime.datetime.utcfromtimestamp(timestamp) | |
| print(date) # 2019-05-01 00:00:00 | |
| # Applying timezone without converting it | |
| date_sp = pytz.timezone("America/Sao_Paulo").localize(date) | |
| print(date_sp.strftime(fmt)) # 2019-05-01 00:00:00 -03-0300 |
This file contains hidden or 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
| import datetime | |
| import pytz | |
| timestamp = 1556668800.0 | |
| date = datetime.datetime.utcfromtimestamp(timestamp) | |
| print(date) # 2019-05-01 00:00:00 | |
| # Applying timezone without converting it | |
| date_utc = pytz.utc.localize(date) | |
| print(date_utc.strftime(fmt)) # 2019-05-01 00:00:00 UTC+0000 |
This file contains hidden or 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
| gistup |
This file contains hidden or 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
| <!DOCTYPE html> | |
| <meta charset="utf-8"> | |
| <style> | |
| .line { | |
| fill: none; | |
| stroke: steelblue; | |
| stroke-width: 1.5px; | |
| } | |
| .zoom { |
This file contains hidden or 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
| gistup |
OlderNewer