Newest 'ffmpeg' Questions - Stack Overflow

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

Les articles publiés sur le site

  • How to remove a section from an audio and keep the rest with ffmpeg

    2 mai 2017, par user2128078

    I'm trying to remove a section from an audio. For example I want to remove from 30s to 45s and have the rest with me. What I'm doing is the following:

    ffmpeg -i input.mp3 -filter_complex "[0]atrim=duration=30[a];[0]atrim=start=45[b];[a][b]concat" output.mp3
    

    But unfortunately this doesn't seem to work.

    What I obtain is the following error:

    [Parsed_atrim_0 @ 00000000000c8700] Media type mismatch between the 'Parsed_atrim_0' filter output pad 0 (audio) and the 'Parsed_concat_2' filter input pad 0 (video)
    [AVFilterGraph @ 0000000002435260] Cannot create the link atrim:0 -> concat:0
    Error initializing complex filters.
    Invalid argument
    
  • Why am I getting a 'withSize' of undefined error ?

    1er mai 2017, par Nick Garver

    I am trying to simply covert an avi video to flv using the example in the fluent-ffmpeg documentation. I am doing this for my node.js app but for some reason no matter how I specify my video path I seem to keep getting "undefined" when I do thing like .setStartTime or .setDuration. I am aware of this post but I still seem to be getting this error. Could anyone help me just set up the basic starter code? Thank you

    var ffmpeg = require('fluent-ffmpeg');
    
    
    // path to my video file
    var infs = fs.createReadStream('uwf.mp4');
    infs.on('error', function(err) {
      console.log("u messed up");
    });
    
    var proc = new ffmpeg({ source: infs, nolog: true })
      .setFfmpegPath("ffmpeg") //Set the path to where FFmpeg is installed 
      .setStartTime(25)
      .setDuration(2)
      .saveToFile('test.mp4');
    

    my console

    my file tree

  • Replace blank spaces to run command

    1er mai 2017, par ChrisBlp

    I'm using Runtime.getRuntime.exec(String) to cut some songs with ffmpeg. But when my song has a name with a blankspace it doesn't work ...

    So before I cut the song, I want to replace every blank space of my songs by "\ ".

    I did that :

    String in = directory+songs.get(i);
    String out = directory+"trimed_"+songs.get(i);
    in.replaceAll(" "," \\ ");
    out.replaceAll(" ", "\\ ");
    String str = "ffmpeg -t 1 -i "+in+" -vcodec copy "+out;
    Runtime.getRuntime().exec(str);
    

    But it doesn't replace anything at all when I print str, am I missing something ?

  • ffmpeg set timecode offset in output

    1er mai 2017, par Harry Developer

    I'm trying to create a .ts-file with a timecode starting at a specific offset. Lets say an input file input.ts exists. Running ffprobe on it says "start: 8636.xxx". Now, I like to create a copy with an additional start time offset, using:

    ffmpeg -i input.ts -someoption output.ts

    The options known to me for manipulating the time, like -copyts -ss -timecode

    won't work. Is there an option which allows me to add an extra time offset to the video stream?

    Edit:

    Here is the ffprobe output of the original ts file:

    Duration: 00:06:03.52, start: 6204.163600, bitrate: 3880 kb/s Program 12103 Metadata: service_name : ?ProSieben service_provider: ?Unitymedia Stream #0:0[0x21f]: Video: mpeg2video (Main) ([2][0][0][0] / 0x0002), yuv420p(tv, top first), 720x576 [SAR 64:45 DAR 16:9], 25 fps, 25 tbr, 90k tbn, 50 tbc Stream #0:1[0x220](ger): Audio: mp2 ([4][0][0][0] / 0x0004), 48000 Hz, stereo, s16p, 192 kb/s Stream #0:2[0x222](ger): Audio: ac3 ([129][0][0][0] / 0x0081), 48000 Hz, stereo, fltp, 384 kb/s No Program Stream #0:3[0x224]: Subtitle: dvb_teletext Unsupported codec with id 94215 for input stream 3

    And here is the ffprobe output of the newly created file after running ffmpeg -i input.ts -copyts -output_ts_offset 2428.6 output.ts:

    Duration: 00:06:03.36, start: 8634.319544, bitrate: 4372 kb/s Program 1 Metadata: service_name : Service01 service_provider: FFmpeg Stream #0:0[0x100]: Video: mpeg2video (Main) ([2][0][0][0] / 0x0002), yuv420p(tv, progressive), 720x576 [SAR 64:45 DAR 16:9], 25 fps, 25 tbr, 90k tbn, 50 tbc Stream #0:1[0x101](ger): Audio: mp2 ([3][0][0][0] / 0x0003), 48000 Hz, stereo, s16p, 384 kb/s

    I'm don't know much about the stream format itself. However, I can see, that the newly created output file contains a lesser number of streams and that some details have changed, like "tv, progessiv" instead of "tv, top first".

    I'd like to have an exact copy of the original, except having other time stamps. Is that possible?

  • Issue on install ffmpeg on Debian 8

    1er mai 2017, par pirmax

    I try to install "ffmpeg" on my Debian 8 and I have issues.

    apt-get install ffmpeg
    

    I have this errors...

    Reading package lists... Done
    Building dependency tree
    Reading state information... Done
    Some packages could not be installed. This may mean that you have
    requested an impossible situation or if you are using the unstable
    distribution that some required packages have not yet been created
    or been moved out of Incoming.
    The following information may help to resolve the situation:
    
    The following packages have unmet dependencies:
     ffmpeg : Depends: libavcodec57 (>= 10:3.2.2) but it is not going to be installed
              Depends: libavdevice57 (>= 10:3.2.2) but it is not going to be installed
              Depends: libavfilter6 (>= 10:3.2.2) but it is not going to be installed
              Depends: libavformat57 (>= 10:3.2.2) but it is not going to be installed
              Depends: libsdl2-2.0-0 (>= 2.0.4) but it is not going to be installed
              Depends: libva1 (>= 1.7.3) but 1.4.1-1 is to be installed
     x264 : Depends: libffms2-4 (>= 1:2.23) but it is not going to be installed
    E: Unable to correct problems, you have held broken packages.