Failed to initialize an AVAssetExportSession (iPhone XS, XR, XMax) - avasset

When I instantiate an AVAssetExportSession object in new simulators instance with either of the 2 methods:
AVAsset *videoAsset = [AVAsset assetWithURL:videoURL];
AVAssetExportSession *exporter = [AVAssetExportSession exportSessionWithAsset:asset presetName:AVAssetExportPresetHighestQuality];
or
AVAssetExportSession *exporter = [[AVAssetExportSession alloc] initWithAsset:asset presetName:AVAssetExportPresetHighestQuality];
and, run the app on one of the 3 new simulators: iPhone XR, iPhone XS, and iPhone XS MAX, I got exporter = nil, whereas on all other simulators I got a normal non null exporter object.
I also noticed that ONLY when I set the presetName parameter to be AVAssetExportPresetPassthrough, the exporter is not nil. Any other presetName will make the initialization to fail.
Anyone has encountered the similar problems?

Apparently it's an apple bug... https://bugreport.apple.com/web/?problemID=44701489
Will report back once the original bug is closed.
EDIT: This issue has been fixed by Apple in iOS 10.1 SDK. You just update your xcode to 10.1.

Related

Unknown variable floor_tex on Gamemaker 8.1. How to fix it?

I have a very trouble with Gamemaker 8.1.
So recently, I've followed this video tutorial which shows creating a game 3D on its game engine.
https://www.youtube.com/watch?v=0Jo0JEEukhc
I tried to test my game, but an error message shows
this.
What caused that error? Here is the code so I hope you can fix it as well.
direction -= (display_mouse_get_x() -(display_get_width()/2))/5
zto -= (display_mouse_get_y() -(display_get_height()/2))/2
display_mouse_set(display_get_width()/2,display_get_height()/2)
xto = lengthdir_x(100,direction)+x
yto = lengthdir_y(100,direction)+y
d3d_set_projection(x,y,z,xto,yto,zto,0,0,1)
draw_set_color(c_white)
d3d_draw_floor(0,0,0,room_width,room_height,0,background_get_texture(floor_tex),room_width/128,room_height/128)
d3d_draw_floor(0,0,100,room_width,room_height,100,background_get_texture(root_tex),room_width/128,room_height/128)
Also, the version of Gamemaker is 8.1.141 (r11549)
Thanks
Cheers
-Sajad Sadiq Abd Amhamad
In the video, the author creates two Background resources around 0:25, called floor_tex and roof_tex (mistyped as root_tex in your code). You'd want to either name your resources accordingly or adjust your code to match the names in your project.

GlyphVector.getoutline() never returning

I am trying to create a PostScript file using the Apache xml-graphics library. When I run under Java, it works fine.
But when I build for .NET using IKVM, then on a call to GlyphVector.getoutline(x, y), the code never returns.
This is happening when I:
AttributedString as = new AttributedString(buf.toString());
// call as.addAttribute() setting various TextAttribute for various ranges
FontRenderContext frc = graphics.getFontRenderContext();
LineBreakMeasurer lineMeasurer = new LineBreakMeasurer(as.getIterator(), frc);
TextLayout layout = lineMeasurer.nextLayout(Integer.MAX_VALUE);
layout.draw (graphics, left, line.getBaseline());
Any idea what can be going wrong?
thanks - dave

Bug in IMFSinkWriter?

