Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / lazarus / 2020-12

Using Chrome API in Lazarus - possible on Linux?

6 messages · 4 people ·

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Bo Berglund

I have been looking for ways to create a video downloader for myself using FPC/Lazarus. I already created a video editor using PasLibVlc and ffmpeg and it works pretty well for what I want to do. It needs VLC to be installed in order to show videos and adjust playback speed and audio sync etc.

I also would like to make a video downloader with functions not found in programs like for example youtube-dl, specifically being able to download from a streaming site starting from past times.

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.

Now I have seen a project on-line which uses C# and apparently the Chrome API (since it is a requirement to have Chrome installed). But the author has not published any sources so I cannot see *how* it is being done...
And I cannot use that product because I need the downloader to be running on Linux.

Is there someone here who has used the Chrome API with Lazarus for anything video related and is willing to share?

Bo Berglund Developer in Sweden

Reply by email

Michael Van Canneyt
to Bo Berglund
Bo Berglund wrote 23 lines
I have been looking for ways to create a video downloader for myself using FPC/Lazarus. I already created a video editor using PasLibVlc and ffmpeg and it works pretty well for what I want to do. It needs VLC to be installed in order to show videos and adjust playback speed and audio sync etc. I also would like to make a video downloader with functions not found in programs like for example youtube-dl, specifically being able to download from a streaming site starting from past times. 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. Now I have seen a project on-line which uses C# and apparently the Chrome API (since it is a requirement to have Chrome installed). But the author has not published any sources so I cannot see *how* it is being done... And I cannot use that product because I need the downloader to be running on Linux. Is there someone here who has used the Chrome API with Lazarus for anything video related and is willing to share?

I never managed to get the Chrome API to work on linux, but an effort is currently underway to make the chromium browser available in Lazarus on all supported platforms.

Michael.

Reply by email

Unknown author
to Bo Berglund: I have been looking for ways to create a video downloader for myself using FPC/Lazarus. I…
Bo Berglund 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...

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...

NOTE: No off-list assistance is given without prior approval. *Please keep mailing list traffic on the list where it belongs!*

Reply by email

Bo Berglund
to Unknown author
wkitty42--- wrote 13 lines
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

Reply by email

Don Siders
Show quoted text 6 lines
> Is there someone here who has used the Chrome API with > Lazarus for anything video related and is willing to share? I never managed to get the Chrome API to work on linux, but an effort is currently underway to make the chromium browser available in Lazarus on all supported platforms.

@Michael:

Is that effort some how related to CEF (Chromium Embedded Framework)?

Reply by email

Michael Van Canneyt
to Don Siders
Don Siders wrote 10 lines
>> Is there someone here who has used the Chrome API with >> Lazarus for anything video related and is willing to share? > I never managed to get the Chrome API to work on linux, > but an effort is currently underway to make the chromium > browser available in Lazarus on all supported platforms. @Michael: Is that effort some how related to CEF (Chromium Embedded Framework)?

Yes.

Michael.

Reply by email