Skip to content

Commit

Permalink
初めての commit
Browse files Browse the repository at this point in the history
  • Loading branch information
qq542vev committed Apr 10, 2023
0 parents commit 08b04b0
Show file tree
Hide file tree
Showing 16 changed files with 406 additions and 0 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
*.webm
*.mkv
103 changes: 103 additions & 0 deletions all-sailor-moon-memories.mkv.mediainfo.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,103 @@
General
Unique ID : 99318613395578973999353875199541250655 (0x4AB811B44BE85B0B886781C692D60A5F)
Complete name : all-sailor-moon-memories.mkv
Format : Matroska
Format version : Version 4
File size : 428 MiB
Duration : 1 min 33 s
Overall bit rate mode : Variable
Overall bit rate : 38.6 Mb/s
Frame rate : 30.000 FPS
Movie name : All Sailor Moon Memories
Writing application : Lavf59.27.100
Writing library : Lavf59.27.100
ErrorDetectionType : Per level 1

Video
ID : 1
Format : AVC
Format/Info : Advanced Video Codec
Format profile : High 4:4:4 Predictive@L5
Format settings : CABAC / 16 Ref Frames
Format settings, CABAC : Yes
Format settings, Reference frames : 16 frames
Codec ID : V_MPEG4/ISO/AVC
Duration : 1 min 33 s
Width : 1 280 pixels
Height : 960 pixels
Display aspect ratio : 4:3
Frame rate mode : Constant
Frame rate : 30.000 FPS
Color space : YUV
Chroma subsampling : 4:2:0
Bit depth : 8 bits
Scan type : Progressive
Writing library : x264 core 164 r3098 7628a56
Encoding settings : cabac=1 / ref=16 / deblock=1:1:1 / analyse=0x3:0x133 / me=esa / subme=9 / psy=0 / mixed_ref=1 / me_range=24 / chroma_me=1 / trellis=0 / 8x8dct=1 / cqm=0 / deadzone=21,11 / fast_pskip=0 / chroma_qp_offset=0 / threads=3 / lookahead_threads=1 / sliced_threads=0 / nr=0 / decimate=1 / interlaced=0 / bluray_compat=0 / constrained_intra=0 / bframes=0 / weightp=2 / keyint=250 / keyint_min=25 / scenecut=40 / intra_refresh=0 / rc=cqp / mbtree=0 / qp=0
Default : No
Forced : No

Audio #1
ID : 2
Format : FLAC
Format/Info : Free Lossless Audio Codec
Codec ID : A_FLAC
Duration : 1 min 33 s
Bit rate mode : Variable
Channel(s) : 2 channels
Channel layout : L R
Sampling rate : 48.0 kHz
Bit depth : 24 bits
Compression mode : Lossless
Delay relative to video : 7 ms
Title : sailor moon memories opening 2nd version ???????
Writing library : Lavc59.37.100 flac
Language : Japanese
Default : Yes
Forced : No
Description : Source: https://www.youtube.com/watch?v=cBRYceV7b1Q
MD5 of the unencoded content : 607F9D057DF9828B6F690959F8D2DF5A

Audio #2
ID : 3
Format : FLAC
Format/Info : Free Lossless Audio Codec
Codec ID : A_FLAC
Duration : 1 min 32 s
Bit rate mode : Variable
Channel(s) : 2 channels
Channel layout : L R
Sampling rate : 48.0 kHz
Bit depth : 24 bits
Compression mode : Lossless
Delay relative to video : 300 ms
Title : Opening sailor moon MemorieS
Writing library : Lavc59.37.100 flac
Language : Spanish
Default : No
Forced : No
Description : Source: https://www.youtube.com/watch?v=hj_xSv0F76Q
MD5 of the unencoded content : 3B1C0B135C36191EEDAB8DC56F3A9827

Audio #3
ID : 4
Format : FLAC
Format/Info : Free Lossless Audio Codec
Codec ID : A_FLAC
Duration : 1 min 33 s
Bit rate mode : Variable
Channel(s) : 2 channels
Channel layout : L R
Sampling rate : 48.0 kHz
Bit depth : 24 bits
Compression mode : Lossless
Delay relative to video : 7 ms
Title : sailor moon memories opening
Writing library : Lavc59.37.100 flac
Language : Spanish
Default : Yes
Forced : No
Description : Source: https://www.youtube.com/watch?v=coShQEyM0ic
MD5 of the unencoded content : 367A36320E6926D479B158789DE87621


1 change: 1 addition & 0 deletions audios/youtube:cBRYceV7b1Q
26 changes: 26 additions & 0 deletions audios/youtube:cBRYceV7b1Q.mediainfo.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
General
Complete name : youtube:cBRYceV7b1Q
Format : WebM
Format version : Version 4
File size : 1.34 MiB
Duration : 1 min 33 s
Overall bit rate : 120 kb/s
Writing application : google/video-file
Writing library : google/video-file
FileExtension_Invalid : webm

Audio
ID : 1
Format : Opus
Codec ID : A_OPUS
Duration : 1 min 33 s
Channel(s) : 2 channels
Channel layout : L R
Sampling rate : 48.0 kHz
Bit depth : 16 bits
Compression mode : Lossy
Language : Spanish
Default : Yes
Forced : No


1 change: 1 addition & 0 deletions audios/youtube:coShQEyM0ic
25 changes: 25 additions & 0 deletions audios/youtube:coShQEyM0ic.mediainfo.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
General
Complete name : youtube:coShQEyM0ic
Format : WebM
Format version : Version 4
File size : 1.20 MiB
Duration : 1 min 33 s
Overall bit rate : 108 kb/s
Writing application : google
Writing library : google
FileExtension_Invalid : webm

Audio
ID : 1
Format : Opus
Codec ID : A_OPUS
Duration : 1 min 33 s
Channel(s) : 2 channels
Channel layout : L R
Sampling rate : 48.0 kHz
Compression mode : Lossy
Language : English
Default : Yes
Forced : No


1 change: 1 addition & 0 deletions audios/youtube:hj_xSv0F76Q
26 changes: 26 additions & 0 deletions audios/youtube:hj_xSv0F76Q.mediainfo.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
General
Complete name : youtube:hj_xSv0F76Q
Format : WebM
Format version : Version 4
File size : 1.21 MiB
Duration : 1 min 36 s
Overall bit rate : 105 kb/s
Writing application : google/video-file
Writing library : google/video-file
FileExtension_Invalid : webm

Audio
ID : 1
Format : Opus
Codec ID : A_OPUS
Duration : 1 min 36 s
Channel(s) : 2 channels
Channel layout : L R
Sampling rate : 48.0 kHz
Bit depth : 16 bits
Compression mode : Lossy
Language : Spanish
Default : Yes
Forced : No


90 changes: 90 additions & 0 deletions make.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,90 @@
#!/usr/bin/env sh

### Script: make.sh
##
## All Sailor Moon Memories の動画を作成する。
##
## Metadata:
##
## id - 69fc451a-d276-4fc4-9f7c-cff01b99319b
## author - <qq542vev at https://purl.org/meta/me/>
## version - 1.0.0
## date - 2023-04-09
## since - 2023-04-09
## copyright - Copyright (C) 2023-2023 qq542vev. Some rights reserved.
## license - <CC-BY at https://creativecommons.org/licenses/by/4.0/>
## package - all-sailor-moon-memories
##
## See Also:
##
## * <Project homepage at https://github.com/qq542vev/all-sailor-moon-memories>
## * <Bag report at https://github.com/qq542vev/all-sailor-moon-memories/issues>

set -efu
umask '0022'
readonly "LC_ALL_ORG=${LC_ALL-}"
LC_ALL='C'
IFS=$(printf ' \t\n_'); IFS="${IFS%_}"
PATH="${PATH-}${PATH:+:}$(command -p getconf 'PATH')"
UNIX_STD='2003' # HP-UX POSIX mode
XPG_SUS_ENV='ON' # AIX POSIX mode
XPG_UNIX98='OFF' # AIX UNIX 03 mode
POSIXLY_CORRECT='1' # GNU Coreutils POSIX mode
COMMAND_MODE='unix2003' # macOS UNIX 03 mode
export 'LC_ALL' 'IFS' 'PATH' 'UNIX_STD' 'XPG_SUS_ENV' 'XPG_UNIX98' 'POSIXLY_CORRECT' 'COMMAND_MODE'

readonly 'downloads=
youtube:cBRYceV7b1Q=https://www.youtube.com/watch?v=cBRYceV7b1Q
youtube:hj_xSv0F76Q=https://www.youtube.com/watch?v=hj_xSv0F76Q
youtube:coShQEyM0ic=https://www.youtube.com/watch?v=coShQEyM0ic
'
readonly 'options=--abort-on-error --continue --ignore-config --no-cache-dir --retries 100'
readonly 'format=%(extractor)s:%(id)s.%(format_id)s.%(ext)s'

mkdir -p -- 'videos' 'audios'

for line in ${downloads}; do
name="${line%%=*}"
url="${line#*=}"

if [ '!' -f "videos/${name}" ]; then
yt-dlp ${options} --format 'bestvideo[width=640][height=480]' --output "videos/${format}" -- "${url}"
rm -fr -- "videos/${name}"
ln -s -- "$(yt-dlp ${options} --format 'bestvideo[width=640][height=480]' --output "${format}" --get-filename -- "${url}")" "videos/${name}"
fi

if [ '!' -f "audios/${name}" ]; then
yt-dlp ${options} --format 'bestaudio' --output "audios/${format}" -- "${url}"
rm -fr -- "audios/${name}"
ln -s -- "$(yt-dlp ${options} --format 'bestaudio' --output "${format}" --get-filename -- "${url}")" "audios/${name}"
fi

videos="${videos-} -i videos/${name}"
audios="${audios-} -i audios/${name}"
done

ffmpeg ${videos} ${audios} \
-filter_complex '
color=s=1280x960:c=black[background];
[1:v]trim=start=02.16666667:end=01\\:34.2,setpts=PTS-STARTPTS+0.3/TB[trimmed_v];
[4:a]atrim=start=02.16666667:end=01\\:34.2,asetpts=PTS-STARTPTS+0.3/TB[trimmed_a];
[1:v]trim=start=00:end=02,setpts=PTS-STARTPTS+7/TB[logo];
[background][0:v]overlay=x=0:y=0[1video];
[1video][trimmed_v]overlay=x=640:y=0[2video];
[2video][2:v]overlay=x=0:y=480[3video];
[3video][logo]overlay=x=640:y=480
' \
-map '3:a' -map '[trimmed_a]' -map '5:a' \
-c:v libx264 -r 30 -fps_mode cfr -crf 0 -qp 0 -preset placebo -tune animation \
-c:a flac -ar 48000 -ac 2 -compression_level 12 \
-metadata 'title=All Sailor Moon Memories' \
-metadata:s:a:0 'language=jpn' \
-metadata:s:a:0 'title=sailor moon memories opening 2nd version セーラームーン' \
-metadata:s:a:0 'description=Source: https://www.youtube.com/watch?v=cBRYceV7b1Q' \
-metadata:s:a:1 'language=spa' \
-metadata:s:a:1 'title=Opening sailor moon MemorieS' \
-metadata:s:a:1 'description=Source: https://www.youtube.com/watch?v=hj_xSv0F76Q' \
-metadata:s:a:2 'language=spa' \
-metadata:s:a:2 'title=sailor moon memories opening' \
-metadata:s:a:2 'description=Source: https://www.youtube.com/watch?v=coShQEyM0ic' \
-to '01:33' all-sailor-moon-memories.mkv
38 changes: 38 additions & 0 deletions readme.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
<!-- Document: readme.md
All Sailor Moon Memories のマニュアル
Metadata:
id - 4d5beda3-572f-471f-8c96-67e994c385b9
author - <qq542vev at https://purl.org/meta/me/>
version - 1.0.0
date - 2023-04-09
since - 2023-04-09
copyright - Copyright (C) 2023-2023 qq542vev. Some rights reserved.
license - <CC-BY at https://creativecommons.org/licenses/by/4.0/>
package - all-sailor-moon-memories
See Also:
* <Project homepage at https://github.com/qq542vev/all-sailor-moon-memories>
* <Bag report at https://github.com/qq542vev/all-sailor-moon-memories/issues>
-->

