-1

I have video data, I need to convert the data into '.h264' format and save into a Temporary file.

 NSString* filename = [NSString stringWithFormat:@"capture.h264"];
    NSString* path = [NSTemporaryDirectory() stringByAppendingPathComponent:filename];
    NSURL* url = [NSURL fileURLWithPath:path]; 

I have created the temporary file path but, how can I attach the data along with the file and save.

Editted:

Vineesh TP
  • 7,755
  • 12
  • 66
  • 130
  • What do you mean by rawByte. Do you you pixel data, or encoded video data. If the former, compress with vtcomoressionsession, if it's already encoded, you already know the answer from your other post. – szatmary Feb 22 '17 at 14:46

1 Answers1

0

Sorry. I was my mistake. self answering.

NSData *data = [[NSData alloc]initWithBase64EncodedString:val options:0];
 NSString* filename = [NSString stringWithFormat:@"capture.h264"];
 NSString* htmlFilePath = [NSTemporaryDirectory() stringByAppendingPathComponent:filename];
 [data writeToFile:htmlFilePath atomically:YES];
Vineesh TP
  • 7,755
  • 12
  • 66
  • 130
  • It will not work because in order to make it the proper h264 file you need to first encode it as h264 and then decode it. – Nirbhay Singh Mar 19 '19 at 10:08