VideoHelp Forum

Our website is made possible by displaying online advertisements to our visitors. Consider supporting us by disable your adblocker or try DVDFab and copy, convert Blu-ray and DVDs! :)
+ Reply to Thread
Results 1 to 5 of 5
Thread
  1. Member Budman1's Avatar
    Join Date
    Jul 2012
    Location
    NORTHWEST ILLINOIS, USA
    Search Comp PM
    I am working on a project for cutting and joining videos with the least amount of re-encoding and have searched and read everything I can find. What I need clarified on is, I understand video encoders encode on a frame by frame basis and each frame will have a certain duration. E.G. a CFR video of 29.97 FPS would have frames lasting approximately 0.033367 seconds. I also understand that an audio encoder encodes on a similar 'frame' basis based on the sample rate. E.G. a video with audio AAC at 44100 sample rate would have chunks lasting approximately 0.000002267 seconds.

    What I don't understand is how you can encode only the 200 frames of a video prior to the next I-Frame and have it join perfectly with the rest of the video from the I-Frame on. It would seem 200 frames of video would be 6.673400 seconds long (0.033367 X 200) and the audio would have to be 2943714 frames X 0.000002267 for 6.673398 to be the closest. Depending on how many frames must be recoded, the error could be as much as 8 ms i actual trials. Wouldn't this make the joining less than perfect. Although negligible for a single cut, I would think the sync would be multiplied by the number of cuts/joins.

    I have verified most of the above using FFMPEG, FFPROBE and MediaInfo as best I could and by running numerous tests and examining the result with these programs also, If there is a way to make this better, I would greatly appreciate new knowledge or suggestions on how to do this better.
    Thank you
    Quote Quote  
  2. Originally Posted by Budman1 View Post
    audio AAC at 44100 sample rate would have chunks lasting approximately 0.000002267 seconds.
    LC-AAC audio has 1024 (typically) or 960 (seldomly) samples per chunk. So 48kHz LC-AAC audio would have 21.333... ms chunks.
    Quote Quote  
  3. Member Budman1's Avatar
    Join Date
    Jul 2012
    Location
    NORTHWEST ILLINOIS, USA
    Search Comp PM
    I understand now the audio then but how then can you copy 33.667 ms video per frame on a frame basis and 21.333 me audio per chunk and get them to be equal length. Every ffmpeg script i try that uses copy for audio and video end up with unequal length. Is there a form of ffmpeg copy that actually creates equal length audio and video?
    Quote Quote  
  4. Originally Posted by Budman1 View Post
    I understand now the audio then but how then can you copy 33.667 ms video per frame on a frame basis and 21.333 me audio per chunk and get them to be equal length
    You don't. Basically, you have to give up on being 100% exact. Not possible. It just has to be good enough. And if you do lots of cuts/splices you have to be careful as to not have the errors add up too much.
    Quote Quote  
  5. Member Budman1's Avatar
    Join Date
    Jul 2012
    Location
    NORTHWEST ILLINOIS, USA
    Search Comp PM
    @sneaker... Ok thank you. That was the results of all my testing and I just needed to know if that were the case or i was missing something. I will take this information and keep in in mind in the future. Thank you for your help.
    Quote Quote  



Similar Threads