I implemented an encoder in 2 ways.
1) based on the SDK Transcoder example, which uses topology and transcoding profile
2) based on IMFSourceReader and IMFSinkWriter, where the Sinkwriter delivers the samples to the Sourcewriter for transcoding
I tested both implementations on Windows 8.1 with Nvidia (Quadro K2200) and Intel GPU (P4600/P4700)
But bizarrly only the topology implementation uses GPU (on both).
In 2) I both I set "MF_READWRITE_ENABLE_HARDWARE_TRANSFORMS", which has not to be set I guess, because 1) works with GPU with and without this flag set for the container type.
Is there a trick to enable GPU with IMFSinkWriter or is this a bug in the media foundation?
I had initially ran into the same issue. You don't mention how you configured the output type of the source reader (and the input type of the sink), but I found that if you allow the system to handle it (by selecting the output type of the reader to be RGB32), the performance will be horrible and all CPU bound. (error checking omitted for brevity)
hr = videoMediaType->SetGUID(MF_MT_MAJOR_TYPE, MFMediaType_Video);
hr = videoMediaType->SetGUID(MF_MT_SUBTYPE, MFVideoFormat_RGB32);
hr = reader->SetCurrentMediaType((DWORD)MF_SOURCE_READER_FIRST_VIDEO_STREAM, nullptr, videoMediaType);
reader->SetStreamSelection((DWORD)MF_SOURCE_READER_FIRST_VIDEO_STREAM, true);
And the documentation agrees, indicating that this configuration is useful for getting a single snapshot from the video. As a result, if you configure the reader to deliver the native media type, performance is excellent, but you now have to transform the format yourself.
reader->GetNativeMediaType((DWORD)MF_SOURCE_READER_FIRST_VIDEO_STREAM, videoMode->GetIndex(), videoMediaType);
From here, if you are dealing with simple color conversion (like YUY2 or YUV from a webcam) then there are a few options. I originally tried writing my own converter, and pushing that off to the GPU using HLSL with DirectCompute. This works very well, but in your case, the format isn't as trivial.
Ultimately, creating and configuring an instance of the color converter (as an IMFTransform) works perfectly.
Microsoft::WRL::ComPtr<IMFMediaType> mediaTransform;
hr = ::CoCreateInstance(CLSID_CColorConvertDMO, nullptr, CLSCTX_INPROC_SERVER, __uuidof(IMFTransform), reinterpret_cast<void**>(mediaTransform.GetAddressOf());
// set the input type of the transform to the NATIVE output type of the reader
hr = mediaTransform->SetInputType(0u, videoMediaType.Get(), 0u);
Create and configure a separate sample and buffer.
IMFSample* transformSample;
hr = ::MFCreateSample(&transformSample);
hr = ::MFCreateMemoryBuffer(RGB_MFT_OUTPUT_BUFFER_SIZE, &_transformBuffer);
hr = transformSample->AddBuffer(transformBuffer);
MFT_OUTPUT_DATA_BUFFER* transformDataBuffer;
transformDataBuffer = new MFT_OUTPUT_DATA_BUFFER();
transformDataBuffer->pSample = _transformSample;
transformDataBuffer->dwStreamID = 0u;
transformDataBuffer->dwStatus = 0u;
transformDataBuffer->pEvents = nullptr;
When receiving samples from the source, hand them off to the transform to be converted.
hr = mediaTransform->ProcessInput(0u, sample, 0u));
hr = mediaTransform->ProcessOutput(0u, 1u, transformDataBuffer, &outStatus));
hr = transformDataBuffer->pSample->GetBufferByIndex(0, &mediaBuffer);
Then of course, finally hand off the transformed sample to the sink just as you do today. I am confident that this will work, and you will be a very happy person. For me, I went from 20% CPU utilization (originally implementation) down to 2% (I am concurrently displaying the video). Good luck. I hope you enjoy your project.

Cannot find overload for '/', '*', Failure when running an app on anything but iPhone 5s simulator

