4 ms·
This is cool. I am constantly impressed by ffmpeg and it capabilities. Last week I was able to make it act as a proxy for live streaming video that reduced th
by satori99 8y ago
This is cool.
I am constantly impressed by ffmpeg and it capabilities.
Last week I was able to make it act as a proxy for live streaming video that reduced the volume of ad-breaks by 50% automatically by listening for SCTE35 cue packets in the stream and adjusting a volume filter accordingly.
My housemate has a reality TV addiction, and the ads were getting on my nerves. I just intended to see if it was possible, but I had a POC running in about 1/2 an hour.
- zeotroph 8y agoA neat subtitle feature I found out mpv has, but no other video player: Hide those parts of the subtitle which are mainly for those with impaired hearing like '[loud noise]' etc, but keep the rest: `mpv --sub-filter-sdh ...` That logic could probably be extracted into a separate subtitle filtering tool.
- JorgeGT 8y agoIf I remember correctly SubtitleEdit (https://github.com/SubtitleEdit/subtitleedit https://github.com/SubtitleEdit/subtitleedit) had such a tool for removing the hearing-impaired bits.
- gsich 8y agostill has. I use it for every subtitle, gets rid of most common errors too.
- aasasd 8y agoWhen going through Miami Vice I discovered that the SDH parts sometimes also act as notes for the culture-impaired. (Song titles and lyrics were a particularly nice touch, though not strictly SDH.) And for English-as-second-language folks, it's occasionally curious which expressions are used in the SDH descriptions.
- jakecopp 8y agoThis sounds amazing! Did you use a USB TV tuner or an online source? Is there chance you could open source the code?
- satori99 8y agoI used an online stream source; A HLS stream that one of my local TV stations broadcasts online. My method will only work with streams that have SCTE35 packets embedded. This is normally used for local ad insertion on cable networks, so it may not always be available on OTA streams. There is not much code because it is mostly ffmpeg that does the work. I used nodejs to manage an ffmpeg child process, read its output streams (one stream over a unix domain socket for the video, and the stdout stream for the SCTE35 packets) and pipe them to a HTTP client. My code parses the SCTE packets and then sends commands into the running ffmpeg child process to change the audio levels. I am happy to share it when I get home in a few hours.
- satori99 8y agohttps://gist.github.com/satori99/2cb06938bfe8532ecc00e60906509052 https://gist.github.com/satori99/2cb06938bfe8532ecc00e609065... Keep in mind it's PoC code, I stopped when it worked the first time :P