VLCJ Player stop playing properly because computer goes to sleep - javafx

When playing a long video using vlcj's EmbeddedMediaPlayer instance, the computer enters a locked or (depending on my configuration) sleep mode while the video is playing. Unlocking or waking up the computer often causes failures in the playback.
The easiest and most obvious way to handle this is to turn off sleep and/or locking on your computer. If, however, you need your computer to lock or sleep only when not playing a video, this is not the best solution. The best solution is to somehow disable sleeping or locking while the video is playing.
The VLC player does this without problems. I have played 2+ hour videos using it on different operating systems without my system sleeping or locking. I know that this is possible, but I cannot find any information on doing this using VLCJ.
Is there a call or series of calls that I can make that will prevent a machine from sleeping or locking while a video is being played? If so, how do I engage this functionality?

Related

How to set the duration of Alexa wake time?

I am not seeing anything in the docs (Alexa Skills Kit or Alexa Voice Service) about adjusting the time that the device waits for a command after the "wake word" (default: "Alexa") has been uttered. I was wondering if I could adjust it and how to do so, preferably programmatically.
Is it possible? How so?
This is part of the hardware device behavior. So it cannot be done via the SDKs.
The underlying service, Alexa, doesn't support the concept of a wake word. In fact, it is against the terms and conditions of people using AVS to enable hardware devices to use a wake word without explicit permission from Amazon. So it isn't the sort of thing you would expect to see available programmatically.
The same goes for the other constants that govern how the hardware reacts such as the timeout in waiting for the service to respond, how long it waits for the user to say something before a reprompt, or how long it waits after the reprompt before hanging up.

multi-seat vs. thin client multi-user systems

I want to understand the theoretical background of multi-user system (how it works). I found we can implement the idea using two methods.
1.Multi-seat
2.Thin client
What are the differences between them.
And should we install OS in thin client while using in multi-user system. I found thin-clients may not have hard disks.
Please help me out..
The basic idea is one of resource utilisation. For example; for a typical office scenario you might buy 10 computers for 10 users at $2000 each, and while they're being used they'll spend most of their time waiting for keyboard or mouse and only actually use about 10% of the CPU, etc. It's wasteful.
For multi-seat; you'd throw some more video cards into the computer and get a USB hub and plug more keyboards in. You might end up with 2 computers at $3000 each with 5 people per computer (or $6000 total cost instead of $20000); and if its done right the users won't really notice the difference. Of course it's a little hard to cram 5 video cards into a single machine (and hard to get 5 users close enough for everything to reach), so this has some practical limitations.
For thin client; you shift the video and keyboard into a little box (the thin client) that communicates with a server over the network. The server runs the applications, etc; and the thin clients don't need to do much processing or anything (and don't need hard drives) and can be really cheap. It will need more networking bandwidth (because the network is now carrying video traffic for all the users); but you can shift the expensive (and often noisy) server into a back room; and because it's centralised it makes maintenance (backups, upgrades, etc) easier. In this case you might spend $4000 on a server and $1000 on 10 thin clients and $1000 on networking (or $6000 total cost instead of the original $20000).

Flex: Karaoke app out of sync on playback,after publishing on an external server

I'm trying to create a Karaoke app in my spare time, but i'm having some problem syncing the recording and the backing track.
Basically, after i start to publish to an external media server (wowza), when i play back with the recording (mp3, ripped from the recording flv) and the backing track (mp3 too), i notice a delay of 0-800 ms between the 2 track, which is a big time for this type of application.
This delay is always random, as bigger in windows than macs.
I already tried many solution, amongs the others:
Playback with the Sound.extract method, taking 2048 samples each time, to have less latency for the audio start/processing;
Set the microphone silence level to 0;
Sync by cuepoint, in different cases in flv or in the mp3 (extending the sound class)
But every time, i get mixed results (worse results in windows, best results in mac)
Anyone has some suggestion to give? Any help would be appreciated :-)

Flash Media Server: Trouble with recording 2 audio/video streams at the same time?

