Results 1 to 5 of 5

Thread: ffmpeg time position rounding

  1. #1
    Join Date
    May 2010
    Beans
    3
    Distro
    Ubuntu 10.04 Lucid Lynx

    ffmpeg time position rounding

    I've written a bash script that extracts the audio out of a movie file and saves it out in separate .wav files using ffmpeg. Here is the key ffmpeg command:

    Code:
    ffmpeg -i $movie_file -vn -ss $start_time -t $duration ${file_name}_${counter}.wav
    $start_time and $duration are floating point numbers that contain time information in the form of seconds and milliseconds (ss.xxx). It is important that I am able to control the time down to the millisecond.

    My script works exactly as hoped on .avi files.

    My script needs to work on an existing archive of .mov files. My problem is, when I try to use it on a .mov, the audio files created always have start times and durations that have been rounded up to the nearest half-second. This breaks up the audio in the wrong spots, and creates files that last too long and have too much extra audio.

    What can I do to make my ffmpeg command create .wav files from .mov files that properly recognize a specific number of milliseconds? Or, asked another way, how can I eliminate the rounding behavior?

    Thanks!

  2. #2
    Join Date
    May 2010
    Beans
    3
    Distro
    Ubuntu 10.04 Lucid Lynx

    Re: ffmpeg time position rounding

    Any ideas? Would it be helpful if I supplied more information? Is there a better place for me to direct this question?

  3. #3
    Join Date
    Sep 2006
    Beans
    3,713

    Re: ffmpeg time position rounding

    Have you tried placing -ss (and possibly -t) before your input? I'm not sure if it will help, but it is worth a try. Stop by the #ffmpeg IRC channel and ask there too.

  4. #4
    Join Date
    May 2010
    Beans
    3
    Distro
    Ubuntu 10.04 Lucid Lynx

    Re: ffmpeg time position rounding

    I hadn't considered changing the order of the input parameters. I've given it a shot and (alas) it doesn't change the rounding in the creation of the output file. Thanks for the input, though!

  5. #5
    Join Date
    May 2007
    Beans
    601

    Re: ffmpeg time position rounding

    I haven't tried this but I would try the -vframes option. Compute the number of frames needed based on the framerate.

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •