ffmpeg and NSTask
ffmpeg and NSTask
- Subject: ffmpeg and NSTask
- From: d2kagw <email@hidden>
- Date: Thu, 28 Dec 2006 09:01:21 +1100
Hi All,
I'm playing around with ffmpeg and the NSTask object trying to get my
cocoa application to produce streaming FLV files for a small project
im building, however, when I run the following code, ffmpeg returns
the error "~/Desktop/POC/text.avi: I/O error occurred Usually that
means that input file is truncated and/or corrupted."
NSTask *task;
task = [[NSTask alloc] init];
[task setLaunchPath: @"~/Desktop/POC/ffmpeg"];
NSArray *arguments;
arguments = [NSArray arrayWithObjects: @"-i", @"~/Desktop/POC/
text.avi", @"-ar", @"44100", @"-b", @"1024", @"-r", @"25", @"-s",
@"320x240", @"-vframes", @"1000", @"-y", @"~/Desktop/POC/test.flv",
nil];
[task setArguments: arguments];
NSPipe *pipe;
pipe = [NSPipe pipe];
[task setStandardOutput: pipe];
NSFileHandle *file;
file = [pipe fileHandleForReading];
[task launch];
NSData *data;
data = [file readDataToEndOfFile];
NSString *string;
string = [[NSString alloc] initWithData: data encoding:
NSUTF8StringEncoding];
NSLog (@"got\n%@", string);
Issue is, if I run that call from terminal, it works 100% with no
errors, I just get that error when I execute it using a NSTask.
Is there some strange thing in NSTask where you can use unix paths
[ like ~ ] in the parameter list?
I know the application ffmpegX does this really really well, but I
cant find the source :(
Cheers & Thanks in advance!
- Az
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden