JavaFX MediaPlayer stutters on Mac with mp4 files - macos

To reproduce the problem you can use the JavaFX sample project AdvancedMedia. Replace the flv video with a mp4 one which encoding type is supported by JavaFX.
Edit: I thought maybe people are having trouble to edit the sample. Just place a video in the project root folder and set MEDIA_URL to new File("video.mp4").toURI().toString().
It works great on Windows platforms. However, on Mac the video stutters in the beginning and before it ends. When running the project on terminal with java -jar AdvancedMedia.jar it shows the following messages:
AVF info: checkDecoderUsage, vaCodecString: <Gen6>
AVF info: pp_hw_name: RenderingEngine, id: 3ea, m_pp_nowait: 1
AVF info: RingBufferPool wr:0, rd:108, reset:93, warning:0
I saw this error occurs with MacBook Pro, Air, i5/i7 processors etc. Is there any way to solve the stuttering/error messages?
I tested running with -Dprism.verbose=true and I saw a major difference between Windows and Mac platforms: on Windows the Prism platform init order is d3d sw while on Mac it is es2 sw; the Prism pipeline name is com.sun.prism.d3d.D3DPipeline and com.sun.prism.es2.ES2Pipeline respectively.
Maybe a possible solution is to use the same D3D pipeline on Mac? But if running with -Dprism.order=d3d,sw it gives java.lang.ClassNotFoundException: com.sun.prism.d3d.D3DPipeline.
I also tried to increase JVM memory with the -Xms option but it had no effect. So it really seems to be a codecs issue even though the videos play smoothly on other platforms.
I was testing a Windows generated jar on Mac, so now I also tried to build the AdvancedMedia example on Mac thinking it could make some difference, but nothing changed.
It seems that maybe this is more like a JavaFX bug report than a question.
A little off-topic, but I have to say that before this I tried C++ and VLCj approaches for my application and I changed it only because of Mac functionality issues...

I found out that this bug happens on Mac with any H.264 encoded video, regardless of the file extension. So as described on the docs, the only other alternative JavaFX offers is to use VP6 encoding, which is not easy to get - see my other question - but at least the videos will run smoothly and without any rendering error messages.

Related

How to reinstall User Quicktime codecs on BigSur MacOS 11.2.3? Playback of screencapture files corrupted

Since updating to latest version 11.2.3 I noticed that if I do a screen capture recording it produces a file which CAN be played back on a different Mac without a problem, but plays back garbage if played using Preview/QuicktimePlayer on the MacMini running MacOS 11.2.3 where it was created.
The picture is mangled, blue and pixels, while showing the original recording for snippets of like 1 or 2s.
The files play fine when moved to a Catalina machine. Also the M1 that has the problem plays back files created on a different machine. When creating a new User and doing a screen capture it records fine!
Apple Support told me that one needs to reinstall the user codecs somehow. They didn't know how exactly it was done but admitted that that was the way one sometimes solves this problem.
How could they have become corrupted in the first place I don't know.
Has someone else experienced this before? How do I fix this without reinstalling the OS or creating a new user. This is surely a problem with BigSur on M1 and is a bug.
I have filed a bug report on the feedback Assistant and the apple developer forum.
https://developer.apple.com/forums/thread/678395#678395021
I tried to resolve this, but I failed in someways, mainly in dont have success to install codecs pack in the MAC from the company (security reasons). So I always try two options:
1 - Execute the file with KMPlayer;
or/and
2 - Repair the file with some .mov recovery file tool (online or not).
This is a bug, horrible bug, mas I am solving in this two ways above.

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.

Game App cannot run in Genymotion

