MonoGame / MonoGame.Dependencies

The MonoGame binary dependencies submodule.
38 stars 51 forks source link

ffmpeg and ffprobe binaries for MacOS are -x and should be +x #62

Closed wjlandryiii closed 8 years ago

wjlandryiii commented 9 years ago

When trying to use ffmpeg to convert sound files using the pipeline.app tool, I get this error:

/Users/wjl/Projects/project/project.osx/Content/sound.mp3: error: Processor 'SongProcessor' had unexpected failure!
System.ComponentModel.Win32Exception: ApplicationName='/Applications/Pipeline.app/Contents/MonoBundle/ffmpeg', CommandLine='-y -i "/var/folders/90/k6vhg1vd4xs5724zbpb5cc900000gn/T/tmp7cb07978.tmp" -vn -c:a aac -b:a 192000 -f:a ipod -strict experimental "/var/folders/90/k6vhg1vd4xs5724zbpb5cc900000gn/T/tmp26e23d0.tmp"', CurrentDirectory='', Native error= Access denied
  at System.Diagnostics.Process.Start_noshell (System.Diagnostics.ProcessStartInfo startInfo, System.Diagnostics.Process process) [0x00000] in <filename unknown>:0 
  at System.Diagnostics.Process.Start_common (System.Diagnostics.ProcessStartInfo startInfo, System.Diagnostics.Process process) [0x00000] in <filename unknown>:0 
  at System.Diagnostics.Process.Start () [0x00000] in <filename unknown>:0 
  at (wrapper remoting-invoke-with-check) System.Diagnostics.Process:Start ()
  at Microsoft.Xna.Framework.Content.Pipeline.ExternalTool.Run (System.String command, System.String arguments, System.String& stdout, System.String& stderr, System.String stdin) [0x00000] in <filename unknown>:0 
  at Microsoft.Xna.Framework.Content.Pipeline.Audio.AudioContent.ConvertFormat (ConversionFormat formatType, ConversionQuality quality, System.String saveToFile) [0x00000] in <filename unknown>:0 
  at Microsoft.Xna.Framework.Content.Pipeline.Processors.SongProcessor.Process (Microsoft.Xna.Framework.Content.Pipeline.Audio.AudioContent input, Microsoft.Xna.Framework.Content.Pipeline.ContentProcessorContext context) [0x00000] in <filename unknown>:0 
  at Microsoft.Xna.Framework.Content.Pipeline.ContentProcessor`2[Microsoft.Xna.Framework.Content.Pipeline.Audio.AudioContent,Microsoft.Xna.Framework.Content.Pipeline.Processors.SongContent].Microsoft.Xna.Framework.Content.Pipeline.IContentProcessor.Process (System.Object input, Microsoft.Xna.Framework.Content.Pipeline.ContentProcessorContext context) [0x00000] in <filename unknown>:0 
  at MonoGame.Framework.Content.Pipeline.Builder.PipelineManager.ProcessContent (MonoGame.Framework.Content.Pipeline.Builder.PipelineBuildEvent pipelineEvent) [0x00000] in <filename unknown>:0 
Build 9 succeeded, 1 failed.

To fix this problem, I did this:

$ sudo chmod 755 /Applications/Pipeline.app/Contents/MonoBundle/ffmpeg
$ sudo chmod 755 /Applications/Pipeline.app/Contents/MonoBundle/ffprobe

I don't know if this should be fixed in this repo, or in the build process for the pipeline tool.

tomspilman commented 9 years ago

@cra0zy - Didn't we do something like this for the Linux installer?

@dellis1972 - Should we do the same for the Mac installer?

dellis1972 commented 9 years ago

Hmm.. this should have changed the permisisons

https://github.com/mono/MonoGame/blob/0b25f56e861fb602db884c40267b99ea947bae15/MonoGame.Framework.Content.Pipeline/ExternalTool.cs#L159

I can look at the mac post install script

dellis1972 commented 9 years ago

@tomspilman PR is up https://github.com/mono/MonoGame/pull/4201

harry-cpp commented 9 years ago

Didn't we do something like this for the Linux installer?

No.

On Linux we have: https://github.com/mono/MonoGame/blob/develop/Installers/Linux/Data/RUN/postinstall.sh#L91 to give the user permission to edit the folder where the monogame pipeline tool is installed(needed because the compilation will use that folder to create the temp files before writing them to the final destination) and then we have: https://github.com/mono/MonoGame/blob/develop/MonoGame.Framework.Content.Pipeline/ExternalTool.cs#L159 which will give the actual permissions to ffmpeg.

Hmm.. this should have changed the permisisons

https://github.com/mono/MonoGame/blob/0b25f56e861fb602db884c40267b99ea947bae15/MonoGame.Framework.Content.Pipeline/ExternalTool.cs#L159

Does the user running the pipeline tool have permission to change stuff in the folder the tool was installed in?

dellis1972 commented 9 years ago

On Mac its not good practice to give users write access to the /Applications/xxx folder.. so in the PR I'm updating the permissions manually in the post install script.

harry-cpp commented 8 years ago

I FINALLY UNDERSTAND IT: #66

Took me only 2 months...

tomspilman commented 8 years ago

@cra0zy - So is this fixed now?

harry-cpp commented 8 years ago

Yes.