Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fixing absolute path #8

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
70 changes: 66 additions & 4 deletions FFmpegWrapper.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,17 @@
objects = {

/* Begin PBXBuildFile section */
94FE4DA51AFB334700A4A49F /* libcrypto.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 94FE4DA21AFB334700A4A49F /* libcrypto.a */; };
94FE4DA61AFB334700A4A49F /* librtmp.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 94FE4DA31AFB334700A4A49F /* librtmp.a */; };
94FE4DA71AFB334700A4A49F /* libssl.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 94FE4DA41AFB334700A4A49F /* libssl.a */; };
94FE4DBC1AFB343200A4A49F /* FFBitstreamFilter.m in Sources */ = {isa = PBXBuildFile; fileRef = 94FE4DAD1AFB343200A4A49F /* FFBitstreamFilter.m */; };
94FE4DBD1AFB343200A4A49F /* FFFile.m in Sources */ = {isa = PBXBuildFile; fileRef = 94FE4DAF1AFB343200A4A49F /* FFFile.m */; };
94FE4DBE1AFB343200A4A49F /* FFInputFile.m in Sources */ = {isa = PBXBuildFile; fileRef = 94FE4DB11AFB343200A4A49F /* FFInputFile.m */; };
94FE4DBF1AFB343200A4A49F /* FFInputStream.m in Sources */ = {isa = PBXBuildFile; fileRef = 94FE4DB31AFB343200A4A49F /* FFInputStream.m */; };
94FE4DC01AFB343200A4A49F /* FFOutputFile.m in Sources */ = {isa = PBXBuildFile; fileRef = 94FE4DB51AFB343200A4A49F /* FFOutputFile.m */; };
94FE4DC11AFB343200A4A49F /* FFOutputStream.m in Sources */ = {isa = PBXBuildFile; fileRef = 94FE4DB71AFB343200A4A49F /* FFOutputStream.m */; };
94FE4DC21AFB343200A4A49F /* FFStream.m in Sources */ = {isa = PBXBuildFile; fileRef = 94FE4DB91AFB343200A4A49F /* FFStream.m */; };
94FE4DC31AFB343200A4A49F /* FFUtilities.m in Sources */ = {isa = PBXBuildFile; fileRef = 94FE4DBB1AFB343200A4A49F /* FFUtilities.m */; };
D95F88DA17E8C259000ADE35 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = D95F88D917E8C259000ADE35 /* Foundation.framework */; };
D95F88DF17E8C259000ADE35 /* FFmpegWrapper.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = D95F88DE17E8C259000ADE35 /* FFmpegWrapper.h */; };
D95F88E117E8C259000ADE35 /* FFmpegWrapper.m in Sources */ = {isa = PBXBuildFile; fileRef = D95F88E017E8C259000ADE35 /* FFmpegWrapper.m */; };
Expand Down Expand Up @@ -49,6 +60,25 @@
/* End PBXCopyFilesBuildPhase section */

