Welcome, Guest. Please login or register. Did you miss your activation email?

Author Topic: VideoStreamer - .NET Video Player  (Read 46304 times)

0 Members and 1 Guest are viewing this topic.

zsbzsb

  • Hero Member
  • *****
  • Posts: 1409
  • Active Maintainer of CSFML/SFML.NET
    • View Profile
    • My little corner...
    • Email
Re: VideoStreamer - .NET Video Player
« Reply #15 on: February 11, 2014, 04:32:22 pm »
Robert,

Videos should play fine even if there is no audio track. If you could provide me with some test videos that do not work I would be glad to check them out. Also some example code and some more information about the crash would be helpful  ;)
« Last Edit: February 11, 2014, 05:22:37 pm by zsbzsb »
Motion / MotionNET - Complete video / audio playback for SFML / SFML.NET

NetEXT - An SFML.NET Extension Library based on Thor

rcurtis

  • Newbie
  • *
  • Posts: 19
    • View Profile
Re: VideoStreamer - .NET Video Player
« Reply #16 on: February 11, 2014, 09:53:54 pm »
zsbzsb,

  Thanks for the patience, I got the audio thing settled using the long winded constructor to turn it off when I need to.  On to the next problem!  It seems to 'flicker' for a moment before playing the loaded video.  It looks like it has not yet decoded a frame and fills the buffer with solid black.  If you are interested in seeing the project I am working with, it is located on github at https://github.com/rcurtis/SFMLVideoPlayer.  Thanks again for taking the time to answer my questions, I do my best to try and solve these on my own.

Thanks,
Robert

rcurtis

  • Newbie
  • *
  • Posts: 19
    • View Profile
Re: VideoStreamer - .NET Video Player
« Reply #17 on: February 11, 2014, 10:17:09 pm »
Update:  If I start play back and then give the thread a brief sleep it does not flash black.  These feels like a hack tho.  What are your thoughts?

zsbzsb

  • Hero Member
  • *****
  • Posts: 1409
  • Active Maintainer of CSFML/SFML.NET
    • View Profile
    • My little corner...
    • Email
Re: VideoStreamer - .NET Video Player
« Reply #18 on: February 11, 2014, 10:49:34 pm »
First, let me explain the "flicker to black issue". In the constructor the texture is initially set to black. When you call Play() the decoding thread is started and begins decoding video/audio frames from the file. The texture will only be updated once enough time has passed and there is a frame ready. However directly after calling Play() there is no frames available (this is why I need to add the option to preload frames  :P).

On to the constructor, I am working on adding some more overloads and also adding an option to set the initial texture color (which would allow you to set an initial color of transparent so that you won't see the black flicker).  :D

As for the sleep hack, it isn't a good solution since you are pausing the entire clear/draw/display loop, it is possible to still see the black texture, and it is possible to actually miss parts of the video. Let me finish these few changes and you should have no more issues.


On a side note, you can edit posts  ;)


Update

Ok I made the changes, I updated the constructors with more overloads (no more long winded thing) and I also added the option to set the initial color of the buffer [requires recompile].  ;D
« Last Edit: February 11, 2014, 11:12:56 pm by zsbzsb »
Motion / MotionNET - Complete video / audio playback for SFML / SFML.NET

NetEXT - An SFML.NET Extension Library based on Thor

rcurtis

  • Newbie
  • *
  • Posts: 19
    • View Profile
Re: VideoStreamer - .NET Video Player
« Reply #19 on: February 13, 2014, 01:08:41 am »
Thanks!  I pulled the changes and they worked perfectly.  I used your new documentation to build it as well!

Edit: link to build docs: http://zbrown.net/projects/videostreamer/tutorials/build.php

Robert
« Last Edit: February 13, 2014, 01:11:44 am by rcurtis »

zsbzsb

  • Hero Member
  • *****
  • Posts: 1409
  • Active Maintainer of CSFML/SFML.NET
    • View Profile
    • My little corner...
    • Email
Re: VideoStreamer - .NET Video Player
« Reply #20 on: February 13, 2014, 01:48:16 am »
Thanks!  I pulled the changes and they worked perfectly.  I used your new documentation to build it as well!

Edit: link to build docs: http://zbrown.net/projects/videostreamer/tutorials/build.php

Robert

Glad it worked out well, and about the build documentation... I wasn't quite ready to publicly release it, but oh well   8)

Here it is peeps, the official site for NetEXT and VideoStreamer [WIP]  :D
Motion / MotionNET - Complete video / audio playback for SFML / SFML.NET

NetEXT - An SFML.NET Extension Library based on Thor

rcurtis

  • Newbie
  • *
  • Posts: 19
    • View Profile
Re: VideoStreamer - .NET Video Player
« Reply #21 on: February 15, 2014, 02:23:07 am »
Ah, terribly sorry.  If I had known I wouldn't have posted   :-[

zsbzsb

  • Hero Member
  • *****
  • Posts: 1409
  • Active Maintainer of CSFML/SFML.NET
    • View Profile
    • My little corner...
    • Email
Re: VideoStreamer - .NET Video Player
« Reply #22 on: February 15, 2014, 04:26:57 am »
Ah, terribly sorry.  If I had known I wouldn't have posted   :-[

No problem, all is cool  ;D
Motion / MotionNET - Complete video / audio playback for SFML / SFML.NET

NetEXT - An SFML.NET Extension Library based on Thor

lilbuh

  • Newbie
  • *
  • Posts: 2
    • View Profile
Re: VideoStreamer - .NET Video Player
« Reply #23 on: March 16, 2014, 11:46:52 am »
Hey there,

i cant get videostreamer to compile properly even with the tutorial...
each time i correct an issue another one comes up:

videostreamer:

