Page 2 of 2

Re: libVLC in pb

Posted: Fri Apr 29, 2022 9:31 pm
by RSrole
Thanks, you nailed it. No crashes now. The rest is up to me.

Re: libVLC in pb

Posted: Fri May 20, 2022 10:33 pm
by novablue
Is it possible to play a video from memory instead from a file?

Re: libVLC in pb

Posted: Sun May 22, 2022 1:54 pm
by infratec
Yes, it is possible.

But you have to use the media api.

https://stackoverflow.com/questions/312 ... error-main

Re: libVLC in pb

Posted: Sun May 22, 2022 11:09 pm
by novablue
infratec wrote: Sun May 22, 2022 1:54 pm Yes, it is possible.

But you have to use the media api.

https://stackoverflow.com/questions/312 ... error-main
Thank you but unfortunately a little too complex for me. It would be great if someone with the know-how could implement it for the use in Purebasic.

Re: libVLC in pb

Posted: Mon Jul 11, 2022 2:57 pm
by elfo116
Hello everyone, does anyone know how to change the playback speed of a video using libVLC?

Re: libVLC in pb

Posted: Mon Sep 19, 2022 10:29 am
by StephanB
Hello,

is there a way to find out when the playback has finished?
I would then like to automatically close the VLC gadget.

Thanks

Re: libVLC in pb - learning...

Posted: Wed May 17, 2023 4:57 pm
by gregreen
Tremendous help from Justin on the WMP, but I am now very interested in learning more about libVLC for pb. I am in way over my head, but very interested in learning as I have some ideas about playing video that seem possible with the libVLC architecture. Would the book by Martin Vinkel be helpful? There are no pb examples mentioned. I too would like to control speed and playback of multiple streams similar to a video wall but different. Also image overlays and experimenting with reverse playback (perhaps switching to a mp4 that was encoded in reverse? Ideally, I would like to create an Abacus type playback that was from the olden days if anyone remembers.

So much to learn... it is daunting and any guidance here would be supremely appreciated! Thank you all so much!

Re: libVLC in pb

Posted: Fri May 19, 2023 7:08 pm
by Piero
Did somebody say ffmpeg, ffplay (mplayer) handbrake, ocenaudio (audacity) shutter encoder and stuff? (these are just multimedia tips, often accessible via command-line)

Re: libVLC in pb

Posted: Fri May 19, 2023 10:26 pm
by gregreen
Yes, ffmpeg is awesome but wouldn't know exactly how to implement with purebasic. VLClib so far is very interesting. I'll keep plugging away! Thanks for the tips Piero!
Love the forum. I have zillions of questions but I try to figure out on my own as much as I can before asking. There is so much to learn!

Re: libVLC in pb

Posted: Tue May 23, 2023 4:05 pm
by Piero
gregreen wrote: Fri May 19, 2023 10:26 pmffmpeg is awesome
I saw mplayer (older stuff) and ffplay ("part of" ffmpeg project...) used in open source projects (like subtitlers), and you can install full binaries or "linked to libraries" versions... so, in case of problems, see if you can use ffmpeg/ffplay libraries (I'm sure ppl here will help you, if it's possible…)
Anyway VLC reads almost anything in theory...
You are so right; there's so much stuff to learn... :)

Re: libVLC in pb

Posted: Tue Sep 19, 2023 3:25 pm
by Rings
anyone did a port for linux ?

Re: libVLC in pb (Windows Only)

Posted: Fri Nov 03, 2023 10:01 pm
by ccode_new
Hi!

I've now tried "libvlc" to play videos.

The example from collectordave works very well, but you have to adapt the "vlc_createplayer" procedure for Linux or MacOS.

Code: Select all

CompilerSelect #PB_Compiler_OS
  CompilerCase #PB_OS_Windows
    libvlc_media_player_set_hwnd( \libvlc_media_player, hwnd)
  CompilerCase #PB_OS_MacOS
    libvlc_media_player_set_nsobject(\libvlc_media_player, hwnd)
  CompilerCase #PB_OS_Linux
    libvlc_media_player_set_xwindow(\libvlc_media_player, hwnd)
CompilerEndSelect

Re: libVLC in pb (Windows Only)

Posted: Sat Nov 04, 2023 9:12 pm
by Patrice Terrier
FFmpeg offers a direct alternative to VLC

I have written a complete FFmpeg encapsulation with WinDev, but this could be done with any programming language.
The link to the FFmpeg documentation is provided here
http://www.objreader.com/index.php?topic=358.0

And the TMDB version, using a specific 64-bit DLL written in C++ to query the Movie database from the internet.
http://www.objreader.com/index.php?topic=359.0

Re: libVLC in pb (Windows Only)

Posted: Tue Feb 04, 2025 9:13 pm
by infratec
Since you can not test the streaming url stuff with youtube, here is an example with the VideoLan examples:

Code: Select all

;
; https://streams.videolan.org/streams/
;

EnableExplicit

#URL$ = "https://streams.videolan.org/streams/mp4/GHOST_IN_THE_SHELL_V5_DOLBY%20-%203.m4v"

#Width = 1600 / 2
#Height = 900 / 2

IncludeFile "vlc.pb"

CompilerIf Not #PB_Compiler_Thread
  CompilerError "You have to enable thread save!"
CompilerEndIf



Define *vlc.vlc

If vlc_loadlibvlc("C:\Program Files\VideoLAN\VLC\libvlc.dll") ; select vlc dll
  OpenWindow(0, 0, 0, #Width, #Height, "")
  CanvasGadget(1, 0, 0, WindowWidth(0), WindowHeight(0))
  
  *vlc = vlc_createplayer(GadgetID(1), #True)
  ;vlc_showdebug(*vlc, #False)
  vlc_setvolume(*vlc, 80)
  vlc_play(*vlc, #URL$) ; not work for youtube video
  ;vlc_addplaylist(*vlc, #URL$)
  ;vlc_playplaylist(*vlc)
  
  While WaitWindowEvent() <> #PB_Event_CloseWindow
  Wend
  
  vlc_freeplayer(*vlc)
Else
  Debug "Was not able to load libvlc.dll"
EndIf

Re: libVLC in pb (Windows Only)

Posted: Wed Feb 05, 2025 12:59 pm
by tj1010
YT transcodes all uploads to VP9 and Opus. They used HLS up till recently when they moved to MPEG-DASH. They still try to use JS generation as a form of DRM but you can still get active-session URLs to feed to ffmpeg via F12>Network in Chromium browsers. To use as input with ffmpeg you need to use protocol_whitelist

I think they're not using AV1 because Safari and Apple hardware not having a software encoder/decoder across all chips.

Amazon, HULU, Netflix and others were still using HLS, but they all generate m3u8 off session parameters usually in "minimized" JS.

Also do we still need to use named pipes for ffmpeg because of stderr?