Code Monkey home page Code Monkey logo

Comments (7)

GoogleCodeExporter avatar GoogleCodeExporter commented on June 3, 2024
Attaching screen capture of the differences shown in "Atom Inspector"

Original comment by [email protected] on 13 Jun 2011 at 4:24

Attachments:

from ffmbc.

GoogleCodeExporter avatar GoogleCodeExporter commented on June 3, 2024
Hi Mark,

I think this has always been that way -t is not sample accurate.

Original comment by [email protected] on 15 Jun 2011 at 3:06

  • Added labels: Type-Wish
  • Removed labels: Type-Defect

from ffmbc.

GoogleCodeExporter avatar GoogleCodeExporter commented on June 3, 2024
I've tried using '-ss 2 -vframes 75' instead, but that doesn't give complete 
audio frames either.

Do you know if there is any method to get complete frames of audio?

Original comment by [email protected] on 16 Jun 2011 at 10:28

from ffmbc.

GoogleCodeExporter avatar GoogleCodeExporter commented on June 3, 2024
Humm I'm not sure what you mean by "complete frames of audio". In PCM a 
complete frame is 1 sample. If now you think duration of pcm audio frame ~= 
duration of video frame.
There is no method currently, but it is an interesting idea.

Original comment by [email protected] on 16 Jun 2011 at 9:54

from ffmbc.

GoogleCodeExporter avatar GoogleCodeExporter commented on June 3, 2024
Haha. Yes, that is an interesting different point of view.

Coming from a background of 20 years of Video Editing, I expect a frame of 
audio to be 1920 samples long (48K sampling/25 FPS).

As a video editor, if I am using a tool that lets me extract a subclip (using 
-ss and -t or -vframes) I expect to extract complete frames of video, and the 
corresponding samples of audio that completely and exactly match the complete 
duration of the video frames.

I can see how that is not possible with, for instance, mpeg2 audio frames who's 
timestamp start and end points do not necessarily exactly map to the start and 
end point timestamps of the video frames.

But, as a video editor, I've always worked with uncompressed video.

That thought lead me to an interesting experiment, excuse me while a ramble on 
for a while:

compare:

ffmbc -i primary.mov -ss 2 -vframes 75 -vcodec copy -acodec copy 1.mov

with:

ffmbc -i primary.mov -ss 2 -vframes 75 -vcodec copy -acodec pcm_s16le 1.mov

I find that consistently (for the same input file) that -acodec copy always 
gives me audio in lumps of 1024 samples until a small part of the last video 
frame has audio, then it stops (except for -vframes 1, where you get no audio 
at all).

My example of  -vframes 75 gives me 142336 samples (according to Atom 
Inspector).

75 frames of audio is 144000 samples (48000/25*75).
74 frames of audio is 142080
but I get 142336 samples, which is 139 * 1024
As it happens, 138 * 1024 = 141312, which is less than 142080

So 142336 samples is the first multiple of 1024 that completely satisfies 
142080 samples, but is 1664 samples too few to completely fill 75 frames of 
'PAL' video.


I find that consistently (for the same input file) that -acodec pcm_s16le 
always gives me audio in similar lumps of 1024 samples offset by 639 samples 
(except for -vframes 1, where you get no audio at all).

My example of  -vframes 75 gives me 142975 samples (according to Atom 
Inspector).

75 frames of audio is 144000 samples (48000/25*75).
74 frames of audio is 142080
but I get 142975 samples, which is 139 * 1024 + 639
As it happens, 138 * 1024 + 639 = 141951, which is less than 142080

So 142975 samples is the first multiple of 1024 + 639  that completely 
satisfies 142080 sample, but is 1025 samples too few to completely fill 75 
frames of 'PAL' video.

Wow - I wasn't expecting to see either 1024 or 639 in those calculations, but 
at least 1024 makes some sense!

Now, I know 'NTSC' audio is more complex with your crazy 1001, but it is a 
predictable sequence.

Anyway - rant over ;-)

Original comment by [email protected] on 17 Jun 2011 at 3:08

from ffmbc.

GoogleCodeExporter avatar GoogleCodeExporter commented on June 3, 2024
Mark, I understand your rant, but let me correct you on one point:

"As a video editor, if I am using a tool that lets me extract a subclip (using 
-ss and -t or -vframes) I expect to extract complete frames of video, and the 
corresponding samples of audio that completely and exactly match the complete 
duration of the video frames."

FFmbc is _not_ a video editing tool. I have to redirect you to FCP or Media 
Composer for this, -ss and -t are convience tools but in no case guarantee what 
you seem to require.

Original comment by [email protected] on 17 Jun 2011 at 9:25

from ffmbc.

GoogleCodeExporter avatar GoogleCodeExporter commented on June 3, 2024

Original comment by [email protected] on 26 Jul 2011 at 10:54

  • Changed state: WontFix

from ffmbc.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.