In short
For a project I need an audio/video-chat for 2 people, with the ability to record (part of) the session. I am running into issues where the 2nd user's recorded video gets messed up, with massive amounts of (seemingly) skipping frames and/or audio loss, most likely caused by the audio stream (when not recording the audio, the problem doesn't appear to occur).
Overview
For a project I need a setup where two clients can video(+audio, obviously :) chat with one another. Also, the 'host' should be able to record the session when (s)he presses a button, and stop recording in the same way.
While this setup is far from rocket science, I've been experiencing issues that I can't seem to figure out. The clients connect fine, and each other's videos show up propely and they can even hear each other just fine. I chose to re-initialize the connection when the host starts the recording, which also works just fine. The recorded files, however, at times experience issues.
The possible cause
Usually the hosts' recording is great, with audio and video working as it should. The client video shows problems, with the video literally jumping when played back (in a number of applications such as VLC, KMPlayer, Adobe's own media player, etc.). I tried to debug the situation and it seems to be directly related to the audio, though how this happens I'm not sure. When I did tests with no recorded audio, both videos played back fine.
The problem
I'll try to explain what happens in the client video; the video plays back normally, with audio working fine too. But in seemingly random locations of the video, playback suddenly skips seconds of the video (and audio), so a one minute video sometimes lasts mere seconds (even though the playback bar and the such show that the video in fact lasts for a minute).
I have not found any logic in how it skips --some videos show only 4/5 gaps of a few seconds each, others jump 20-30 seconds ahead--, so I'm assuming it's a random thing.
Scenarios
I have tested multiple scenarios, and the problem seems consistent enough (as in, it occurs every time, just not when I dont record audio). I have used a local (developer edition) FMS server, the hosted influxis service, and I have used two local computers, one local machine (using 2 webcams) and 1 local, 1 (really) remote computer. All setups seem to have the same issues with the recorded (client) video.
In closing
I'm not sure what details you need, so please, ask me for anything you might need to help me find a solution to this. I have searched and debugged like there was no tomorrow, and haven't been able to figure out what is causing this.
Many, many thanks in advance!
-Dave
I've had some pretty extensive experience with FMS and specifically with influxis... Also did recording of both audio and video as the system I had needed it for security reasons. However, in all cases the video and audio were recorded on the server - not on the same machine as either client.
The issues I've seen include a vast amount of tweaking of both audio and video quality - to find the correct mix to get optimal results. That's where I'd start, adjust quality down and see where that gets you.
For a test environment, I'd suggest using different machines so the CPU doesn't become your issue - as the actual environment would have the clients on different boxes with more CPU.
Contact me with addition information, etc - I and several friends have a system working and I'm happy to help.
<>
Looked over my notes - we were able to talk to influxis about the lagging audio - and there were a couple of server setting they played with AND it was our frames-per-second and other quality guys...
I'm not sure if my problem was the same as yours, but we found a solution.
The flash piece needed to set the silence level (setSilenceLevel) such that it didn't insert audio packets that signal no audio. These audio packets caused recording problems that produced random skips and audio drops.
Dave, have you ruled out latency? are the computers with both cams connected to a high speed network? I would also check the processor utilisation on the machine which is recording.

Is it possible to downsample an audio stream at runtime with Flash or FMS?

I'm no expert in audio, so if any of you folks are, I'd appreciate your insights on this.
My client has a handful of MP3 podcasts stored at a relatively high bit rate, and I'd like to be able to serve those files to her users at "different" bit rates depending on that user's credentials. (For example, if you're an authenticated user, you might get the full, unaltered stream, but if you're not, you'd get a lower-bit-rate version -- or at least a purposely tweaked lower-quality version than the original.)
Seems like there are two options: downsampling at the source and downsampling at the client. In this case, knowing of course that the source stream would arrive at the client at a high bit rate (and that there are considerations to be made about that, which I realize), I'd prefer to alter the stream at the client somehow, rather than on the server, for several reasons.
Is doing so possible with the Flash Player and ActionScript alone, at runtime (even with a third-party library), or does a scenario like this one require a server-based solution? If the latter, can Flash Media Server handle this requirement specifically? Again, I'd like to avoid using FMS if I can, since she doesn't really have the budget for it, but if that's the only option and it's really an option, I'm open to considering it.
Thanks in advance...
Note: Please don't question the sanity of the request -- I realize it might sound a bit strange, but the requirements are what they are. In that light, for purposes of answering the question, you can ignore the source and delivery path of the bits; all I'm really looking for is an explanation of whether (and ideally how) a Flash client can downsample an MP3 audio stream at runtime, irrespective of whether the audio's arriving over a network connection or being read directly from disk. Thanks much!
I'd prefer to alter the stream at the client somehow, rather than on the server, for several reasons.
Please elucidate the reasons, because resampling on the client end would normally be considered crazy: wasting bandwidth sending the higher-quality version to a user who cannot hear it, and risking a canny user ripping the higher-quality stream at it comes in through the network.
In any case the Flash Player doesn't give you the tools to process audio, only play it.
You shouldn't need FMS to process audio at the server end. You could have a server-side script that loaded the newly-uploaded podcasts and saved them back out as lower-bitrate files which could be served to lowly users via a normal web server. For Python see eg. PyMedia, py-lame; or even a shell script using lame or ffmpeg or something from the command line should be pretty easy to pull off.
If storage is at a premium, have you looked into AAC audio? I believe Flash 9 and 10 on desktop browsers will play it. AAC in my experience takes only half of the size of the comparable MP3 (i.e. a 80kbps AAC will sound the same as a 160kbps MP3).
As for playback quality, if I recall correctly there's audio playback settings in the Publish Settings section in the Flash editor. Wether or not the playback bitrate can be changed at runtime is something I'm not sure of.

Resources