Third party codecs in AV Foundation - macos

I was under the impression that AV Foundation doesn't support third-party codecs. If I try to open an Avid DNxHD QuickTime movie in my application it doesn't work, as expected.
However, if I open a DNxHD movie in QuickTime Player X (which also uses AVF) it opens and plays back fine and even says it's a DNxHD in the Info window.
Does anyone know how Apple is achieving this?

I believe that QuickTime Player X is built on QT X, not on top of AVF. In fact, I think it uses (something like) QTKit, which will launch a 32-bit proxy process if necessary to open files that are only supported by 32-bit codecs.
You can access QT X via the QTKit framework, if you specify the 'playback only' attribute when you open the file, but then you can only play it back (as the flag suggests!). Even enumerating the number of tracks will fail. If you don't specify playback-only, then you are limited to QT7 components, accessed via a 32-bit proxy if your app is 64-bit.

Related

Distributing H264 with a Qt5 QtMultimedia program for Windows

I'm developing a Qt5 Application for Windows/Linux, it has to play a H264/AAC flv video.
This works wonderful on Linux after installing gstreamer-plugins. This also works after installing K-lite codec pack on Windows.
I need to distribute my program with the required files to be able to play the video without installing anything else.
I have tried copying the refrenced DLL files listed by Process Explorer (All related to A/V,libav*, av*, *.ax , etc), but this doesn't work.
What else do I need to set up?
You cannot do this due to MPEG-4 licensing. If you distribute h.264 decoders you must contact MPEGLA.com and obtain a license. (Currently free up to 100,000 installs per year, but $20K if you exceed that).
Things like K-Lite skirt this requirement by having the end-user install the codecs "for their personal use".
So, you can direct your users to install K-Lite, or other codecs, but you can't ship them yourselves. This is fairly common in the open source world.

Camera device on MAC OS

Having my webcam plugged in, I'm able to manipulate the video/audio stream in my MAC OS app.
Now I'd like to output it as a new virtual video/audio device that I can select as a camera input in apps like "Skype" or QuickTime.
I've looked into i/o kit framework and the reference webpage says this:
"To add digital video capabilities to your software, use the QuickTime
APIs."
I believe this needs to be updated because QuickTime APIs have been replaced by CoreMedia IO.
So I looked into CoreMediaIO and found a sample code from Apple dev website that also is obsolete and won't run on XCode 7.x with OS Yosemite+.
I've also looked in AVFoundation but it seems like a dead end.
I'm lost at this point. I know it's doable since CamTwist software is doing it.
Anyone has an idea how to approach this?
CoreMediaIO is definitely the way to go, as that's what Apple currently uses in its hardware. On my system (2015 rMBP), /Library/CoreMediaIO/Plug-Ins/DAL/ contains AppleCamera.plugin and iOSScreenCapture.plugin, for the webcam and capturing from iDevice.
I assume the example you're referring to is this one?
It doesn't quite compile out of the box, but I got it to build with the OSX 10.11 SDK eventually. You need Apple's Core Audio Utility Classes, point the 'Sources/Extras/CoreAudio/PublicUtility' group in the Xcode project at those, and then fix a variable initialisation (remove the = NULL where it complains about a private constructor) and comment out a few lines in SamplePrefix.h. I haven't run it, but I see no reason why it wouldn't. If you don't have a kext signing certificate, you may need to take steps to load unsigned kexts to run the sample.
Is your webcam using the old video-digitaizer driver (driver .component file is located in /Library/QuickTime)? I was able to see my UVC-camera and DAL camera in QuickTime player. My understanding is that Apps written in AVFoundation will not recongize old vdig driver. On the contrary, Apps written using Sequence Grabber (very old) / QTCapture (old) will recongize your device.
Hope this helps.

How to Play a RealAudio (.RA) File (Remote or Local) in Xcode?

I need to be able to play a RealAudio (.RA) file from Xcode. If i cannot play the file directly from the URL, it is ok if i can download it and play. Primary help i am looking for his how to Play RealNetworks RealAudio (.RA) file in Xcode 4.3 under iOS5.0.
I haven't come across an iOS package for playing Real Audio files, however, iOS does support some of the RealAudio Codecs. Specifically, it should be able to play the audio streams from RA files encoded with the raac and racp codecs. iOS won't know what to do with the RealAudio container, so you will have to determine what needs to happen to extract the audio stream from the file. This website contains details about the container.

Mac webcam - get the device [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 2 years ago.
Improve this question
How do I access my default video camera on my mac? I know on Linux it is /dev/video0 but my Mac does not have that. I'm trying to capture my webcam into ffmpeg
ffmpeg -i /dev/video0
But it won't work because /dev/video0 doesn't exist.
You can achieve this by using VLC's qtcapture (QTKit) or avcapture (AVFoundation) module introduced with VLC 2.0.0 and
Try this via command line - Note: you still need to hit play i guess:
QTCapture (using the QTKit Framework)
VLC.app/Contents/MacOS/VLC -vvv qtcapture://
AVCapture (using the AVFoundation Framework)
VLC.app/Contents/MacOS/VLC -vvv avcapture://
You can also control this via GUI: VLC -> File -> Open Capture Device...
Also if you really want to have control over things you can look into AVFoundation Framework or the older QTKit Framework to access your camera (video/audio devices) programmatically.
If you have trouble finding devices try to debug it by finding out if the device is actually recognized by VLC. The verbose output through the terminal or the Log View in GUI mode should show you which devices are actually available:
here's the documentation for macOS:
OS X users can use the avfoundation and qtkit input devices for
grabbing integrated iSight cameras as well as cameras connected via
USB or FireWire:
AVFoundation is available on Mac OS X 10.7 (Lion) and later. Since
then, Apple recommends AVFoundation for stream grabbing on OS X and
iOS devices. QTKit is available on Mac OS X 10.4 (Tiger) and later.
QTKit has been marked deprecated since OS X 10.7 (Lion) and may not be
available on future releases.
here's an example using linux, but it can be done with the above link just as easily with macos.
My impression is that it's hard to impossible. Apple locked it down quite a bit. There's the nearly unfindable iSightCapture which apparently only works when run directly on the command line (used to work fine in scripts before 10.4, but Apple blocked that), and I think it only takes images, not video.
Considering someone wrote that, it should be possible to access it programmatically, but iSightCapture is not open source, and I haven't been able to find how to do it myself. Though I admit I gave up pretty quickly once I realized it's clearly not a standard webcam.

Converting media files for HTTP Live Streaming on windows?

I want to be able to run HTTP live streaming from a server, so that I can play back the files on my iPhone via HTTP. I know it's possible to play media files through safari /without/ live streaming, but I'd like to give it a go.
As far as I can tell, the only tools available for converting media files into the formats required for the live stream are for Mac OSX. I don't have a Mac, and I'm wondering if there are any equivalent tools for Windows?
FFMpeg offers tools for Mac, Windows, and Linux. http://ffmpeg.org/download.html

Resources