Newest 'ffmpeg' Questions - Stack Overflow
Les articles publiés sur le site
-
Search for movie atoms with ffmpeg
6 octobre 2013, par user620297How to retrieve movie atoms from file with ffmpeg? For example I need
avcC
atom bytes. I would rather not code parser myself if there is some solution.http://www.ffmpeg.org/doxygen/0.6/mov_8c-source.html seems to provide some API, but I'm not familiar with ffmpeg.
Or is there direct API to obtain SPS and PPS NALs?
-
Execute program from another directory using Runtime.exec()
6 octobre 2013, par user2317720I want to execute a program (
System.getenv("appdata") + "ffmpeg"
). I also want to be able get a process or something that could get me the consle output. I have tried "cmd /C " +System.getenv("appdata") + "ffmpeg"
before and it didn't seem to work. Any help is appreciated!Here is some code:
Process p = exec(testFFMpeg); int ex = -1; try { ex = p.waitFor(); } catch (InterruptedException e) { e.printStackTrace(); CrashHandler.reportCrash("FFMpeg", "Unable to test FFMpeg", "start up with more permissions"); } if(ex == 0){ System.out.println("Normal execution, exit value: " + ex); BufferedReader br = new BufferedReader(new InputStreamReader(p.getInputStream())); String line = null; do{ try { line = br.readLine(); System.out.println(line); } catch (IOException e) { e.printStackTrace(); CrashHandler.reportCrash("FFMpeg", "Unable to test FFMpeg", "start up with more permissions"); } }while(line != null); }else{ System.out.println("Execution exit value: " + ex); } } private static Process exec(String[] cmd){ try { return Runtime.getRuntime().exec(cmd); } catch (IOException e) { e.printStackTrace(); CrashHandler.reportCrash("FFMpeg", "Unable to test FFMpeg", "start up with more permissions"); }
The exact location of the file is: `System.getenv("appdata") + "\VinVid\" + "ffmpeg.exe".
-
Xcode with ffmpeg support
5 octobre 2013, par user2741735I wanted to know the procedure for compiling the xcode project with ffmpeg with special ./configure options and the gas-processor. I'm using direct input from IP Camera and storing it on my hard drive. However I'm doing this on terminal with ffmpeg. I want to do the same operations using code on xcode. Need help for that.
I have heard that Apple doesn't support ffmpeg for ios apps on AppStore. Is it true?
-
trying to figure out what's wrong in the code using ffmpeg.exe
5 octobre 2013, par timmackI'm trying to upload videos and convert it to flv format as well as capturing image as thumbnails.I'm using visual web developer 2008 express edition.I've done so many research online and found something using ffmpeg.exe so I've downloaded an ffmpeg.exe and has tried so many codes but unfortunately I'm still unable to make it work.I want to save the converted video file to a certain folder in my server as well as the captured image as for its thumbnails after uploading the video.I'm not sure if the ffmpeg.exe has the problem or my codes but I suspect it's in my codes.I need somebody to help me find out what's something missing on my codes to make it work. Here's my codes below for your reference. Thanks
protected void Button1_Click(object sender, EventArgs e) { //Convert the Video to flv format with FFMPEG string ffmpegPath = Server.MapPath("~/ffmpeg/ffmpeg.exe"); string tempLocation = Server.MapPath("~/tempVideos/"); string mediaOutPath = Server.MapPath("~/Videos/"); string thumbOutPath = Server.MapPath("~/Thumbs/"); string currentFile = System.IO.Path.GetFileName(FileUpload1.PostedFile.FileName); //Upload the video string vidPath = "Videos/" + outputfile; if (FileUpload1.PostedFile != null && FileUpload1.PostedFile.FileName != "") { try { // 10240 KB means 10MB, You can change the value based on your requirement if (FileUpload1.PostedFile.ContentLength > 1024000000) { Page.ClientScript.RegisterClientScriptBlock(typeof(Page), "Alert", "alert('File is too big.')", true); } else { //then save it to the Folder Convert(tempLocation + currentFile, mediaOutPath + currentFile, thumbOutPath + currentFile); FileUpload1.PostedFile.SaveAs(tempLocation + currentFile); } } catch (Exception ex) { Response.Write("Error: " + ex.Message); } } Page.ClientScript.RegisterClientScriptBlock(typeof(Page), "Alert", "alert('Video file has been uploaded!')", true); FlashVideo1.VideoURL = "tempVideos/" + currentFile; } protected void Convert(string fileIn, string fileOut, string thumbOut) { try { string mediaOutPath = Server.MapPath("~/Videos/"); string thumbOutPath = Server.MapPath("~/Thumbs/"); string inputfile = FileUpload1.PostedFile.FileName; string infile = Path.GetFileNameWithoutExtension(inputfile); fileIn = Path.GetFullPath( inputfile); fileOut = mediaOutPath + inputfile; thumbOut = inputfile; string ffmpegPath = Server.MapPath("~/ffmpeg/ffmpeg.exe"); System.Diagnostics.Process proc = new System.Diagnostics.Process(); proc.EnableRaisingEvents = true; proc.StartInfo.FileName = ffmpegPath; //converting video to flv format proc.StartInfo.Arguments = "-i " + fileIn + "-ar 22050 -ab 32 -f flv -s 320×240 -aspect 4:3 -y" + fileOut.Split('.')[0] + ".flv"; proc.StartInfo.UseShellExecute = false; proc.StartInfo.CreateNoWindow = false; proc.StartInfo.RedirectStandardError = true; proc.StartInfo.RedirectStandardOutput = true; proc.Start(); proc.WaitForExit(); //capturing thumbnail image of the video proc.StartInfo.Arguments = "-i \"{0}\" -an -y -s 320x240 -ss {1} -vframes 1 -f image2 \"{2}\"" + fileIn + thumbOut.Split('.')[0] + ".jpg"; proc.StartInfo.UseShellExecute = false; proc.StartInfo.CreateNoWindow = false; proc.StartInfo.RedirectStandardError = true; proc.StartInfo.RedirectStandardOutput = true; proc.Start(); proc.WaitForExit(); proc.Close(); } catch (Exception ex) { Response.Write("Error: " + ex.Message); } }
-
FFmpeg on Android - Unable to find a suitable output format
5 octobre 2013, par Gonzalo SoleraI want to reduce the resolution of a video before edit it, so I´m using ffmpeg on android. I´m using the executable/binary file of ffmpeg and I´m calling my ffmpeg commands like that:
./ffmpeg -i /sdcard/dcim/video.mp4 -s 320x240 -r 10 -y /sdcard/output.mp4
But when I try this command I get this error:
Unable to find a suitable output format for /sdcard/output.mp4
This is the output when I use the adb shell:
The only action I have been able to do is to extract the audio of a video and save it as a mp3 using this command:
./ffmpeg -i /sdcard/dcim/video.mp4 -y /sdcard/output.mp3
That works well but this is the only action I can do... Any idea of why I can´t convert a video? (I can´t copy it too) Thanks!!