I am having trouble loading a game app on genymotion. The game is Star Wars Force Collection. I can load the game, get the splash screens, then it crashes.
I have done some research before I posted here. The possible problems found in the genymotion logcat file:
There was a line noting Google services was out of date, "Google Play services out of date. Requires 4030500 but found 3225136"
Fatal signal 11 (SIGSEGV) at 0x00000364 (code=1), thread 1796 (RefQueueWorker#)
W/NetworkManagementSocketTagger( 280): setKernelCountSet(10040, 1) failed with errno -1
Some have pointed out ARM Translator problem and OpenGL.
Then again I'm really not sure the problem, and I want to post the logcat file here but I don't know how to attach it.
For problem 1, I have seen other thread here that may have fixed it with code, I'm not savvy enough for that and my Google is not updating itself.
That's about it. A few details about genymotion and the VM. I am running the latest version of genymotion and virtualbox. I am using the downloaded Custom image 4.3 as provided by Genymotion. I flashed the ARM Translation v1.1. I flashed the Gapps onto it, (I tried a higher version of Gapps to try and solve the problem, but that just made it crash) and then Star Wars Force Collection, most up to date version.
Also, worth noting that the app was running fine for v2.++, until an update to v3.++ made the game crash. I updated my graphics drivers to try and mend any graphics issues.
So there it is, any suggestions will be appreciated.

Video editor for android - FFmpeg won't compile on windows?

Im trying to make a video editor for android (I've never made an android app before)
After searching for libraries to use I came across FFmpeg but I'm having trouble getting it to compile on Windows 7.
I'm currently using Eclipse and have the most recent android SDK and ndk.
I've been trying to follow tutorials on the internet including roman10's (http://www.roman10.net/how-to-build-ffmpeg-with-ndk-r9/) but they all seem specific to Linux.
Yesterday, I thought I'd give up and just dual boot Ubuntu on my windows laptop but of course that was messing up too. I shrank my partition and booted Ubuntu of a USB but the installer was detecting there is no OS on my laptop and not giving me the option to install it alongside windows 7.
So, can FFmpeg be compiled for android on windows? Or is there another library I could use to make a video editor that can?
Or should I just persist with dual booting ubuntu?
Thanks
Maybe you have already know that on Windows you must use Cygwin. This is open source tools which provide functionality similar to a Linux distribution on Windows.
I work with ndk in linux. It avoids many problems and errors which i can found in Windows.
Here link how to start work with Cygwin:
http://mindtherobot.com/blog/452/android-beginners-ndk-setup-step-by-step/

Blackberry Development on Mac OS X

I recently started creating applications for mobile devices and have successfully completed an application for the iPhone. I am now turning my attention to the Blackberry but haven't been able to find a convincing article or website that states that it can be done or a tutorial on how to do so. Can Blackberry apps be developed on Mac OS X? If yes, how do I go about doing so? Can anyone please point me in the right direction as I only have access to a Mac and really want to get this project on the road. Thanks in advance for your help.
UPDATE:
RIM has released a MacOS Eclipse plug-in for Blackberry Development: http://na.blackberry.com/eng/developers/javaappdev/macosx.jsp
While there is no built-in simulator, the plug-in DOES support USB tethered device debugging for the Torch 9800 handhelds. I plan to get one; they are ~$499 w/no contract. With a Torch and the new plug-in, Blackberry development is possible without using a VM. (Finally!)
PREVIOUS POST:
Building on MacOS works well once you set it up. I've had less luck with the simulator. On the whole though, being able to run Eclipse natively in MacOS and flip to a Windows VM only for debugging is a big win in my book.
You can get a MacOS version of preverify (see link below for details). I do my development with Eclipse on MacOS X and use Ant to build BB apps.
This blog is excellent and has many of the details to get you started:
http://www.azizuysal.com/2009/07/blackberry-development-on-mac-os-x.html (original link is dead. The "wayback machine" provides us with the original text content, but images and styling are lost to the sands of time. Still worth a read.)
The tricky part is getting the simulator to work. There is a Wine-based work-around, but on my computer, while the simulator was able to run under Wine, the LCD output was scrambled.
Currently, I build COD files from Mac, and my Ant build process drops them into a directory that is shared with a WinXP VM. I can run the simulator stand-alone in this VM. Debugging is also possible by installing Eclipse inside WinXP and pointing the debug configuration it at the source directories.
I've actually got a bit more magic. I enabled some of the Java 1.5 features by compiling against 1.5 and then translating the bytecode to 1.3 prior to the preverify script. (Blackberry only speaks a barbaric 1.3 java, flashback to circa 1992). It's not a silver bullet as some features still don't work, but it does cut down on the need to make everything an untyped Object reference.
Lately, I've been working on a x-platform framework to allow me to write app code once and build against both Android and Blackberry (both are Java). The Android part was easy. It's just a bitch to debug anything in Blackberry. Someone working at RIM decided that Blackberry didn't need to keep Exception stack traces unless there was a catch(Throwable), and then they could do something bizarre, non-standard, and undocumented (catching Throwable behaves weird). I've only kinda-sorta figured out a hack to get stack traces using JavaLoader.exe without breaking into the debugger, and it's barely worth it.
p.s., I now do x-platform development with a single code-base targeting Android, Blackberry, and Desktop. Desktop is great for testing app functionality, with very little Blackberry on-device testing needed once features work in the desktop 'simulator' (a Swing GUI built for debugging our games).
Even though certain components of the RIM development platform are java-based, such as the JDE - other components such as the preverifier and device simulators are implemented as native Windows executables.
Basically, the easiest way to do it is to install Windows on your Mac using Bootcamp or Parallels and run inside a real Windows environment on your Mac.
However, there are other "hackier" ways to do it using Wine, MacPorts, and a number of other tools - as an example see this blog post

Resources