My game builds and runs successfully on the iPhone 5s simulator, but when I try on any other version I get the following two errors:
`Could not find an overload for '*' that accepts the supplied arguments`
`Could not find an overload for '/' that accepts the supplied arguments`
I'm writing my game entirely in Swift, and the deployment target is iOS 7.1
The die rolls in the picture are defined as
let lengthDiceroll = Double(arc4random()) / 0x100000000
let sideDiceroll = Int(arc4random_uniform(UInt32(4)))
Your problem is a difference between 32- and 64-bit architecture. Note that the target architecture you're compiling your target for is determined by the selected device—if you've got the iPhone 4S simulator selected as your target in Xcode, for example, you'll be building for 32 bit; if you've got the iPhone 5S simulator selected, you'll be building for 64-bit.
You haven't included enough code to help us figure out what exactly is going on (we'd need to know the types of the variable you're assigning to) but here's my theory. In your first error, sprite.speed is probably a CGFloat. CGFloat is 32-bit ("float") on 32-bit targets, 64-bit ("double") on 64-bit targets. So this, for example:
var x:CGFloat = Double(arc4random()) / 0x100000000
...will compile fine on a 64-bit target, because you're putting a double into a double. But when compiling for a 32-bit target, it'll give you the error that you're getting, because you're losing precision by trying to stuff a double into a float.
This will work on both:
var x:CGFloat = CGFloat(arc4random()) / 0x100000000
Your other errors are caused by the same issue (though again, I can't reproduce them accurately without knowing what type you've declared width and height as.) For example, this will fail to compile for a 32-bit architecture:
let lengthDiceroll = Double(arc4random()) / 0x100000000
let width:CGFloat = 5
var y:CGPoint = CGPointMake(width * lengthDiceroll, 0)
...because lengthDiceroll is a Double, so width * lengthDiceroll is a Double. CGPointMake takes CGFloat arguments, so you're trying to stuff a Double (64-bit) into a float (32-bit.)
This will compile on both architectures:
let lengthDiceroll = Double(arc4random()) / 0x100000000
let width:CGFloat = 5
var y:CGPoint = CGPointMake(width * CGFloat(lengthDiceroll), 0)
...or possibly better, declare lengthDiceroll as CGFloat in the first place. It won't be as accurate on 32-bit architectures, but that's sort of the point of CGFloat:
let lengthDiceroll = CGFloat(arc4random()) / 0x100000000
let width:CGFloat = 5
var y:CGPoint = CGPointMake(width * lengthDiceroll, 0)
I've experienced similar errors where debug builds work and release builds fail for example. My advice would be make all your types explicit:
let lengthDiceroll = Double(arc4random()) / Double(0x100000000)
I've also had similar problems with CGFloat and CGPoint, make sure you explicitly use CGFloat, e.g. CGFloat(2.0)

NSOpenPanel crashes under Mountain Lion

In several of my projects I am using the following code:
NSOpenPanel * ProfilOpenPanel = [NSOpenPanel openPanel];
[ProfilOpenPanel setCanChooseFiles:YES];
[ProfilOpenPanel setCanChooseDirectories:NO];
[ProfilOpenPanel setAllowsMultipleSelection:YES];
[ProfilOpenPanel setAllowedFileTypes:[NSArray arrayWithObject:#"txt"]];
int antwort=[ProfilOpenPanel runModal];
Since upgrading to 10.8 and Xcode4.5, this code doesn’t work any more.
The panel opens, but then the app crashes with a message in the Debug Navigator as:
quicklook.pluginload(serial)
1 Thread
Thread 5
14 _pthread_wqthread
In the console, a couple of warnings appear:
WindowServer: CGXDeferSurfaces: Invalid source window 19938
and another warning:
28.September.12 12:10:40.001 Xcode[78227]: [MT] DVTAssertions: Warning in /SourceCache/IDEKit/IDEKit-1854/Framework/Classes/Editor/IDEEditorContext.m:617
Details: Lost history for x-xcode-disassembly://stack_frame? processID=31774&threadID=12&frameID=0
Object:
Method: -_greatestDocumentAncestorWasForgotten
Thread: {name = (null), num = 1}
Please file a bug at http://bugreport.apple.com with this warning message and any useful information you can provide.
Disabling my exception breakpoint in xcode worked for me. Or try just disabling all breakpoints.
Source: answer to the same poster on a blog at http://cyborgdino.com/2012/02/nsopenpanel-displaying-a-file-open-dialog-in-os-x-10-7/#comment-702

Resources