VideoHelp.com Forum
+ Reply to Thread
Results 1 to 3 of 3
Thread
  1. Member
    Join Date: Jan 2009
    Location: United States
    I've explained in another thread some of the tinkering I'm doing creating my own video effects, etc. I'm running into a problem ensuring that the audio doesn't get stepped on when the streams are cut and then recombined. I can cut and combine video streams flawlessly with ffmpeg and not loose or gain a frame. However, audio isn't so precise. This could create a problem when the end results are combined back together because from my own testing even a hundredth of a second of silence is noticeable. With sox I can cut and recombine audio down to the milisecond, and this to my ears at least is flawless. Unfortunately once I've cut a video stream all ffmpeg, mencoder, or transcode will tell me is the length of the stream down to the hundredth of a second. Is anyone aware of a common linux command line tool which I could use to tell how long a segment of video is down to the thousandth of a second?

    Barring this, I've thought of two possible workarounds:

    1) Determine the precise time using the frame rate of the stream. I might have to do this but I'd have to write a function to get the framrate and then do the conversions. Since bash doesn't handle floating point I find this kind of thing to be a pain.

    2) Get within 3 miliseconds by comparing the answers from ffmpeg and mencoder. From what I can tell, ffmpeg always rounds the time down, while mencoder will round up to the next hundreth when milisec is 5 or more. If both give the same answer, I could then assume the true time is the answer returned plus 2 milliseconds. If they return different answers, I could assume the true value is the ffmpeg answer plus 7 milliseconds. The problem here is if either changes the way they report the time of a file I'd be in trouble.

    I think I need to bite the bullet and do workaround 1. But I thought I'd run this past the forum in case there is something I'm not considering. Any suggestions would be greatly appreciated!
    Quote Quote  

  2. Member MJ Peg's Avatar
    Join Date: Dec 2008
    Location: United Kingdom
    Number_of_frames * frame_time

    use bc for floating point in bash
    http://linux.byexamples.com/archives...calculator-bc/
    Quote Quote  

  3. Member
    Join Date: Jan 2009
    Location: United States
    Thanks MJ Peg! I wasn't aware of BC. I just checked and it is already installed on my system.
    Quote Quote  




Similar Threads

  1. v2mp command line not changing output file location
    By Wakewatcher in forum SVCD2DVD & VOB2MPG
    Replies: 8
    Last Post: 18th Jan 2011, 13:20
  2. Replies: 1
    Last Post: 4th Nov 2010, 21:30
  3. Replies: 2
    Last Post: 1st Jan 2010, 02:19
  4. Command line tool to demultiplex video
    By lovyagin in forum Editing
    Replies: 6
    Last Post: 20th Dec 2009, 12:43
  5. Join MOV Video from command line
    By parisisal in forum Editing
    Replies: 4
    Last Post: 19th Feb 2009, 10:59
Search   Contact us   About   Advertise   Forum   RSS Feeds   Statistics   Tools