-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathdlSegmented
More file actions
executable file
·41 lines (31 loc) · 1.98 KB
/
dlSegmented
File metadata and controls
executable file
·41 lines (31 loc) · 1.98 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
#!/usr/bin/env bash
# Source:
# https://www.br.de/alphalernen/faecher/deutsch/audiovisuelle-texte-interpretation-kurzfilm-100.html
# To be updated
BASE_URL="https://br-i.akamaihd.net/i/MUJIuUOVBwQIbtC2uKJDM6OhuLnC_2rc571S/_-QS/9AgG9A4H/75a25e87-f61a-475d-b8f8-b3f5fc48d243_,0,A,B,E,C,.mp4.csmil"
for j in {0..110};
do
# This is a quality index, index 4 is the best quality
i=4
#for i in {0..4};
#do
wget "${BASE_URL}/segment${j}_${i}_av.ts?null=0"\
-O "segment${j}_${i}_av.ts";
#done;
done
# TODO: Handle this with 0 padded printf
# for i in segment9_* ; do mv ${i} "segment09_$(echo ${i} | cut -d'_' -f2,3,4)"; done
# https://stackoverflow.com/questions/7333232/how-to-concatenate-two-mp4-files-using-ffmpeg
# https://stackoverflow.com/questions/38996925/ffmpeg-concat-unsafe-file-name
for i in segment*_4_av.ts; do echo "file '${PWD}/${i}'" >> mylist2.txt; done
# Strongly consider downloading ffmpeg from
# https://ffbinaries.com/downloads
# this includes everything that are missing from any other distribution.
ffmpeg -f concat -safe 0 -analyzeduration 100M -probesize 100M -i mylist2.txt -f mpegts -c copy output3
# Convert to iPad format with:
ffmpeg -i FullVideo.mp2ts -c:a aac -cutoff 15000 -ab 128k -ar 44100 -ac 1 -strict -2 -async 1 -c:v copy -b:v 1024k -maxrate 2048k -bufsize 2048k -r 23.81 -pix_fmt yuv420p -movflags faststart -level 13 -partitions partb8x8+partp4x4+partp8x8+parti8x8 -b-pyramid 1 -weightb 0 -8x8dct 0 -fast-pskip 1 -trellis 1 -me_method hex -flags +loop -sws_flags fast_bilinear -direct-pred 1 -sc_threshold 40 -sn -y FullVideo.mp4
# Convert with NVidia acceleartion
# https://docs.nvidia.com/video-technologies/video-codec-sdk/12.0/ffmpeg-with-nvidia-gpu/index.html#hwaccel-transcode-without-scaling
ffmpeg -y -vsync 0 -hwaccel cuda -hwaccel_output_format cuda -i input.mp4 -c:v h264_nvenc -b:v 5M -c:a copy output.mp4
# Use delogo filter:
ffmpeg -i input.mp4 -vf "delogo=x=1539:y=23:w=353:h=93:enable='between(t,5,10)'" -c:a copy output.mp4