Newest 'ffmpeg' Questions - Stack Overflow

http://stackoverflow.com/questions/tagged/ffmpeg

Les articles publiés sur le site

  • Running list of cmd.exe commands from maya in Python

    17 décembre 2015, par user3541686

    I am writing a maya python script to batch render a scene into jpgs then use ffmpeg to turn them into a mov. Currently the script saves a string of commands as a bat file which works fine but I'd prefer to just run cmd.exe from maya and execute the list of commands without creating that bat first.

    I've been reading about "subprocess.popen()" but I can't figure out how to get it to iterate through each line, run that command, then move onto the next one when done ie:

    1) Run maya render.exe & save scene as jpegs

    2) ffmpeg jpgs to mov

    I've shortened the directories but its essentially this:

    `C:\PROGRA~1\Autodesk\Maya2015\bin\Render.exe -r hw2 -s 100 -e 200 -of jpg -fnc 7 -x 1920 -y 1080 -rd 
    "C:\RENDER" 
    "C:\SCENE.ma" ffmpeg -y -r 25 -start_number 0100 -i C:\SCENE_%%04d.jpg C:\SCENE.mov
    

    How would I be able to do this?

    Thanks!

  • ffmpeg muxing without using synthetic audio and video streams in c

    17 décembre 2015, par Ankush Saini

    how to generate video and audio frames without using synthetic audio and video streams in c ffmpeg muxing..... refrence link is http://ffmpeg.org/doxygen/trunk/doc_2examples_2muxing_8c-example.html

  • Getting exact time-stamp appended to the file from ffmpeg process

    17 décembre 2015, par csharpcoder

    I am trying to capture frames using ffmpeg from a stream of video , which i am saving locally to my folder, I need to know the exact time-stamp at which the frame is being captured what i have tried so far is :

    ffmpeg -i rtsp://ipaddress/axis-media/media.amp?camera=1  -an -vf showinfo %10d.jpg 2> res.txt
    

    which i got from the source : get-each-frame-time-stamp

    this works fine too, the res.txt contains the time-elapsed of each frame since ffmpeg started(if my understanding is not wrong) ,

    What i need is to get this time appended to the image files names which are being created or some other ways so that time-stamp information could be stored within the image.

    any kind of help would be really appreciated .

  • Unable to merge videos using FFMPEG Commands

    17 décembre 2015, par San

    I am trying to merge two videos in Android using FFMPEG and I have been following the Android War Zone blog which gives great ideas and simple methods to integrate FFMPEG in our project. However, I am facing issues in merging two videos.

    Command :

      vk.run(new String[]{
       "ffmpeg",
        "-f",
         "concat",
          "-i",
            list,
             "-s",
              "hd720",
                "-c",
                  "copy",
                    "-b",
                     br_from_db + "k",
                       path + "/" + "merged_video_3.mp4"
                        }, work_path, getActivity());
    

    And the "list" in the above command is the one where I am facing a issue.It throws me the following error when I use the following method :

    Code :

    private String generateList(String[] inputs) {
            File list;
            Writer writer = null;
            try {
                list = File.createTempFile("ffmpeg-list", ".txt");
                writer = new BufferedWriter(new OutputStreamWriter(new FileOutputStream(list)));
                for (String input : inputs) {
                    writer.write("file '" + input + "'\n");
                    Log.d(TAG, "Writing to list file: file '" + input + "'");
                }
            } catch (IOException e) {
                e.printStackTrace();
                return "/";
            } finally {
                try {
                    if (writer != null)
                        writer.close();
                } catch (IOException ex) {
                    ex.printStackTrace();
                }
            }
            Log.d(TAG, "Wrote list file to " + list.getAbsolutePath());
            return list.getAbsolutePath();
        }
    

    Error :

    12-16 19:49:57.416    5437-5437/? E/ffmpeg4android﹕ Command validation failed.
    12-16 19:49:57.416    5437-5437/? E/ffmpeg4android﹕ Check if input file exists: /data/data/com.family45.golive.family45v1/cache/ffmpeg-list-1803386407.txt/storage/emulated/0/DCIM/Camera/dec24.mp4 /storage/emulated/0/DCIM/Camera/vid2.mp4
    12-16 19:49:57.416    5437-5437/? W/System.err﹕ com.netcompss.ffmpeg4android.CommandValidationException
    12-16 19:49:57.416    5437-5437/? W/System.err﹕ at com.netcompss.loader.LoadJNI.run(LoadJNI.java:34)
    12-16 19:49:57.416    5437-5437/? W/System.err﹕ at com.netcompss.loader.LoadJNI.run(LoadJNI.java:49)
    

    I obtained the command from this stack question. Its accepted but I am facing the above issue. I am very sure that the videos are present in their respective locations and all the paths are right but I cant seem to make it work.

    Any insights on this is highly appreciated. Thanks in advance.

    Update :

    Call to generateList:

    ArrayList paths_to_merge = new ArrayList();
      paths_to_merge.add(path + "/" + "dec24.mp4");
      paths_to_merge.add(path + "/" + "vid2.mp4");
      LoadJNI vk = new LoadJNI();
      String[] v12 = new String[paths_to_merge.size()];
      v12 = paths_to_merge.toArray(v12);
      String list = generateList(v12);
    
  • ffmpg overlay command not working properly

    17 décembre 2015, par user3269550

    i am using ffmpegib.so version 1.2 for executing commands in android i am using standard command for overlaying gif on video my command is

    ffmpeg -y -i /sdcard/vid.mp4 -ignore_loop 0 -i /sdcard/gif2.gif -strict -2 -filter_complex '[0:v][1:v]overlay=10:10:shortest=1' -codec:a copy /sdcard/out.mp4
    

    this is standard command for overlaying gif on video but says ignore-loop option not found so i have tried another command

     ffmpeg -y -i /sdcard/vid.mp4 -i /sdcard/gif2.gif -strict -2 -filter_complex 'overlay=10:10' -codec:a copy /sdcard/out.mp4
    

    this command works but it loops gif only once i wand gif to loops untill video finishes please suggest me solution i hae only version of ffmpeg is 1.2 because i could not able to build its latest version after 5 days of hard work