avmetadataitem

Encoding of AVMetadataItem

末鹿安然 提交于 2020-01-01 12:11:21
问题 I have a AVMetadataItem which has fields encoded in CP1251 (Cyrillic). After reading item.stringValue I get garbage - incorrectly encoded string. I've tried converting that string to raw UTF8 and then creating a new string using the CP1251 encoding - no luck, result is nil. Tried taking the item.dataValue - no dice, it contains a raw list data (starting with bplist...). Any ideas are very appreciated. Thanks in advance. 回答1: Swift 2.0 solution: let origTitleMeta: NSData = (<AVMetadataItem>

Writing ID3 tags via AVMetaDataItem

99封情书 提交于 2019-12-19 03:57:04
问题 I'm writing ID3 tags to a file using AVMetaDataItem var soundFileMetadata = [AVMetadataItem]() soundFileMetadata.append(createMetadata(AVMetadataiTunesMetadataKeyArtist, "MyArtist")!) soundFileMetadata.append(createMetadata(AVMetadataiTunesMetadataKeySongName, "MySong")!) soundFileMetadata.append(createMetadata(AVMetadataiTunesMetadataKeyAlbum, "MyAlbum")!) soundFileMetadata.append(createMetadata(AVMetadataiTunesMetadataKeyUserGenre, "MyGenre")!) soundFileMetadata.append(createMetadata

Change AVMetadataItem

风格不统一 提交于 2019-12-18 16:52:56
问题 I have some files, -m4a -mp4 -mp3 etc. I want to change these details AVMetadataItem AVMetadataCommonKeyArtwork AVMetadataCommonKeyArtist I can do with AVAssetExportSession , But I need to change the directory. Is there a way I can write directly on the file please? I found this program, but does not work :( NSError *error; AVAssetWriter *assetWrtr = [[AVAssetWriter alloc] initWithURL:[NSURL fileURLWithPath:self.path] fileType:AVFileTypeAppleM4A error:&error]; NSLog(@"%@",error); NSArray

Xcode AVCapturesession scan Barcode in specific frame (rectOfInterest is not working)

穿精又带淫゛_ 提交于 2019-12-18 09:18:58
问题 I am trying to design a barcode scanner for an App i am currently working on. I want the scanner preview to fill the whole screen of the device and provide a smaller frame to point at barcodes. All is working how i want it but i can not get the frame of interest to work. Here is the Implementation of the barcode scanner: #import "GEScannerViewController.h" @import AVFoundation; @interface GEScannerViewController () <AVCaptureMetadataOutputObjectsDelegate> { AVCaptureSession *_session;

How can I extract metadata from mp3 file in ios development

回眸只為那壹抹淺笑 提交于 2019-12-12 07:38:09
问题 I am working on an ios music player with cloud storage. I need to extract the music information such as title, artist, artwork. I have an action called playit which plays and pauses the mp3 file. It should also populate some UILables and UIImage with the metadtaa that is associated with the mp3 file. The problem is that I could not get the metadata extracted from more than different 25 mp3 files. Here is my code: The file url is correct because the audio player is able to find and play it,

Avmetadataitem Getting the trackNumber from an iTunes or ID3 metadata on iOS

ぃ、小莉子 提交于 2019-12-05 07:00:51
问题 I'm trying to get the trackNumber of a aac, mp3 or mp4 file. It's not in the commonMetadata so I started to spelunk in the other metadata keys. I found something that looks like it, but I'm yet unable to read it, and make sense of it. Even the raw data makes no sense to me. At the moment, I'm just trying to get it using this basic code: NSArray *meta = [asset metadataForFormat:AVMetadataFormatiTunesMetadata]; for ( AVMetadataItem* item in meta ) { id key = [item key]; NSString *value = [item

Writing ID3 tags via AVMetaDataItem

我们两清 提交于 2019-11-30 22:52:30
I'm writing ID3 tags to a file using AVMetaDataItem var soundFileMetadata = [AVMetadataItem]() soundFileMetadata.append(createMetadata(AVMetadataiTunesMetadataKeyArtist, "MyArtist")!) soundFileMetadata.append(createMetadata(AVMetadataiTunesMetadataKeySongName, "MySong")!) soundFileMetadata.append(createMetadata(AVMetadataiTunesMetadataKeyAlbum, "MyAlbum")!) soundFileMetadata.append(createMetadata(AVMetadataiTunesMetadataKeyUserGenre, "MyGenre")!) soundFileMetadata.append(createMetadata(AVMetadataiTunesMetadataKeyComposer, "MyComposer")!) Here is the createMetadata convenience method: func

Change AVMetadataItem

江枫思渺然 提交于 2019-11-30 14:34:56
I have some files, -m4a -mp4 -mp3 etc. I want to change these details AVMetadataItem AVMetadataCommonKeyArtwork AVMetadataCommonKeyArtist I can do with AVAssetExportSession , But I need to change the directory. Is there a way I can write directly on the file please? I found this program, but does not work :( NSError *error; AVAssetWriter *assetWrtr = [[AVAssetWriter alloc] initWithURL:[NSURL fileURLWithPath:self.path] fileType:AVFileTypeAppleM4A error:&error]; NSLog(@"%@",error); NSArray *existingMetadataArray = assetWrtr.metadata; NSMutableArray *newMetadataArray = nil; if

Xcode AVCapturesession scan Barcode in specific frame (rectOfInterest is not working)

荒凉一梦 提交于 2019-11-29 15:59:26
I am trying to design a barcode scanner for an App i am currently working on. I want the scanner preview to fill the whole screen of the device and provide a smaller frame to point at barcodes. All is working how i want it but i can not get the frame of interest to work. Here is the Implementation of the barcode scanner: #import "GEScannerViewController.h" @import AVFoundation; @interface GEScannerViewController () <AVCaptureMetadataOutputObjectsDelegate> { AVCaptureSession *_session; AVCaptureDevice *_device; AVCaptureDeviceInput *_input; AVCaptureMetadataOutput *_output;