Closed GoogleCodeExporter closed 8 years ago
Seems to be related to the way the PTS is calculated:
http://thompsonng.blogspot.jp/2011/09/ffmpeg-avinterleavedwriteframe-return.html
I think I remember this error could happen if we try to write two frames with
the same timestamp. Can you check and see if all the calls to
recorder.setTimestamp() end up with unique monotonically increasing values?
Original comment by samuel.a...@gmail.com
on 2 May 2013 at 2:36
Thanks for the response Samuel. Yea, it is definitely related with PTS
calculation. I saw that post and try to "retry" it to use it as a "later" frame
but then it may cause the frame to be "overlapped" by the frame that happens
after. I tried to look at multiple frames at a time and use a heuristic
function to queue up the recording (audio have to be recorded in real time in a
separate recorder and use ffmpeg to combine them together later)...anyways,
long story short. Using the retry method reduce the error rate from about 15%
to about 1% but frames may still be overlapped and lost.
Also tried to use setFrame, but the way PTS gets calculated is weird and does
not produce the same results as expected as setTimestamp()
Anyone have better suggestions? :)
Original comment by wzsddtc
on 2 May 2013 at 2:56
FFmpegFrameRecorder automatically bumps up the timestamp according to the frame
rate, so maybe you could to not call setTimestamp() at all if you are about to
call it with a value <= getTimestamp() ?
Original comment by samuel.a...@gmail.com
on 2 May 2013 at 3:00
I created a patch for the sample file here:
http://code.google.com/p/javacv/source/detail?r=c514ee108a3e158e0fbf920f939403e9
28f7119d
Please let me know that it does the trick, thanks!
Original comment by samuel.a...@gmail.com
on 11 May 2013 at 5:41
Fix included in JavaCV 0.6!
Original comment by samuel.a...@gmail.com
on 16 Sep 2013 at 4:08
I created an app which converts images to video using ffmpeg recorder but I am
facing distortion issue . As I have number of images and each image has
different sizes so when I produce video from those images, video get distorted .
Please help me.
Original comment by sumedhav...@gmail.com
on 21 May 2015 at 3:57
Original issue reported on code.google.com by
wzsddtc
on 1 May 2013 at 8:00