Post

Replies

Boosts

Views

Activity

Running ffmpeg from a sandbox
I'm trying to run ffmpeg from a sandboxed macOS app. ffmpeg itself is installed through homebrew in: /usr/local/bin/ffmpeg which is actually a symlink to: /usr/local/Cellar/ffmpeg/4.3_1/bin/ffmpeg I'm using NSOpenPanel to let the user locate the binary and if I open the symlink I can read the contents of the binary, but I can't execute it. Same if I open the destination file. Here is some sample code: let panel = NSOpenPanel() panel.begin { response in 		guard response == .OK, let url = panel.url else { 				return 		} 		print("> \(url.path)") 		do { 				let data = try Data(contentsOf: url) 				print("> \(data.count) bytes") 				let p = Process() 				p.executableURL = url 				try p.run() 		} catch { 				print("ERROR: \(error.localizedDescription)") 		} } This generates the following output: > /usr/local/Cellar/ffmpeg/4.3_1/bin/ffmpeg > 297536 bytes ERROR: The file “ffmpeg” doesn’t exist.
12
0
3.7k
Mar ’22