-
Notifications
You must be signed in to change notification settings - Fork 1.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Setting audio frame rate to FFmpegFrameGrabber #1177
Comments
It's probably not returning anything useful, would need to be enhanced. /cc @anotherche |
BTW, we don't need to know the frame rate just to grab the frames. |
@anotherche Thanks for confirming that this is working properly! @rajib3hasan For audio streams, the sample rate is what is typically most useful. Call getSampleRate() to get that value and use that in your application. Other than that, I don't believe FFmpeg supports audio streams with variable sample rate or frame rate, but if you have such a file that is working with the ffmpeg program, please send me that file so we can check it out and fix JavaCV. Thanks! |
okay i am clear now...thanks a lot .... |
hey now i am getting audioFrameRate 375.0 for one audio... i am shocked.... |
i am getting different audio frame rate for different audio with frame grabber |
192000/512=375 |
here what is 192000 and 512??? |
how time stamp is related with frame rate or sample rate??? how can i calculate progressive time stamp??? |
It's basic signal processing. Read this, for example: |
They are not related. Timestamp is the position of a frame in the stream (a time moment at which this frame should appear at normal playback). Frame rate and sample rate are defined by the sound format/encoder. If you transcode a video or audio (the content and duration/play rate remain the same) the position of a scene remain the same, but frame rate or sample rate may change if you use different formats/encoders. |
@anotherche Some codecs are buggy though and do not provide a timestamp, see issue #1035. |
I got you. How can i calculate what will be the time-stamp for next grab before grabbing? I don't wanna add that frame if it exceeds certain positions. And you know there is a little chance that time-stamp will be same as expected time position. I could do this checking after grabbing frame... but sometimes i get time-stamp 0,0 after two grab(); Could you please suggest some solution??? |
actually is there any audio stream when we get timestamp 0 ??? Can we skip the frame??? |
" here what is 192000 and 512???" |
Thank you... |
But i am getting wrong video time still now. I check audioTimeStamp from grabber is greater than my expected time or not. If audioStamp is greater than expected time then i stop recording audio frame. After that, i get recorder timestamp exactly equal to my expected time but somehow video length is slightly greater than expected time and video in additional time is black. But when i add only bitmap , everything is okay... i can't figure out the problem..... |
I'm not sure if this is related to your question, but here are some general thoughts. |
We can however record partial audio frames to match the length of the video.
|
Okay. But before pushing a frame to filter i get frame.sampleRate is equal to 48000, but after pulling it is 41000 and time stamp is zero for some frames. It causes problem. So i again set the sample rate and timestamp of frame after pulling from filter which i get before pushing. It solves some of my problems. I also skip the frame which for which i get timestamp 0 from grabber at the beginning of grabbing. It Some how solves my problem for now. |
Ah, you were using FFmpegFrameFilter. |
Why does getAudioFrameRate() of FFmpegFrameGrabber always gives 38.28125 for all type of audios? How can we grab audio frame with different frame rate???
The text was updated successfully, but these errors were encountered: