Skip to content

armgit / my-yt

Public Imported from GitHub
0

A clean and minimal youtube frontend, without all the ads and whistles

JavaScript

fix: faster video trascoding

Christian Fei66bcfbad9060
diff --git a/lib/youtube.js b/lib/youtube.js
index 7c3419d..61c6aa8 100644
--- a/lib/youtube.js
+++ b/lib/youtube.js
@@ -28,7 +28,8 @@ export async function downloadVideo(id, repo, callback = () => {}) {
if (process.env.SKIP_TRANSCODING !== 'true') {
try {
console.log(`transcoding video ${id} to h264`)
- exec(`ffmpeg -i ${location} -vcodec libx264 -acodec aac -movflags +faststart ${location.replace(format, `-h264.${format}`)}`, (error) => {
+ // exec(`ffmpeg -i ${location} -vcodec libx264 -acodec aac -movflags +faststart ${location.replace(format, `-h264.${format}`)}`, (error) => {
+ exec(`ffmpeg -i ${location} -c:v libx264 -preset veryfast -crf 28 -x264-params opencl=true -vf "format=yuv420p" -profile:v main -movflags +faststart -c:a copy ${location.replace(format, `-h264.${format}`)}`, (error) => {
if (!error) {
console.log(`succcessfully transcoded video ${id} to h264`)
return execSync(`mv ${location.replace(format, `-h264.${format}`)} ${location}`)
diff --git a/x264_lookahead.clbin b/x264_lookahead.clbin
new file mode 100644
index 0000000..826f9e8
Binary files /dev/null and b/x264_lookahead.clbin differ