News for hackers. Stuff that matters.
Re:How journalists use youtube-dl by _flux on Tuesday October 27, 2020 @05:01AM (#24905591)
Exactly, Google has that player, but to replicate the same effect for offline playing you would need to play a playlist or a DASH video and multiple fragments.

But I grant it's technically possible to do with a single MPEG file, just not trivial. You would need to prepend the advertisement to the video bitstream (re-encoded with same parameters such as width, height, FPS, intra picture interval) and then do the same for audio, while ensuring the video/audio synchronization is kept intact (MPEG edit lists are not well-supported by players, such as by ffmpeg), while preferably not re-encoding the actual video. A bit more complicated to do the insertion in the middle of the file.

It's possible to do, but I don't think it's something that any off-the-shelf tools actually do.

Re:How journalists use youtube-dl by hnlmorg on Tuesday October 27, 2020 @09:01AM (#24906955)
Yeah there are off the shelf tools available to the broadcasting industry. But these things are designed to tens of streams, not millions. As usual, it's a scale problem rather than a code problem.