Is there a way to make VTDecompressionSession decode H264 when app in background mode? - video-toolbox

Is there a way to make VTDecompressionSession decode H264 when app in background mode?

Check UIApplication
beginBackgroundTaskWithExpirationHandler(), from my test it's only allow to run the process within 180 seconds after App into background mode.

Related

Is there anyway to capture lock screen with ffmpeg or electron getUserMedia

I'm trying to create a remote desktop app.
Everything is working great except I can't find a way to capture the windows lock screen to allow login from remote.
I'm using electron and getUserMedia which will show the lock screen on macOS but just hangs with a still image on Windows until the screen is unlocked.
Is there any way to capture the lock screen on windows using the built in getUserMedia or ffmpeg?
If not do you have any other suggestions of ways to capture? I don't need high framerate on the lock screen.
I facet the same problem...
Maybe it's necessary to run electron app using System privileges.
do you have resolved in some way?

Using Camera for Video Record in Background with UWP

My app start a video recording automatically at load if any "video capture - supported" device is detected. I can get preview from the camera while recording is continued also.
However, if I minimize the app, cameras goes offline. I can run the other processes with using deferral object in EnteringBackground event, only cameras goes offline.
How can I use the cameras and continuing the video record in background ?
Thanks.

iOS video toolbox gives "Ignoring enqueueSampleBuffer: because status is "failed""

I am using video toolbox in iOS8 to play an h264 stream along with a PCM audio stream. Video is displayed fine as long as I dont start the audio stream. As soon as I call AudioQueueStart, all enqueueSampleBuffer calls stop displaying video and prints the error "Ignoring enqueueSampleBuffer: because status is "failed"".
There are no errors returned from CMBlockBuffer calls. enqueueSampleBuffer doesnt return anything and hence I cant write a code to recreate video layer again on this error.
This only happens on iOS device and not on simulator. Audio and video plays perfectly fine on Simulator. I run Audio and Video on separate threads such that one doesnt block the other. Has anyone faced the same issue?
The problem was happening because I had the mute switch on iphone turned ON.
I used AVAudioSessionCategoryPlayback for my audio session to overcome this.
This problem is resolved.

WP7 background audio resources are no longer available

I'm using BackgroundAudioPlayer for my Windows Phone 7 music & video application. After I play some music, I play video using MediaPlayerLauncher, then press Back to return to my app. There whenever I use BackgroundAudioPlayer.Instance. I receive error "The background audio resources are no longer available".
Someone on MSDN suggests using try/catch, but this is not a good idea, and can slow down the app.
Other suggests call BackgroundAudioPlayer.Instance.Close() before launch MediaPlayer. However, when I play music, the agent load .dll again, which takes very much time.
How to fix this ?
If you play a video after your audio the OS will definitely "terminate" your Background Audio Player. From your question it seems this is reproducible 100% of the time which would confirm this. Your only option is to restart the background audio player again after you have called BackgroundAudioPlayer.Instance.Close(), and then played your video. Which as you said will require reloading your player DLL when you start the BAP.
Update following up from comments
If you aren't implementing a streaming audio agent but only an AudioPlayer agent there isn't a process for you to kill anyway. The OS spins up a process as and when it needs to get you to process an action (e.g.: user action, track ended, shutdown).
BackgroundAudioPlayer.Instance.Close() just makes sure that the OS releases those resources cleanly in a scenario such as the OP has.
To restart background audio, just call BackgroundAudioPlayer.Instance.Play() again.

capture video from screen for stream

i am looking for differnt solutions to capture video stream from monitor screen and send it to vidoestreaming server to broadcast in web. it must occuring in "live".
i'd not like to use external services like "procaster" for broad.
OS: Windows.
it will be great to know the ideas and expirience people have to accomplish that.
Thanks all.
Recently, I build a GoLang project called ScreenStreamer, is a tool to stream current active window or full screen (Linux's or Windows's) to other device, like phone or another PC, as MJPEG over http or FLV over rtmp, it's very realtime (delay < 100ms). It works on Windows and Linux.
After building it, you can run it as:
# enter the project root directory
cd ./src/ScreenStreamer
# run it
./mjpeg or .\mjpeg.exe
# use a web browser or other video player, open http://host:port/mjpeg
./rtmp or .\rtmp.exe
# use a video player, open rtmp://host:port/live/screen
Screenshot:
Windows SDK includes Push Source Filters Sample, which in turn contains CPushSourceDesktop filter/class.
CPushSourceDesktop: Copy of current desktop image (GDI only)
It captures desktop image and pushes it into DirectShow pipeline. From there on you can process it using video compression codec and stream it to remote location. A decent screen image compression codec is included with Windows Media subsystem, network streaming will have to be a custom or third party component. Alternatively, it is possible to make the capture class a virtual camera and have Windows Media Encoder broadcast it (or, it already has a simila feature built in).
Alternatively, you can check VNC (or one of the clones) source code and see how it hooks windows and captures image updates, then compresses them and makes it available for remote applications.
Note that you will have to specifically capture non-GDI images (such as coming from video/gaming applications, which use hardware acceleration and non-RGB surffaces).

Resources