# All Sailor Moon Memories

All Sailor Moon Memories は Sailor Moon Memories の各動画を一覧表示した動画を作成する試みです。Sailor Moon Memoriesは [fabzt10] (https://www.youtube.com/channel/UCi30Verb3Spu3oQiKnlmsqg) さんによって作成されたセーラームーンを題材にした幾つかの AMV(Anime Music Video) です。

現状では以下の3つの動画を分割して一覧表示します。

* 左上 - [sailor moon memories opening 2nd version セーラームーン](https://www.youtube.com/watch?v=cBRYceV7b1Q)
* 右上 - [Opening sailor moon MemorieS](https://www.youtube.com/watch?v=hj_xSv0F76Q)
* 左下 - [sailor moon memories opening](https://www.youtube.com/watch?v=coShQEyM0ic)

# 動画を作成する

動画を作成するにはご使用のコンピューターに [yt-dlp](https://github.com/yt-dlp/yt-dlp)[FFmpeg](https://ffmpeg.org/) がインストールされている必要があります。可能な限り最新版を使用してください。2023年04月19日現在、yt-dlp は [2023.03.04](https://github.com/yt-dlp/yt-dlp/releases/tag/2023.03.04)、FFmpeg は [5.1.1-static](https://ffmpeg.org/download.html) での組み合わせで動作することを確認しています。

[`make.sh`](make.sh) をダウンロードして、実行してください。YouTube から動画をダウンロードします。ダウンロードされた動画はカレントディレクトリの `./vidoes`, `./audios` 内に保存されます。その後、動画の作成を開始します。動画の作成(主にエンコード)には非常に時間がかかります。

作成された動画はカレントディレクトリ内の `all-sailor-moon-memories.mkv` として保存されます。作成された動画の構成は、Matroska Video + H.264 + FLAC(3トラック)です。詳細は Mediainfo の[出力結果](all-sailor-moon-memories.mkv.mediainfo.txt)を参照してください。
1 change: 1 addition & 0 deletions videos/youtube:cBRYceV7b1Q
30 changes: 30 additions & 0 deletions videos/youtube:cBRYceV7b1Q.mediainfo.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
General
Complete name : youtube:cBRYceV7b1Q
Format : WebM
Format version : Version 4
File size : 5.30 MiB
Duration : 1 min 33 s
Overall bit rate : 474 kb/s
Frame rate : 30.000 FPS
Writing application : google/video-file
Writing library : google/video-file
FileExtension_Invalid : webm

Video
ID : 1
Format : VP9
Codec ID : V_VP9
Duration : 1 min 33 s
Bit rate : 448 kb/s
Width : 640 pixels
Height : 480 pixels
Display aspect ratio : 4:3
Frame rate mode : Constant
Frame rate : 30.000 FPS
Bits/(Pixel*Frame) : 0.049
Stream size : 5.01 MiB (95%)
Language : English
Default : Yes
Forced : No


1 change: 1 addition & 0 deletions videos/youtube:coShQEyM0ic
30 changes: 30 additions & 0 deletions videos/youtube:coShQEyM0ic.mediainfo.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
General
Complete name : youtube:coShQEyM0ic
Format : WebM
Format version : Version 4
File size : 6.41 MiB
Duration : 1 min 33 s
Overall bit rate : 578 kb/s
Frame rate : 30.000 FPS
Writing application : google
Writing library : google
FileExtension_Invalid : webm

Video
ID : 1
Format : VP9
Codec ID : V_VP9
Duration : 1 min 33 s
Bit rate : 548 kb/s
Width : 640 pixels
Height : 480 pixels
Display aspect ratio : 4:3
Frame rate mode : Constant
Frame rate : 30.000 FPS
Bits/(Pixel*Frame) : 0.059
Stream size : 6.08 MiB (95%)
Language : English
Default : Yes
Forced : No


1 change: 1 addition & 0 deletions videos/youtube:hj_xSv0F76Q
Loading

0 comments on commit 08b04b0

Please sign in to comment.