Sign in Join

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

Mailing lists / lazarus / 2015-02

Play video files in a row without delay

14 messages · 4 people · –

Reply by email Subscribe to this list Your subscription

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

aradeonas

Hi,
I am looking for a way to play 2 video in a row without any delay (or very tiny delay) when changing files.
I had 1 mp4 file and with ffmpeg I split it into 2 file and now I want to add them in playlist and play them but I don't want user feel changing video but when I test it because of loading file there is a delay.
I think about stream second file into memory before first file end. How can I do this?
I tested LibVLC and read Play a Video from MemoryStream, Using FFMpeg but still no luck.
PS,Files are small (less than 5mb).

Regards,
Ara

http://www.fastmail.com - Access all of your messages and folders wherever you are

Reply by email

Michael Thompson
to aradeonas

G'day,

Hmmm, this was fairly well documented in the Microsoft documentation for DirectShow. If you're on Windoze and don't mind DirectShow, I can dig that out for you.

As for VLC/Mplayer, I have no direct experience. I can only suggest you try playlists, seems to me they may help...

Mike

On 05:42, Thu, 19/02/2015 aradeonas wrote:

Hi,
I am looking for a way to play 2 video in a row without any delay (or very tiny delay) when changing files.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lazarus.freepascal.org/pipermail/lazarus/attachments/20150218/d119ec07/attachment.html>

Reply by email

aradeonas
to Michael Thompson

Hi,

Great.Its kind of you. About VLC/Mplayer the problem is when a file finished there is delay to read second file and then play.I tried passing from memory but for both of them it seems there is no way.Also I tried to making to player and and open first and second file together and pause second and when first finished then play second.Its seems good but there is a problem that in VLC and Mplayer I cant find a way to change display handle in the middle of play.

Regards, Ara

Michael Thompson wrote
G'day,
Hmmm, this was fairly well documented in the Microsoft documentation for DirectShow. If you're on Windoze and don't mind DirectShow, I can dig that out for you.
As for VLC/Mplayer, I have no direct experience. I can only suggest you try playlists, seems to me they may help...
Mike
On 05:42, Thu, 19/02/2015 aradeonas wrote:
> Hi, >

I am looking for a way to play 2 video in a row without any delay (or

>

very tiny delay) when changing files.

>
-- _________________________________________________ Lazarus mailing list http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
http://www.fastmail.com - A no graphics, no pop-ups email service -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.lazarus.freepascal.org/pipermail/lazarus/attachments/20150219/d7019a3a/attachment.html>

Reply by email

Graeme Geldenhuys
to aradeonas: I am looking for a way to play 2 video in a row without any delay (or very tiny delay)…
aradeonas wrote
I tested LibVLC and read Play a Video from MemoryStream, Using FFMpeg but still no luck.

Not sure about videos, but we have played multiple mp3 files in succession with the vlc wrapper component from FPC (not sure if that is the same as LibVLC you speak of), to make spoken sentences. We used this under Linux and Windows, and there was no audible gaps between mp3 files.

Regards,
- Graeme -

fpGUI Toolkit - a cross-platform GUI toolkit using Free Pascal http://fpgui.sourceforge.net/

Reply by email

aradeonas
to Graeme Geldenhuys

I Used PasLibVLC[1] but even with mini video files(less than 5mb like a audio file but there is delay)its good to know that I hear it possible.I think you used default FPC VLC wrapper but I think there is not a big difference. Graeme can you give me an example?In any wrapper or way.

Regards, Ara

Graeme Geldenhuys wrote 21 lines
On 2015-02-18 21:42, aradeonas wrote: > I tested LibVLC and read Play a Video from MemoryStream, Using > FFMpeg but still no luck. Not sure about videos, but we have played multiple mp3 files in succession with the vlc wrapper component from FPC (not sure if that is the same as LibVLC you speak of), to make spoken sentences. We used this under Linux and Windows, and there was no audible gaps between mp3 files. Regards, - Graeme - -- fpGUI Toolkit - a cross-platform GUI toolkit using Free Pascal http://fpgui.sourceforge.net/ -- _______________________________________________ Lazarus mailing list http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus

Links:

1. http://prog.olsztyn.pl/paslibvlc/

http://www.fastmail.com - Same, same, but different... -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.lazarus.freepascal.org/pipermail/lazarus/attachments/20150219/0f4d2a23/attachment.html>

Reply by email

John Briggs

As mentioned by Mike earlier generate a plaaylist of the videos you want to watch and vlc/mplayer will play them for you with little or no delay between videos.

John

Reply by email

aradeonas
to John Briggs

Thank you Mike and John.

But I test playlists with VLC,mplayer and ffplay and problem is after first file finish thery is a 0.5 second delay for opening second file and its not good for project because files are tiny videos(less than 5mb and 4 seconds) and this delay is not need to read second file before first one or pass every frame at a time to player.

Regards,
Ara

John Briggs wrote 12 lines
As mentioned by Mike earlier generate a plaaylist of the videos you want to watch and vlc/mplayer will play them for you with little or no delay between videos. John -- _______________________________________________ Lazarus mailing list http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
http://www.fastmail.com - A fast, anti-spam email service.

Reply by email

Graeme Geldenhuys
to aradeonas: I Used PasLibVLC[1] but even with mini video files(less than 5mb like a audio file but…
aradeonas wrote
Graeme can you give me an example?In any wrapper or way.

I believe <fpc>/packages/libvlc/example/testvlc.pp should give you what you want.

I've also got a GUI VLC video player included with fpGUI in <fpgui>/examples/gui/video_vlc/ which uses the same libvlc code, but just included as part of fpGUI in the <fpgui>/src/3rdparty/libvlc/ directory.

Regards,
- Graeme -

fpGUI Toolkit - a cross-platform GUI toolkit using Free Pascal http://fpgui.sourceforge.net/

Reply by email

aradeonas
to Graeme Geldenhuys

Thank you Graeme,

I tested PasLibVLC but opening second file after first file play finished is cause of delay and I need a way to read file before first file finished and I done that with VLC with creating 2 player)but problem is I could not to play both player in one handle. I will this example too and if you have idea about that problem please let me know.

Regards,
Ara

Graeme Geldenhuys wrote 24 lines
On 2015-02-19 09:33, aradeonas wrote: > Graeme can you give me an example?In any wrapper or way. I believe <fpc>/packages/libvlc/example/testvlc.pp should give you what you want. I've also got a GUI VLC video player included with fpGUI in <fpgui>/examples/gui/video_vlc/ which uses the same libvlc code, but just included as part of fpGUI in the <fpgui>/src/3rdparty/libvlc/ directory. Regards, - Graeme - -- fpGUI Toolkit - a cross-platform GUI toolkit using Free Pascal http://fpgui.sourceforge.net/ -- _______________________________________________ Lazarus mailing list http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
http://www.fastmail.com - Email service worth paying for. Try it for free

Reply by email

Graeme Geldenhuys
to aradeonas
aradeonas wrote
I will this example too and if you have idea about that problem please let me know.

I'll search through my code and see if I have something for you. I also suggest you take a look at SDL - many high end cross-platform games (like created by Loki) uses SDL for audio and video.

Regards,
- Graeme -

fpGUI Toolkit - a cross-platform GUI toolkit using Free Pascal http://fpgui.sourceforge.net/

Reply by email

aradeonas
to Graeme Geldenhuys

Thank you again,

Sure,I am going to check it.

regards,
Ara

Graeme Geldenhuys wrote 20 lines
On 2015-02-20 12:01, aradeonas wrote: > I will this example too and if you have idea about that problem please > let me know. I'll search through my code and see if I have something for you. I also suggest you take a look at SDL - many high end cross-platform games (like created by Loki) uses SDL for audio and video. Regards, - Graeme - -- fpGUI Toolkit - a cross-platform GUI toolkit using Free Pascal http://fpgui.sourceforge.net/ -- _______________________________________________ Lazarus mailing list http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
http://www.fastmail.com - Accessible with your email software or over the web

Reply by email

aradeonas
to aradeonas

Graeme,

I check SDL and read many game demo but I cant find out how to play a simple video file.
You know?

Regards,
Ara

aradeonas wrote 39 lines
Thank you again, Sure,I am going to check it. regards, Ara On Sat, Feb 21, 2015, at 03:20 AM, Graeme Geldenhuys wrote: > On 2015-02-20 12:01, aradeonas wrote: > > I will this example too and if you have idea about that problem please > > let me know. > > I'll search through my code and see if I have something for you. I also > suggest you take a look at SDL - many high end cross-platform games > (like created by Loki) uses SDL for audio and video. > > Regards, > - Graeme - > > -- > fpGUI Toolkit - a cross-platform GUI toolkit using Free Pascal > http://fpgui.sourceforge.net/ > > -- > _______________________________________________ > Lazarus mailing list > > http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus -- http://www.fastmail.com - Accessible with your email software or over the web -- _______________________________________________ Lazarus mailing list http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
http://www.fastmail.com - Send your email first class

Reply by email

John Briggs
aradeonas wrote 8 lines
Thank you Mike and John. But I test playlists with VLC,mplayer and ffplay and problem is after first file finish thery is a 0.5 second delay for opening second file and its not good for project because files are tiny videos(less than 5mb and 4 seconds) and this delay is not need to read second file before first one or pass every frame at a time to player.

Well perhaps the only other way to do this easily is: cat file1 file2 .... > newfile

Play newfile

John

Reply by email

aradeonas
to John Briggs

No I cant because I don't have second or third file when playing first.They are downloading/
There is must a better way.

Regards,
Ara

John Briggs wrote 22 lines
On Fri, Feb 20, 2015 at 12:04:06AM -0800, aradeonas wrote: > Thank you Mike and John. > > But I test playlists with VLC,mplayer and ffplay and problem is after > first file finish thery is a 0.5 second delay for opening second file > and its not good for project because files are tiny videos(less than 5mb > and 4 seconds) and this delay is not need to read second > file before first one or pass every frame at a time to player. > Well perhaps the only other way to do this easily is: cat file1 file2 .... > newfile Play newfile John -- _______________________________________________ Lazarus mailing list http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
http://www.fastmail.com - A no graphics, no pop-ups email service

Reply by email