Skip to content

Commit d8a5c61

Browse files
committed
AVReaderWriter: Version 3.1, 2016-09-13
Update for Swift 2.3 This sample demonstrates how to use AVAssetReader and AVAssetWriter to perform offline (i.e. non-real-time) processing of video and audio.
1 parent ec9471a commit d8a5c61

26 files changed

+5302
-0
lines changed

AVReaderWriter/LICENSE.txt

+42
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
Sample code project: AVReaderWriter: Offline Audio / Video Processing
2+
Version: 3.1
3+
4+
IMPORTANT: This Apple software is supplied to you by Apple
5+
Inc. ("Apple") in consideration of your agreement to the following
6+
terms, and your use, installation, modification or redistribution of
7+
this Apple software constitutes acceptance of these terms. If you do
8+
not agree with these terms, please do not use, install, modify or
9+
redistribute this Apple software.
10+
11+
In consideration of your agreement to abide by the following terms, and
12+
subject to these terms, Apple grants you a personal, non-exclusive
13+
license, under Apple's copyrights in this original Apple software (the
14+
"Apple Software"), to use, reproduce, modify and redistribute the Apple
15+
Software, with or without modifications, in source and/or binary forms;
16+
provided that if you redistribute the Apple Software in its entirety and
17+
without modifications, you must retain this notice and the following
18+
text and disclaimers in all such redistributions of the Apple Software.
19+
Neither the name, trademarks, service marks or logos of Apple Inc. may
20+
be used to endorse or promote products derived from the Apple Software
21+
without specific prior written permission from Apple. Except as
22+
expressly stated in this notice, no other rights or licenses, express or
23+
implied, are granted by Apple herein, including but not limited to any
24+
patent rights that may be infringed by your derivative works or by other
25+
works in which the Apple Software may be incorporated.
26+
27+
The Apple Software is provided by Apple on an "AS IS" basis. APPLE
28+
MAKES NO WARRANTIES, EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION
29+
THE IMPLIED WARRANTIES OF NON-INFRINGEMENT, MERCHANTABILITY AND FITNESS
30+
FOR A PARTICULAR PURPOSE, REGARDING THE APPLE SOFTWARE OR ITS USE AND
31+
OPERATION ALONE OR IN COMBINATION WITH YOUR PRODUCTS.
32+
33+
IN NO EVENT SHALL APPLE BE LIABLE FOR ANY SPECIAL, INDIRECT, INCIDENTAL
34+
OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
35+
SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
36+
INTERRUPTION) ARISING IN ANY WAY OUT OF THE USE, REPRODUCTION,
37+
MODIFICATION AND/OR DISTRIBUTION OF THE APPLE SOFTWARE, HOWEVER CAUSED
38+
AND WHETHER UNDER THEORY OF CONTRACT, TORT (INCLUDING NEGLIGENCE),
39+
STRICT LIABILITY OR OTHERWISE, EVEN IF APPLE HAS BEEN ADVISED OF THE
40+
POSSIBILITY OF SUCH DAMAGE.
41+
42+
Copyright (C) 2016 Apple Inc. All Rights Reserved.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,319 @@
1+
// !$*UTF8*$!
2+
{
3+
archiveVersion = 1;
4+
classes = {
5+
};
6+
objectVersion = 46;
7+
objects = {
8+
9+
/* Begin PBXBuildFile section */
10+
EE33EA6D1370DF3100F77FCE /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = EE33EA6B1370DF3100F77FCE /* InfoPlist.strings */; };
11+
EE33EA701370DF3100F77FCE /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = EE33EA6F1370DF3100F77FCE /* main.m */; };
12+
EE33EA761370DF3100F77FCE /* AAPLDocument.m in Sources */ = {isa = PBXBuildFile; fileRef = EE33EA751370DF3100F77FCE /* AAPLDocument.m */; };
13+
EE33EA791370DF3100F77FCE /* AAPLDocument.xib in Resources */ = {isa = PBXBuildFile; fileRef = EE33EA771370DF3100F77FCE /* AAPLDocument.xib */; };
14+
EE33EA7C1370DF3100F77FCE /* MainMenu.xib in Resources */ = {isa = PBXBuildFile; fileRef = EE33EA7A1370DF3100F77FCE /* MainMenu.xib */; };
15+
EEB8F96C1399AF67004FEB2E /* AAPLProgressPanelController.m in Sources */ = {isa = PBXBuildFile; fileRef = EEB8F96B1399AF67004FEB2E /* AAPLProgressPanelController.m */; };
16+
EEB8F96F1399AFA0004FEB2E /* AAPLProgressPanel.xib in Resources */ = {isa = PBXBuildFile; fileRef = EEB8F96E1399AFA0004FEB2E /* AAPLProgressPanel.xib */; };
17+
EEDD0D04139D9946008A5566 /* AudioOnly2x.png in Resources */ = {isa = PBXBuildFile; fileRef = EEDD0D03139D9946008A5566 /* AudioOnly2x.png */; };
18+
EEDD0D07139D9A42008A5566 /* ErrorLoading2x.png in Resources */ = {isa = PBXBuildFile; fileRef = EEDD0D06139D9A42008A5566 /* ErrorLoading2x.png */; };
19+
/* End PBXBuildFile section */
20+
21+
/* Begin PBXFileReference section */
22+
3E7D60AB1B1FA25E001EAE8D /* README.md */ = {isa = PBXFileReference; lastKnownFileType = net.daringfireball.markdown; name = README.md; path = ../README.md; sourceTree = "<group>"; };
23+
EE33EA5E1370DF3100F77FCE /* AVReaderWriter.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = AVReaderWriter.app; sourceTree = BUILT_PRODUCTS_DIR; };
24+
EE33EA6A1370DF3100F77FCE /* AVReaderWriterOSX-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "AVReaderWriterOSX-Info.plist"; sourceTree = "<group>"; };
25+
EE33EA6C1370DF3100F77FCE /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = "<group>"; };
26+
EE33EA6F1370DF3100F77FCE /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = "<group>"; };
27+
EE33EA741370DF3100F77FCE /* AAPLDocument.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AAPLDocument.h; sourceTree = "<group>"; };
28+
EE33EA751370DF3100F77FCE /* AAPLDocument.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = AAPLDocument.m; sourceTree = "<group>"; };
29+
EE33EA781370DF3100F77FCE /* en */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = en; path = en.lproj/AAPLDocument.xib; sourceTree = "<group>"; };
30+
EE33EA7B1370DF3100F77FCE /* en */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = en; path = en.lproj/MainMenu.xib; sourceTree = "<group>"; };
31+
EEB8F96A1399AF67004FEB2E /* AAPLProgressPanelController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AAPLProgressPanelController.h; sourceTree = "<group>"; };
32+
EEB8F96B1399AF67004FEB2E /* AAPLProgressPanelController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = AAPLProgressPanelController.m; sourceTree = "<group>"; };
33+
EEB8F96E1399AFA0004FEB2E /* AAPLProgressPanel.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = AAPLProgressPanel.xib; sourceTree = "<group>"; };
34+
EEDD0D03139D9946008A5566 /* AudioOnly2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = AudioOnly2x.png; sourceTree = "<group>"; };
35+
EEDD0D06139D9A42008A5566 /* ErrorLoading2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = ErrorLoading2x.png; sourceTree = "<group>"; };
36+
/* End PBXFileReference section */
37+
38+
/* Begin PBXFrameworksBuildPhase section */
39+
EE33EA5B1370DF3100F77FCE /* Frameworks */ = {
40+
isa = PBXFrameworksBuildPhase;
41+
buildActionMask = 2147483647;
42+
files = (
43+
);
44+
runOnlyForDeploymentPostprocessing = 0;
45+
};
46+
/* End PBXFrameworksBuildPhase section */
47+
48+
/* Begin PBXGroup section */
49+
EE33EA531370DF3100F77FCE = {
50+
isa = PBXGroup;
51+
children = (
52+
3E7D60AB1B1FA25E001EAE8D /* README.md */,
53+
EE33EA681370DF3100F77FCE /* AVReaderWriterOSX */,
54+
EE33EA5F1370DF3100F77FCE /* Products */,
55+
);
56+
sourceTree = "<group>";
57+
};
58+
EE33EA5F1370DF3100F77FCE /* Products */ = {
59+
isa = PBXGroup;
60+
children = (
61+
EE33EA5E1370DF3100F77FCE /* AVReaderWriter.app */,
62+
);
63+
name = Products;
64+
sourceTree = "<group>";
65+
};
66+
EE33EA681370DF3100F77FCE /* AVReaderWriterOSX */ = {
67+
isa = PBXGroup;
68+
children = (
69+
EE33EA741370DF3100F77FCE /* AAPLDocument.h */,
70+
EE33EA751370DF3100F77FCE /* AAPLDocument.m */,
71+
EEB8F96A1399AF67004FEB2E /* AAPLProgressPanelController.h */,
72+
EEB8F96B1399AF67004FEB2E /* AAPLProgressPanelController.m */,
73+
EEDD0D64139DA9A3008A5566 /* Resources */,
74+
EE33EA691370DF3100F77FCE /* Supporting Files */,
75+
);
76+
path = AVReaderWriterOSX;
77+
sourceTree = "<group>";
78+
};
79+
EE33EA691370DF3100F77FCE /* Supporting Files */ = {
80+
isa = PBXGroup;
81+
children = (
82+
EE33EA6A1370DF3100F77FCE /* AVReaderWriterOSX-Info.plist */,
83+
EE33EA6B1370DF3100F77FCE /* InfoPlist.strings */,
84+
EE33EA6F1370DF3100F77FCE /* main.m */,
85+
);
86+
name = "Supporting Files";
87+
sourceTree = "<group>";
88+
};
89+
EEDD0D64139DA9A3008A5566 /* Resources */ = {
90+
isa = PBXGroup;
91+
children = (
92+
EE33EA771370DF3100F77FCE /* AAPLDocument.xib */,
93+
EEB8F96E1399AFA0004FEB2E /* AAPLProgressPanel.xib */,
94+
EE33EA7A1370DF3100F77FCE /* MainMenu.xib */,
95+
EEDD0D03139D9946008A5566 /* AudioOnly2x.png */,
96+
EEDD0D06139D9A42008A5566 /* ErrorLoading2x.png */,
97+
);
98+
name = Resources;
99+
sourceTree = "<group>";
100+
};
101+
/* End PBXGroup section */
102+
103+
/* Begin PBXNativeTarget section */
104+
EE33EA5D1370DF3100F77FCE /* AVReaderWriterOSX */ = {
105+
isa = PBXNativeTarget;
106+
buildConfigurationList = EE33EA7F1370DF3100F77FCE /* Build configuration list for PBXNativeTarget "AVReaderWriterOSX" */;
107+
buildPhases = (
108+
EE33EA5A1370DF3100F77FCE /* Sources */,
109+
EE33EA5B1370DF3100F77FCE /* Frameworks */,
110+
EE33EA5C1370DF3100F77FCE /* Resources */,
111+
);
112+
buildRules = (
113+
);
114+
dependencies = (
115+
);
116+
name = AVReaderWriterOSX;
117+
productName = ReaderWriter;
118+
productReference = EE33EA5E1370DF3100F77FCE /* AVReaderWriter.app */;
119+
productType = "com.apple.product-type.application";
120+
};
121+
/* End PBXNativeTarget section */
122+
123+
/* Begin PBXProject section */
124+
EE33EA551370DF3100F77FCE /* Project object */ = {
125+
isa = PBXProject;
126+
attributes = {
127+
LastSwiftUpdateCheck = 0700;
128+
LastUpgradeCheck = 0700;
129+
};
130+
buildConfigurationList = EE33EA581370DF3100F77FCE /* Build configuration list for PBXProject "AVReaderWriter" */;
131+
compatibilityVersion = "Xcode 3.2";
132+
developmentRegion = English;
133+
hasScannedForEncodings = 0;
134+
knownRegions = (
135+
en,
136+
);
137+
mainGroup = EE33EA531370DF3100F77FCE;
138+
productRefGroup = EE33EA5F1370DF3100F77FCE /* Products */;
139+
projectDirPath = "";
140+
projectRoot = "";
141+
targets = (
142+
EE33EA5D1370DF3100F77FCE /* AVReaderWriterOSX */,
143+
);
144+
};
145+
/* End PBXProject section */
146+
147+
/* Begin PBXResourcesBuildPhase section */
148+
EE33EA5C1370DF3100F77FCE /* Resources */ = {
149+
isa = PBXResourcesBuildPhase;
150+
buildActionMask = 2147483647;
151+
files = (
152+
EE33EA6D1370DF3100F77FCE /* InfoPlist.strings in Resources */,
153+
EE33EA791370DF3100F77FCE /* AAPLDocument.xib in Resources */,
154+
EE33EA7C1370DF3100F77FCE /* MainMenu.xib in Resources */,
155+
EEB8F96F1399AFA0004FEB2E /* AAPLProgressPanel.xib in Resources */,
156+
EEDD0D04139D9946008A5566 /* AudioOnly2x.png in Resources */,
157+
EEDD0D07139D9A42008A5566 /* ErrorLoading2x.png in Resources */,
158+
);
159+
runOnlyForDeploymentPostprocessing = 0;
160+
};
161+
/* End PBXResourcesBuildPhase section */
162+
163+
/* Begin PBXSourcesBuildPhase section */
164+
EE33EA5A1370DF3100F77FCE /* Sources */ = {
165+
isa = PBXSourcesBuildPhase;
166+
buildActionMask = 2147483647;
167+
files = (
168+
EE33EA701370DF3100F77FCE /* main.m in Sources */,
169+
EE33EA761370DF3100F77FCE /* AAPLDocument.m in Sources */,
170+
EEB8F96C1399AF67004FEB2E /* AAPLProgressPanelController.m in Sources */,
171+
);
172+
runOnlyForDeploymentPostprocessing = 0;
173+
};
174+
/* End PBXSourcesBuildPhase section */
175+
176+
/* Begin PBXVariantGroup section */
177+
EE33EA6B1370DF3100F77FCE /* InfoPlist.strings */ = {
178+
isa = PBXVariantGroup;
179+
children = (
180+
EE33EA6C1370DF3100F77FCE /* en */,
181+
);
182+
name = InfoPlist.strings;
183+
sourceTree = "<group>";
184+
};
185+
EE33EA771370DF3100F77FCE /* AAPLDocument.xib */ = {
186+
isa = PBXVariantGroup;
187+
children = (
188+
EE33EA781370DF3100F77FCE /* en */,
189+
);
190+
name = AAPLDocument.xib;
191+
sourceTree = "<group>";
192+
};
193+
EE33EA7A1370DF3100F77FCE /* MainMenu.xib */ = {
194+
isa = PBXVariantGroup;
195+
children = (
196+
EE33EA7B1370DF3100F77FCE /* en */,
197+
);
198+
name = MainMenu.xib;
199+
sourceTree = "<group>";
200+
};
201+
/* End PBXVariantGroup section */
202+
203+
/* Begin XCBuildConfiguration section */
204+
EE33EA7D1370DF3100F77FCE /* Debug */ = {
205+
isa = XCBuildConfiguration;
206+
buildSettings = {
207+
CLANG_ENABLE_MODULES = YES;
208+
CLANG_WARN_BOOL_CONVERSION = YES;
209+
CLANG_WARN_CONSTANT_CONVERSION = YES;
210+
CLANG_WARN_EMPTY_BODY = YES;
211+
CLANG_WARN_ENUM_CONVERSION = YES;
212+
CLANG_WARN_INT_CONVERSION = YES;
213+
CLANG_WARN_UNREACHABLE_CODE = YES;
214+
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
215+
ENABLE_STRICT_OBJC_MSGSEND = YES;
216+
ENABLE_TESTABILITY = YES;
217+
GCC_C_LANGUAGE_STANDARD = gnu99;
218+
GCC_NO_COMMON_BLOCKS = YES;
219+
GCC_OPTIMIZATION_LEVEL = 0;
220+
GCC_PREPROCESSOR_DEFINITIONS = "DEBUG=1";
221+
GCC_SYMBOLS_PRIVATE_EXTERN = NO;
222+
GCC_VERSION = com.apple.compilers.llvm.clang.1_0;
223+
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
224+
GCC_WARN_ABOUT_MISSING_PROTOTYPES = YES;
225+
GCC_WARN_ABOUT_RETURN_TYPE = YES;
226+
GCC_WARN_UNDECLARED_SELECTOR = YES;
227+
GCC_WARN_UNINITIALIZED_AUTOS = YES;
228+
GCC_WARN_UNUSED_FUNCTION = YES;
229+
GCC_WARN_UNUSED_VARIABLE = YES;
230+
MACOSX_DEPLOYMENT_TARGET = 10.7;
231+
ONLY_ACTIVE_ARCH = YES;
232+
SDKROOT = macosx;
233+
};
234+
name = Debug;
235+
};
236+
EE33EA7E1370DF3100F77FCE /* Release */ = {
237+
isa = XCBuildConfiguration;
238+
buildSettings = {
239+
CLANG_ENABLE_MODULES = YES;
240+
CLANG_WARN_BOOL_CONVERSION = YES;
241+
CLANG_WARN_CONSTANT_CONVERSION = YES;
242+
CLANG_WARN_EMPTY_BODY = YES;
243+
CLANG_WARN_ENUM_CONVERSION = YES;
244+
CLANG_WARN_INT_CONVERSION = YES;
245+
CLANG_WARN_UNREACHABLE_CODE = YES;
246+
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
247+
ENABLE_STRICT_OBJC_MSGSEND = YES;
248+
GCC_C_LANGUAGE_STANDARD = gnu99;
249+
GCC_NO_COMMON_BLOCKS = YES;
250+
GCC_VERSION = com.apple.compilers.llvm.clang.1_0;
251+
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
252+
GCC_WARN_ABOUT_MISSING_PROTOTYPES = YES;
253+
GCC_WARN_ABOUT_RETURN_TYPE = YES;
254+
GCC_WARN_UNDECLARED_SELECTOR = YES;
255+
GCC_WARN_UNINITIALIZED_AUTOS = YES;
256+
GCC_WARN_UNUSED_FUNCTION = YES;
257+
GCC_WARN_UNUSED_VARIABLE = YES;
258+
MACOSX_DEPLOYMENT_TARGET = 10.7;
259+
SDKROOT = macosx;
260+
};
261+
name = Release;
262+
};
263+
EE33EA801370DF3100F77FCE /* Debug */ = {
264+
isa = XCBuildConfiguration;
265+
buildSettings = {
266+
ALWAYS_SEARCH_USER_PATHS = NO;
267+
COMBINE_HIDPI_IMAGES = YES;
268+
COPY_PHASE_STRIP = NO;
269+
GCC_DYNAMIC_NO_PIC = NO;
270+
GCC_ENABLE_OBJC_EXCEPTIONS = YES;
271+
GCC_PRECOMPILE_PREFIX_HEADER = NO;
272+
INFOPLIST_FILE = "AVReaderWriterOSX/AVReaderWriterOSX-Info.plist";
273+
PRODUCT_BUNDLE_IDENTIFIER = "com.example.apple-samplecode.${PRODUCT_NAME:rfc1034identifier}";
274+
PRODUCT_NAME = AVReaderWriter;
275+
WRAPPER_EXTENSION = app;
276+
};
277+
name = Debug;
278+
};
279+
EE33EA811370DF3100F77FCE /* Release */ = {
280+
isa = XCBuildConfiguration;
281+
buildSettings = {
282+
ALWAYS_SEARCH_USER_PATHS = NO;
283+
COMBINE_HIDPI_IMAGES = YES;
284+
COPY_PHASE_STRIP = YES;
285+
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
286+
GCC_ENABLE_OBJC_EXCEPTIONS = YES;
287+
GCC_PRECOMPILE_PREFIX_HEADER = NO;
288+
INFOPLIST_FILE = "AVReaderWriterOSX/AVReaderWriterOSX-Info.plist";
289+
PRODUCT_BUNDLE_IDENTIFIER = "com.example.apple-samplecode.${PRODUCT_NAME:rfc1034identifier}";
290+
PRODUCT_NAME = AVReaderWriter;
291+
WRAPPER_EXTENSION = app;
292+
};
293+
name = Release;
294+
};
295+
/* End XCBuildConfiguration section */
296+
297+
/* Begin XCConfigurationList section */
298+
EE33EA581370DF3100F77FCE /* Build configuration list for PBXProject "AVReaderWriter" */ = {
299+
isa = XCConfigurationList;
300+
buildConfigurations = (
301+
EE33EA7D1370DF3100F77FCE /* Debug */,
302+
EE33EA7E1370DF3100F77FCE /* Release */,
303+
);
304+
defaultConfigurationIsVisible = 0;
305+
defaultConfigurationName = Release;
306+
};
307+
EE33EA7F1370DF3100F77FCE /* Build configuration list for PBXNativeTarget "AVReaderWriterOSX" */ = {
308+
isa = XCConfigurationList;
309+
buildConfigurations = (
310+
EE33EA801370DF3100F77FCE /* Debug */,
311+
EE33EA811370DF3100F77FCE /* Release */,
312+
);
313+
defaultConfigurationIsVisible = 0;
314+
defaultConfigurationName = Release;
315+
};
316+
/* End XCConfigurationList section */
317+
};
318+
rootObject = EE33EA551370DF3100F77FCE /* Project object */;
319+
}

0 commit comments

Comments
 (0)