/* Begin PBXFileReference section */
94FE4DA21AFB334700A4A49F /* libcrypto.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; path = libcrypto.a; sourceTree = "<group>"; };
94FE4DA31AFB334700A4A49F /* librtmp.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; path = librtmp.a; sourceTree = "<group>"; };
94FE4DA41AFB334700A4A49F /* libssl.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; path = libssl.a; sourceTree = "<group>"; };
94FE4DAC1AFB343200A4A49F /* FFBitstreamFilter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = FFBitstreamFilter.h; sourceTree = "<group>"; };
94FE4DAD1AFB343200A4A49F /* FFBitstreamFilter.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = FFBitstreamFilter.m; sourceTree = "<group>"; };
94FE4DAE1AFB343200A4A49F /* FFFile.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = FFFile.h; sourceTree = "<group>"; };
94FE4DAF1AFB343200A4A49F /* FFFile.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = FFFile.m; sourceTree = "<group>"; };
94FE4DB01AFB343200A4A49F /* FFInputFile.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = FFInputFile.h; sourceTree = "<group>"; };
94FE4DB11AFB343200A4A49F /* FFInputFile.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = FFInputFile.m; sourceTree = "<group>"; };
94FE4DB21AFB343200A4A49F /* FFInputStream.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = FFInputStream.h; sourceTree = "<group>"; };
94FE4DB31AFB343200A4A49F /* FFInputStream.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = FFInputStream.m; sourceTree = "<group>"; };
94FE4DB41AFB343200A4A49F /* FFOutputFile.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = FFOutputFile.h; sourceTree = "<group>"; };
94FE4DB51AFB343200A4A49F /* FFOutputFile.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = FFOutputFile.m; sourceTree = "<group>"; };
94FE4DB61AFB343200A4A49F /* FFOutputStream.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = FFOutputStream.h; sourceTree = "<group>"; };
94FE4DB71AFB343200A4A49F /* FFOutputStream.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = FFOutputStream.m; sourceTree = "<group>"; };
94FE4DB81AFB343200A4A49F /* FFStream.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = FFStream.h; sourceTree = "<group>"; };
94FE4DB91AFB343200A4A49F /* FFStream.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = FFStream.m; sourceTree = "<group>"; };
94FE4DBA1AFB343200A4A49F /* FFUtilities.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = FFUtilities.h; sourceTree = "<group>"; };
94FE4DBB1AFB343200A4A49F /* FFUtilities.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = FFUtilities.m; sourceTree = "<group>"; };
D95F88D617E8C259000ADE35 /* libFFmpegWrapper.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libFFmpegWrapper.a; sourceTree = BUILT_PRODUCTS_DIR; };
D95F88D917E8C259000ADE35 /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; };
D95F88DD17E8C259000ADE35 /* FFmpegWrapper-Prefix.pch */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "FFmpegWrapper-Prefix.pch"; sourceTree = "<group>"; };
Expand Down Expand Up @@ -151,14 +181,17 @@
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
94FE4DA61AFB334700A4A49F /* librtmp.a in Frameworks */,
D9CF4BA117E8CA1A00E7EE87 /* libavutil.a in Frameworks */,
94FE4DA71AFB334700A4A49F /* libssl.a in Frameworks */,
D9CF4B9F17E8CA1A00E7EE87 /* libavfilter.a in Frameworks */,
D95F88DA17E8C259000ADE35 /* Foundation.framework in Frameworks */,
D9CF4B9E17E8CA1A00E7EE87 /* libavdevice.a in Frameworks */,
D9CF4BA317E8CA1A00E7EE87 /* libswscale.a in Frameworks */,
D9CF4BA017E8CA1A00E7EE87 /* libavformat.a in Frameworks */,
D9CF4BA217E8CA1A00E7EE87 /* libswresample.a in Frameworks */,
D9CF4B9D17E8CA1A00E7EE87 /* libavcodec.a in Frameworks */,
94FE4DA51AFB334700A4A49F /* libcrypto.a in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
};
Expand Down Expand Up @@ -209,6 +242,22 @@
D95F88DB17E8C259000ADE35 /* FFmpegWrapper */ = {
isa = PBXGroup;
children = (
94FE4DAC1AFB343200A4A49F /* FFBitstreamFilter.h */,
94FE4DAD1AFB343200A4A49F /* FFBitstreamFilter.m */,
94FE4DAE1AFB343200A4A49F /* FFFile.h */,
94FE4DAF1AFB343200A4A49F /* FFFile.m */,
94FE4DB01AFB343200A4A49F /* FFInputFile.h */,
94FE4DB11AFB343200A4A49F /* FFInputFile.m */,
94FE4DB21AFB343200A4A49F /* FFInputStream.h */,
94FE4DB31AFB343200A4A49F /* FFInputStream.m */,
94FE4DB41AFB343200A4A49F /* FFOutputFile.h */,
94FE4DB51AFB343200A4A49F /* FFOutputFile.m */,
94FE4DB61AFB343200A4A49F /* FFOutputStream.h */,
94FE4DB71AFB343200A4A49F /* FFOutputStream.m */,
94FE4DB81AFB343200A4A49F /* FFStream.h */,
94FE4DB91AFB343200A4A49F /* FFStream.m */,
94FE4DBA1AFB343200A4A49F /* FFUtilities.h */,
94FE4DBB1AFB343200A4A49F /* FFUtilities.m */,
D95F88DE17E8C259000ADE35 /* FFmpegWrapper.h */,
D95F88E017E8C259000ADE35 /* FFmpegWrapper.m */,
D95F88DC17E8C259000ADE35 /* Supporting Files */,
Expand Down Expand Up @@ -386,6 +435,9 @@
D9CF4B9517E8CA1A00E7EE87 /* lib */ = {
isa = PBXGroup;
children = (
94FE4DA21AFB334700A4A49F /* libcrypto.a */,
94FE4DA31AFB334700A4A49F /* librtmp.a */,
94FE4DA41AFB334700A4A49F /* libssl.a */,
D9CF4B9617E8CA1A00E7EE87 /* libavcodec.a */,
D9CF4B9717E8CA1A00E7EE87 /* libavdevice.a */,
D9CF4B9817E8CA1A00E7EE87 /* libavfilter.a */,
Expand Down Expand Up @@ -496,7 +548,15 @@
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
files = (
94FE4DC11AFB343200A4A49F /* FFOutputStream.m in Sources */,
94FE4DBF1AFB343200A4A49F /* FFInputStream.m in Sources */,
94FE4DC31AFB343200A4A49F /* FFUtilities.m in Sources */,
94FE4DBE1AFB343200A4A49F /* FFInputFile.m in Sources */,
94FE4DBD1AFB343200A4A49F /* FFFile.m in Sources */,
D95F88E117E8C259000ADE35 /* FFmpegWrapper.m in Sources */,
94FE4DC21AFB343200A4A49F /* FFStream.m in Sources */,
94FE4DC01AFB343200A4A49F /* FFOutputFile.m in Sources */,
94FE4DBC1AFB343200A4A49F /* FFBitstreamFilter.m in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
Expand Down Expand Up @@ -609,11 +669,12 @@
HEADER_SEARCH_PATHS = (
"$(inherited)",
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include,
"$(SRCROOT)/Submodules/FFmpeg-iOS/dependencies/include",
"$(SRCROOT)/Submodules/FFmpeg-iOS/dependencies/include/**",
);
LIBRARY_SEARCH_PATHS = (
"$(inherited)",
"/Users/chrisbal/FFmpegWrapper/Submodules/FFmpeg-iOS/dependencies/lib",
"$(SRCROOT)/Submodules/FFmpeg-iOS/dependencies/lib",
"$(PROJECT_DIR)/Submodules/FFmpeg-iOS/dependencies/lib",
);
OTHER_LDFLAGS = "-ObjC";
PRODUCT_NAME = "$(TARGET_NAME)";
Expand All @@ -630,11 +691,12 @@
HEADER_SEARCH_PATHS = (
"$(inherited)",
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include,
"$(SRCROOT)/Submodules/FFmpeg-iOS/dependencies/include",
"$(SRCROOT)/Submodules/FFmpeg-iOS/dependencies/include/**",
);
LIBRARY_SEARCH_PATHS = (
"$(inherited)",
"/Users/chrisbal/FFmpegWrapper/Submodules/FFmpeg-iOS/dependencies/lib",
"$(SRCROOT)/Submodules/FFmpeg-iOS/dependencies/lib",
"$(PROJECT_DIR)/Submodules/FFmpeg-iOS/dependencies/lib",
);
OTHER_LDFLAGS = "-ObjC";
PRODUCT_NAME = "$(TARGET_NAME)";
Expand Down
1 change: 1 addition & 0 deletions FFmpegWrapper/FFInputFile.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
#import "FFFile.h"

@interface FFInputFile : FFFile

@property (nonatomic) BOOL endOfFileReached;
@property (nonatomic) int64_t timestampOffset;
@property (nonatomic) int64_t lastTimestamp;
Expand Down
15 changes: 14 additions & 1 deletion FFmpegWrapper/FFInputFile.m
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,9 @@
#import "FFInputStream.h"
#import "FFUtilities.h"

NSString const *kFFmpegInputFormatKey = @"kFFmpegInputFormatKey";
NSString* const kFFmpegInputFormatKey = @"kFFmpegInputFormatKey";
NSString* const kFFmpegMovFlag = @"movflags";
NSString* const kFFmpegCodecFlag = @"codec";

@implementation FFInputFile
@synthesize endOfFileReached, timestampOffset, lastTimestamp, formatContext;
Expand All @@ -24,12 +26,23 @@ - (AVFormatContext*) formatContextForInputPath:(NSString*)inputPath options:(NSD
AVFormatContext *inputFormatContext = NULL;
AVInputFormat *inputFormat = NULL;
AVDictionary *inputOptions = NULL;


NSString *inputFormatString = [options objectForKey:kFFmpegInputFormatKey];
if (inputFormatString) {
inputFormat = av_find_input_format([inputFormatString UTF8String]);
}

NSString* movFlags = [options objectForKey:kFFmpegMovFlag];
if (movFlags) {
av_dict_set(&inputOptions, "movflags", [movFlags UTF8String], 0);
}

NSString* codec = [options objectForKey:kFFmpegCodecFlag];
if (codec) {
av_dict_set(&inputOptions, "codec", [codec UTF8String], 0);
}

// It's possible to send more options to the parser
// av_dict_set(&inputOptions, "video_size", "640x480", 0);
// av_dict_set(&inputOptions, "pixel_format", "rgb24", 0);
Expand Down
1 change: 1 addition & 0 deletions FFmpegWrapper/FFOutputFile.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
@interface FFOutputFile : FFFile
@property (nonatomic) int64_t startTime;


// No need to call this function directly, streams are automatically added when created
- (void) addOutputStream:(FFOutputStream*)outputStream;

Expand Down
2 changes: 1 addition & 1 deletion FFmpegWrapper/FFOutputFile.m
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ @interface FFOutputFile()
@end

@implementation FFOutputFile
@synthesize startTime, formatContext, bitstreamFilters;
@synthesize startTime, formatContext, bitstreamFilters, streams = _streams;;

- (void) addBitstreamFilter:(FFBitstreamFilter *)bitstreamFilter {
[bitstreamFilters addObject:bitstreamFilter];
Expand Down
3 changes: 3 additions & 0 deletions FFmpegWrapper/FFmpegWrapper.h
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,9 @@ typedef void(^FFmpegWrapperProgressBlock)(NSUInteger bytesRead, uint64_t totalBy
*/
extern NSString const *kFFmpegInputFormatKey;

extern NSString* const kFFmpegMovFlag;
extern NSString* const kFFmpegCodecFlag;

/**
Required. This controls the type of container for the output format. Accepts NSString values like @"mp4", @"avi", @"mpegts". For a full list of supported formats please consult `$ ffmpeg -formats`.
*/
Expand Down