- inttypes.h missing ( found that the r29 of https://code.google.com/p/msinttypes/ fixes that issue )

Cvideostreamer:

- lots of error LNK2026: module unsafe for SAFESEH image. ( using libs from http://ffmpeg.zeranoe.com/builds/win32/dev/ ) had to disable SAFESEH option in project properties

and now:

Erreur   1   error LNK2038: discordance détectée pour '_ITERATOR_DEBUG_LEVEL' : la valeur '0' ne correspond pas à la valeur '2' in HDataFrame.obj   \VideoStreamer.lib(DataFrame.obj)   CVideoStreamer
Erreur   2   error LNK2038: discordance détectée pour 'RuntimeLibrary' : la valeur 'MD_DynamicRelease' ne correspond pas à la valeur 'MDd_DynamicDebug' in HDataFrame.obj VideoStreamer.lib(DataFrame.obj)   CVideoStreamer
Erreur   3   error LNK2038: discordance détectée pour '_ITERATOR_DEBUG_LEVEL' : la valeur '0' ne correspond pas à la valeur '2' in HDataFrame.obj   \VideoStreamer.lib(VideoStream.obj)   CVideoStreamer
Erreur   4   error LNK2038: discordance détectée pour 'RuntimeLibrary' : la valeur 'MD_DynamicRelease' ne correspond pas à la valeur 'MDd_DynamicDebug' in HDataFrame.obj    \VideoStreamer.lib(VideoStream.obj)   CVideoStreamer
Avertissement   5   warning LNK4098: conflit entre la bibliothèque par défaut 'MSVCRT' et les autres bibliothèques ; utilisez /NODEFAULTLIB:library    \LINK   CVideoStreamer
Erreur   6   error LNK1319: 4 discordances détectées   \Debug\CVideoStreamer.dll   1   1   CVideoStreamer

using visualstudio 2012 and windows 8 64

help!

zsbzsb

  • Hero Member
  • *****
  • Posts: 1409
  • Active Maintainer of CSFML/SFML.NET
    • View Profile
    • My little corner...
    • Email
Re: VideoStreamer - .NET Video Player
« Reply #24 on: March 16, 2014, 03:13:24 pm »
Problem has been solved via IRC  :D
Motion / MotionNET - Complete video / audio playback for SFML / SFML.NET

NetEXT - An SFML.NET Extension Library based on Thor

lilbuh

  • Newbie
  • *
  • Posts: 2
    • View Profile
Re: VideoStreamer - .NET Video Player
« Reply #25 on: March 16, 2014, 06:49:58 pm »
for the other errors i just had to recompile the 2 projects videostreamer and Cvideostreamer in release mode
( one was set to debug and the other one to release )

and my last error was: do not forget to copy the ffmpeg dlls in the program's folder




FallenWyvern

  • Newbie
  • *
  • Posts: 15
    • View Profile
Re: VideoStreamer - .NET Video Player
« Reply #26 on: May 29, 2014, 09:24:51 pm »
How does one get audio to playback in this? There's nothing in the tutorial/sample about that.

zsbzsb

  • Hero Member
  • *****
  • Posts: 1409
  • Active Maintainer of CSFML/SFML.NET
    • View Profile
    • My little corner...
    • Email
Re: VideoStreamer - .NET Video Player
« Reply #27 on: May 30, 2014, 02:39:05 am »
How does one get audio to playback in this? There's nothing in the tutorial/sample about that.

I'm not sure what you mean, audio is played whenever the file that is loaded has an audio stream. If you want to just play back audio without video you should probably just use SFML's audio classes directly then.
Motion / MotionNET - Complete video / audio playback for SFML / SFML.NET

NetEXT - An SFML.NET Extension Library based on Thor

FallenWyvern

  • Newbie
  • *
  • Posts: 15
    • View Profile
Re: VideoStreamer - .NET Video Player
« Reply #28 on: May 30, 2014, 04:21:09 am »
How does one get audio to playback in this? There's nothing in the tutorial/sample about that.

I'm not sure what you mean, audio is played whenever the file that is loaded has an audio stream. If you want to just play back audio without video you should probably just use SFML's audio classes directly then.

That's weird. No audio is playing on my side. I'll play more with it tomorrow. I'm using the Pacific Rim Trailer (.mp4 format, h.264 encoding) as my test. It's a beautiful little library, with excellent performance. I tried using SDLdotNet to play video using raw FFMPEG output but SDLdotNet has a bad memory leak when applying frames to a surface so I'm very happy with this.

FallenWyvern

  • Newbie
  • *
  • Posts: 15
    • View Profile
Re: VideoStreamer - .NET Video Player
« Reply #29 on: May 30, 2014, 03:42:09 pm »
How does one get audio to playback in this? There's nothing in the tutorial/sample about that.

I'm not sure what you mean, audio is played whenever the file that is loaded has an audio stream. If you want to just play back audio without video you should probably just use SFML's audio classes directly then.

That's weird. No audio is playing on my side. I'll play more with it tomorrow. I'm using the Pacific Rim Trailer (.mp4 format, h.264 encoding) as my test. It's a beautiful little library, with excellent performance. I tried using SDLdotNet to play video using raw FFMPEG output but SDLdotNet has a bad memory leak when applying frames to a surface so I'm very happy with this.

So I used user rcurtis's project that he linked in an earlier post to get the compiled version of your dll's (I'm lazy and wanted to see how the project worked) and so I'm using his "Video Player Test" which has a png background and a flv with an alpha channel (it's a deer on a quad).

I've added to this four copies (to see performance) of the Pacific Rim MP4 trailer. Using a StreamVideoPlayer (the same sort as the deer), no sound happens. When using a videostreamernet.videostream there is also no audio.

I see classes in videostreamernet for audio... but if it is supposed to work automatically I presume there's another class I should be using...