[Lazarus] Using Chrome API in Lazarus - possible on Linux?

Bo Berglund bo.berglund at gmail.com
Sun Dec 6 16:50:54 CET 2020


On Sun, 6 Dec 2020 10:19:58 -0500, wkitty42--- via lazarus
<lazarus at lists.lazarus-ide.org> wrote:

>On 12/6/20 3:34 AM, Bo Berglund via lazarus wrote:
>> But it clearly should be possible since the browsers (both Chrome and
>> Firefox) have the ability of moving backwards inside the stream and
>> view stuff that was played say a couple of hours ago.
>
>
>i'm pretty sure this is allowed or not by the provider in their container used 
>to present the video stream on their page... i say this because i don't see any 
>way of backing up in time on twitch.tv... there is no time progression bar for 
>the stream like on YT... twitch does have a clip function that allows you to go 
>back a few minutes, grab like 60 seconds max in the last maybe 5 minutes and 
>save it to a clip... the only way further back, AFAIK, is to wait for the stream 
>to end and then play back the VOD (video on demand) of the stream...

The "rewind" possibility might be limited to some video sources
only...
But it is easily seen if it is available by opening the stream in say
Chrome or FFx and see if one can pull the progress to the left into
earlier times.

I have looked at twitch and xfinity services but there I am not even
able to download *anything* from the command line in Linux.
They require a login, which I don't know how to set.

>i think if you capture the live stream to a buffer file of some type, then you 
>can go back and forth in your buffer but no further back than where you 
>connected to the stream and started your capture...

For the streams I want to capture videos from I have now used
youtube-dl calls to save the stream as-is from now until as long as it
goes. Turns out that these recordings last for exactly 6 hours, then
youtube-dl ends the download even if the stream continues.

So I set up at jobs spaced 6 hours apart to download the stream as it
happens in 6h chunks, as a last resort. These jobs calls a script I
have created, which in turn calls youtube-dl, which in the end calls
ffmpeg to do the actual job.

But then I cannot get the video until the current download process
ends so I can extract it from the 6h mp4 file, which is a .mp4.part
file until it is finished at which time it converts to mp4.

I want to get a specific time slot out of a running youtube stream if
possible...

(And it *is* possible on Windows using the program I found online, but
that is not available for Linux, only Windows and with Chrome
installed.)

Furhermore, I like to be able to tweak such tools to my liking (using
Lazarus) so I need the sourcecode, which is not available.

I had a look at how youtube-dl does its thing by using 'ps aux' while
it is downloading the stream.
Turns out it launches ffmpeg via python for this forward going
download with a command line that is almost 1.4 kbytes in length!

Cannot understand how they figured that one out...


-- 
Bo Berglund
Developer in Sweden



More information about the lazarus mailing list