FROM ubuntu:latest | |
RUN apt-get update && \ | |
apt-get -y upgrade && \ | |
apt-get install -y git libreadline-dev libconfig-dev libssl-dev lua5.2 liblua5.2-dev libevent-dev libjansson-dev libpython-dev make | |
RUN git clone --recursive https://github.com/vysheng/tg.git && \ | |
cd /tg && \ | |
./configure && \ | |
make -j5 |
// ==UserScript== | |
// @name MosMetroV2.js | |
// @description This script skips annoying quizes and full screen ads on https://auth.wi-fi.ru | |
// @author Dmitry Karikh <[email protected]> (https://github.com/mosmetro-android) | |
// @version 2 | |
// @grant none | |
// @include *://auth.wi-fi.ru/auth* | |
// ==/UserScript== | |
(function () { |
-- autosave.lua | |
-- | |
-- Periodically saves "watch later" data during playback, rather than only saving on quit. | |
-- This lets you easily recover your position in the case of an ungraceful shutdown of mpv (crash, power failure, etc.). | |
-- | |
-- You can configure the save period by creating a "lua-settings" directory inside your mpv configuration directory. | |
-- Inside the "lua-settings" directory, create a file named "autosave.conf". | |
-- The save period can be set like so: | |
-- | |
-- save_period=60 |
-- keepsync.lua | |
-- | |
-- Attempts to maintain initial offset of the live stream in case of | |
-- network or hardware lags by slightly speeding up playback until | |
-- synchronization is restored. | |
-- | |
-- Initial offset is calculated right at the start of playback. If playback | |
-- immediately starts to lag, you can increase offset by pressing Shift+LEFT. | |
-- If your connection to stream source is good enough, you can also try to | |
-- decrease offset by pressing Shift+RIGHT. Both hotkeys are changing offset |
When I download streams from Twitch, I remux them into MP4 because MPEG-TS doesn't support -movflags faststart
, is not supported by HTML5 players and can't be uploaded directly to YouTube. Sometimes this process changes framerate of the video stream. Incorrect FPS somehow corrupts the video during processing on YouTube, which leads to horrible audio desynchronization on any resolutions below 1080p60.
My working theory is that Twitch doesn’t fill the voids in the stream when frames are lost. This is not critical for MPEG-TS and FLV containers, however, the MP4 container tries to compute the global average FPS. YouTube somehow relies on the global FPS during video processing, which leads to a decrease in the duration of the video stream, and causes its desynchronization with audio.
Good video (60 fps):
# docker build -t thedrhax/mediamtx . | |
FROM bluenviron/mediamtx | |
FROM alpine:3.19 | |
RUN apk --no-cache add ffmpeg curl jq | |
COPY --from=0 /* / | |
ENTRYPOINT ["/mediamtx"] |