r22010 - trunk/ffmpeg.c
Author: michael Date: Tue Feb 23 23:06:36 2010 New Revision: 22010 Log: Set ist->pts to something that isnt guranteed to entangle itself with stream copying b frames. Modified: trunk/ffmpeg.c Modified: trunk/ffmpeg.c ============================================================================== --- trunk/ffmpeg.c Tue Feb 23 22:03:25 2010 (r22009) +++ trunk/ffmpeg.c Tue Feb 23 23:06:36 2010 (r22010) @@ -2090,8 +2090,10 @@ static int av_encode(AVFormatContext **o /* init pts */ for(i=0;i<nb_istreams;i++) { + AVStream *st; ist = ist_table[i]; - ist->pts = 0; + st= ist->st; + ist->pts = st->avg_frame_rate.num ? - st->codec->has_b_frames*AV_TIME_BASE / av_q2d(st->avg_frame_rate) : 0; ist->next_pts = AV_NOPTS_VALUE; ist->is_start = 1; }
On Feb 23, 2010, at 2:06 PM, michael wrote:
Author: michael Date: Tue Feb 23 23:06:36 2010 New Revision: 22010
Log: Set ist->pts to something that isnt guranteed to entangle itself with stream copying b frames.
./ffmpeg_g -i 5cm.h264 -an -f framecrc -y /dev/null ...
This breaks non-streamcopy, some files have their first frame given negative pts and thus dropped. http://astrange.ithinksw.net/ffmpeg/5cm.h264 frame= 1088 fps= 55 q=0.0 Lsize= 0kB time=45.33 bitrate= 0.0kbits/s dup=0 drop=1 I would attach a patch but I can't quite tell what this was supposed to do.
Modified: trunk/ffmpeg.c
Modified: trunk/ffmpeg.c ============================================================================== --- trunk/ffmpeg.c Tue Feb 23 22:03:25 2010 (r22009) +++ trunk/ffmpeg.c Tue Feb 23 23:06:36 2010 (r22010) @@ -2090,8 +2090,10 @@ static int av_encode(AVFormatContext **o
/* init pts */ for(i=0;i<nb_istreams;i++) { + AVStream *st; ist = ist_table[i]; - ist->pts = 0; + st= ist->st; + ist->pts = st->avg_frame_rate.num ? - st->codec->has_b_frames*AV_TIME_BASE / av_q2d(st->avg_frame_rate) : 0; ist->next_pts = AV_NOPTS_VALUE; ist->is_start = 1; } _______________________________________________ ffmpeg-cvslog mailing list ffmpeg-cvslog at mplayerhq.hu https://lists.mplayerhq.hu/mailman/listinfo/ffmpeg-cvslog
On Wed, Jun 09, 2010 at 11:45:28PM -0700, Alexander Strange wrote:
On Feb 23, 2010, at 2:06 PM, michael wrote:
Author: michael Date: Tue Feb 23 23:06:36 2010 New Revision: 22010
Log: Set ist->pts to something that isnt guranteed to entangle itself with stream copying b frames.
This breaks non-streamcopy, some files have their first frame given negative pts and thus dropped.
probably thats not it. i would guess either AVFormatContext.start_time is wrong and larger than the first pts. (demuxer bug) or has_b_frames is not set correctly (h264 spec bug, the element is optional) its possible to improve has_b_frames detection of course but not 100% but this case shouldnt cause a problem this lead to the 3rd question, do pts when reordered through the decoder match dts as in the input packets (if not theres a bug in either the file or demuxer/parser/decoder If the input stream is buggy or just compliant but wierd and the dts dont match what they should then you can port the reordered_opaque code from ffplay.c to ffmpeg.c this will automatically select then the more correct timestamps of pts/dts
./ffmpeg_g -i 5cm.h264 -an -f framecrc -y /dev/null ...
http://astrange.ithinksw.net/ffmpeg/5cm.h264 frame= 1088 fps= 55 q=0.0 Lsize= 0kB time=45.33 bitrate= 0.0kbits/s dup=0 drop=1
I would attach a patch but I can't quite tell what this was supposed to do.
see above, and sorry that theres no easy awnser also if you give up working on this, please open an issue on the tracker so its not forgotten [...] -- Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB It is dangerous to be right in matters on which the established authorities are wrong. -- Voltaire
participants (3)
-
astrange@ithinksw.com -
michaelni@gmx.at -
subversion@mplayerhq.hu