| FFmpegKit iOS / macOS / tvOS API 4.5

FFprobeKit.m
Go to the documentation of this file.
1/*
2 * Copyright (c) 2020-2021 Taner Sener
3 *
4 * This file is part of FFmpegKit.
5 *
6 * FFmpegKit is free software: you can redistribute it and/or modify
7 * it under the terms of the GNU Lesser General Public License as published by
8 * the Free Software Foundation, either version 3 of the License, or
9 * (at your option) any later version.
10 *
11 * FFmpegKit is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU Lesser General Public License for more details.
15 *
16 * You should have received a copy of the GNU Lesser General Public License
17 * along with FFmpegKit. If not, see <http://www.gnu.org/licenses/>.
18 */
19
20#import "fftools_ffmpeg.h"
21#import "FFmpegKit.h"
22#import "FFmpegKitConfig.h"
23#import "FFprobeKit.h"
24
25@implementation FFprobeKit
26
27+ (void)initialize {
28 [FFmpegKitConfig class];
29}
30
31+ (FFprobeSession*)executeWithArguments:(NSArray*)arguments {
32 FFprobeSession* session = [[FFprobeSession alloc] init:arguments];
33 [FFmpegKitConfig ffprobeExecute:session];
34 return session;
35}
36
37+ (FFprobeSession*)executeWithArgumentsAsync:(NSArray*)arguments withExecuteCallback:(ExecuteCallback)executeCallback {
38 FFprobeSession* session = [[FFprobeSession alloc] init:arguments withExecuteCallback:executeCallback];
39 [FFmpegKitConfig asyncFFprobeExecute:session];
40 return session;
41}
42
43+ (FFprobeSession*)executeWithArgumentsAsync:(NSArray*)arguments withExecuteCallback:(ExecuteCallback)executeCallback withLogCallback:(LogCallback)logCallback {
44 FFprobeSession* session = [[FFprobeSession alloc] init:arguments withExecuteCallback:executeCallback withLogCallback:logCallback];
45 [FFmpegKitConfig asyncFFprobeExecute:session];
46 return session;
47}
48
49+ (FFprobeSession*)executeWithArgumentsAsync:(NSArray*)arguments withExecuteCallback:(ExecuteCallback)executeCallback onDispatchQueue:(dispatch_queue_t)queue {
50 FFprobeSession* session = [[FFprobeSession alloc] init:arguments withExecuteCallback:executeCallback];
51 [FFmpegKitConfig asyncFFprobeExecute:session onDispatchQueue:queue];
52 return session;
53}
54
55+ (FFprobeSession*)executeWithArgumentsAsync:(NSArray*)arguments withExecuteCallback:(ExecuteCallback)executeCallback withLogCallback:(LogCallback)logCallback onDispatchQueue:(dispatch_queue_t)queue {
56 FFprobeSession* session = [[FFprobeSession alloc] init:arguments withExecuteCallback:executeCallback withLogCallback:logCallback];
57 [FFmpegKitConfig asyncFFprobeExecute:session onDispatchQueue:queue];
58 return session;
59}
60
61+ (FFprobeSession*)execute:(NSString*)command {
62 FFprobeSession* session = [[FFprobeSession alloc] init:[FFmpegKitConfig parseArguments:command]];
63 [FFmpegKitConfig ffprobeExecute:session];
64 return session;
65}
66
67+ (FFprobeSession*)executeAsync:(NSString*)command withExecuteCallback:(ExecuteCallback)executeCallback {
68 FFprobeSession* session = [[FFprobeSession alloc] init:[FFmpegKitConfig parseArguments:command] withExecuteCallback:executeCallback];
69 [FFmpegKitConfig asyncFFprobeExecute:session];
70 return session;
71}
72
73+ (FFprobeSession*)executeAsync:(NSString*)command withExecuteCallback:(ExecuteCallback)executeCallback withLogCallback:(LogCallback)logCallback {
74 FFprobeSession* session = [[FFprobeSession alloc] init:[FFmpegKitConfig parseArguments:command] withExecuteCallback:executeCallback withLogCallback:logCallback];
75 [FFmpegKitConfig asyncFFprobeExecute:session];
76 return session;
77}
78
79+ (FFprobeSession*)executeAsync:(NSString*)command withExecuteCallback:(ExecuteCallback)executeCallback onDispatchQueue:(dispatch_queue_t)queue {
80 FFprobeSession* session = [[FFprobeSession alloc] init:[FFmpegKitConfig parseArguments:command] withExecuteCallback:executeCallback];
81 [FFmpegKitConfig asyncFFprobeExecute:session onDispatchQueue:queue];
82 return session;
83}
84
85+ (FFprobeSession*)executeAsync:(NSString*)command withExecuteCallback:(ExecuteCallback)executeCallback withLogCallback:(LogCallback)logCallback onDispatchQueue:(dispatch_queue_t)queue {
86 FFprobeSession* session = [[FFprobeSession alloc] init:[FFmpegKitConfig parseArguments:command] withExecuteCallback:executeCallback withLogCallback:logCallback];
87 [FFmpegKitConfig asyncFFprobeExecute:session onDispatchQueue:queue];
88 return session;
89}
90
91+ (MediaInformationSession*)getMediaInformation:(NSString*)path {
92 NSArray* arguments = [[NSArray alloc] initWithObjects:@"-v", @"error", @"-hide_banner", @"-print_format", @"json", @"-show_format", @"-show_streams", @"-i", path, nil];
93 MediaInformationSession* session = [[MediaInformationSession alloc] init:arguments];
94 [FFmpegKitConfig getMediaInformationExecute:session withTimeout:AbstractSessionDefaultTimeoutForAsynchronousMessagesInTransmit];
95 return session;
96}
97
98+ (MediaInformationSession*)getMediaInformation:(NSString*)path withTimeout:(int)waitTimeout {
99 NSArray* arguments = [[NSArray alloc] initWithObjects:@"-v", @"error", @"-hide_banner", @"-print_format", @"json", @"-show_format", @"-show_streams", @"-i", path, nil];
100 MediaInformationSession* session = [[MediaInformationSession alloc] init:arguments];
101 [FFmpegKitConfig getMediaInformationExecute:session withTimeout:waitTimeout];
102 return session;
103}
104
105+ (MediaInformationSession*)getMediaInformationAsync:(NSString*)path withExecuteCallback:(ExecuteCallback)executeCallback {
106 NSArray* arguments = [[NSArray alloc] initWithObjects:@"-v", @"error", @"-hide_banner", @"-print_format", @"json", @"-show_format", @"-show_streams", @"-i", path, nil];
107 MediaInformationSession* session = [[MediaInformationSession alloc] init:arguments withExecuteCallback:executeCallback];
108 [FFmpegKitConfig asyncGetMediaInformationExecute:session withTimeout:AbstractSessionDefaultTimeoutForAsynchronousMessagesInTransmit];
109 return session;
110}
111
112+ (MediaInformationSession*)getMediaInformationAsync:(NSString*)path withExecuteCallback:(ExecuteCallback)executeCallback withLogCallback:(LogCallback)logCallback withTimeout:(int)waitTimeout {
113 NSArray* arguments = [[NSArray alloc] initWithObjects:@"-v", @"error", @"-hide_banner", @"-print_format", @"json", @"-show_format", @"-show_streams", @"-i", path, nil];
114 MediaInformationSession* session = [[MediaInformationSession alloc] init:arguments withExecuteCallback:executeCallback withLogCallback:logCallback];
115 [FFmpegKitConfig asyncGetMediaInformationExecute:session withTimeout:waitTimeout];
116 return session;
117}
118
119+ (MediaInformationSession*)getMediaInformationAsync:(NSString*)path withExecuteCallback:(ExecuteCallback)executeCallback onDispatchQueue:(dispatch_queue_t)queue {
120 NSArray* arguments = [[NSArray alloc] initWithObjects:@"-v", @"error", @"-hide_banner", @"-print_format", @"json", @"-show_format", @"-show_streams", @"-i", path, nil];
121 MediaInformationSession* session = [[MediaInformationSession alloc] init:arguments withExecuteCallback:executeCallback];
122 [FFmpegKitConfig asyncGetMediaInformationExecute:session onDispatchQueue:queue withTimeout:AbstractSessionDefaultTimeoutForAsynchronousMessagesInTransmit];
123 return session;
124}
125
126+ (MediaInformationSession*)getMediaInformationAsync:(NSString*)path withExecuteCallback:(ExecuteCallback)executeCallback withLogCallback:(LogCallback)logCallback onDispatchQueue:(dispatch_queue_t)queue withTimeout:(int)waitTimeout {
127 NSArray* arguments = [[NSArray alloc] initWithObjects:@"-v", @"error", @"-hide_banner", @"-print_format", @"json", @"-show_format", @"-show_streams", @"-i", path, nil];
128 MediaInformationSession* session = [[MediaInformationSession alloc] init:arguments withExecuteCallback:executeCallback];
129 [FFmpegKitConfig asyncGetMediaInformationExecute:session onDispatchQueue:queue withTimeout:waitTimeout];
130 return session;
131}
132
133+ (MediaInformationSession*)getMediaInformationFromCommand:(NSString*)command {
134 MediaInformationSession* session = [[MediaInformationSession alloc] init:[FFmpegKitConfig parseArguments:command]];
135 [FFmpegKitConfig getMediaInformationExecute:session withTimeout:AbstractSessionDefaultTimeoutForAsynchronousMessagesInTransmit];
136 return session;
137}
138
139+ (MediaInformationSession*)getMediaInformationFromCommandAsync:(NSArray*)arguments withExecuteCallback:(ExecuteCallback)executeCallback withLogCallback:(LogCallback)logCallback onDispatchQueue:(dispatch_queue_t)queue withTimeout:(int)waitTimeout {
140 MediaInformationSession* session = [[MediaInformationSession alloc] init:arguments withExecuteCallback:executeCallback withLogCallback:logCallback];
141 [FFmpegKitConfig asyncGetMediaInformationExecute:session onDispatchQueue:queue withTimeout:waitTimeout];
142 return session;
143}
144
145+ (NSArray*)listSessions {
146 return [FFmpegKitConfig getFFprobeSessions];
147}
148
149@end
ExecuteCallback
void(^ ExecuteCallback)(id< Session > session)
Definition: ExecuteCallback.h:46
FFmpegKit.h
FFmpegKitConfig.h
FFprobeKit.h
LogCallback
void(^ LogCallback)(Log *log)
Definition: LogCallback.h:31
fftools_ffmpeg.h
FFmpegKitConfig
Definition: FFmpegKitConfig.h:50
+[FFmpegKitConfig asyncGetMediaInformationExecute:withTimeout:]
void asyncGetMediaInformationExecute:withTimeout:(MediaInformationSession *mediaInformationSession,[withTimeout] int waitTimeout)
Definition: FFmpegKitConfig.m:952
+[FFmpegKitConfig getMediaInformationExecute:withTimeout:]
void getMediaInformationExecute:withTimeout:(MediaInformationSession *mediaInformationSession,[withTimeout] int waitTimeout)
Definition: FFmpegKitConfig.m:897
+[FFmpegKitConfig ffprobeExecute:]
void ffprobeExecute:(FFprobeSession *ffprobeSession)
Definition: FFmpegKitConfig.m:885
+[FFmpegKitConfig asyncFFprobeExecute:]
void asyncFFprobeExecute:(FFprobeSession *ffprobeSession)
Definition: FFmpegKitConfig.m:933
+[FFmpegKitConfig getFFprobeSessions]
NSArray * getFFprobeSessions()
Definition: FFmpegKitConfig.m:1100
+[FFmpegKitConfig asyncFFprobeExecute:onDispatchQueue:]
void asyncFFprobeExecute:onDispatchQueue:(FFprobeSession *ffprobeSession,[onDispatchQueue] dispatch_queue_t queue)
Definition: FFmpegKitConfig.m:937
+[FFmpegKitConfig asyncGetMediaInformationExecute:onDispatchQueue:withTimeout:]
void asyncGetMediaInformationExecute:onDispatchQueue:withTimeout:(MediaInformationSession *mediaInformationSession,[onDispatchQueue] dispatch_queue_t queue,[withTimeout] int waitTimeout)
Definition: FFmpegKitConfig.m:956
+[FFmpegKitConfig parseArguments:]
NSArray * parseArguments:(NSString *command)
Definition: FFmpegKitConfig.m:1156
FFprobeKit
Definition: FFprobeKit.h:47
+[FFprobeKit initialize]
void initialize()
Definition: FFprobeKit.m:27
+[FFprobeKit listSessions]
NSArray * listSessions()
Definition: FFprobeKit.m:145
FFprobeSession
Definition: FFprobeSession.h:30
MediaInformationSession
Definition: MediaInformationSession.h:32