[Ffmpeg-devel] [PATCH] a fix in ffmpeg.c

Michael Niedermayer michaelni
Thu Jan 18 15:01:18 CET 2007


Hi

On Thu, Jan 18, 2007 at 03:34:52PM +0800, Limin Wang wrote:
> Hi developer,
> 
> When I decode a h264 file by using ffmpeg, it can't decode all frame as my
> expect(300frame in total, it decode 180 frame only).
> 
> lmwang at laptop:~/yuvad/open/h264/ffmpeg$ ./ffmpeg -f h264 -i
> /tmp/akiyo_cif.h264 /tmp/akiyo_cif.yuv
> FFmpeg version SVN-r7430, Copyright (c) 2000-2006 Fabrice Bellard, et al.
>   configuration:  --enable-gpl --enable-x264
>   libavutil version: 49.1.0
>   libavcodec version: 51.28.0
>   libavformat version: 51.7.0
>   built on Jan 18 2007 15:28:56, gcc: 4.1.2 20061115 (prerelease) (Debian
>   4.1.1-21)
> Input #0, h264, from '/tmp/akiyo_cif.h264':
>   Duration: N/A, bitrate: N/A
>   Stream #0.0: Video: h264, yuv420p, 352x288, 15.00 fps(r)
> File '/tmp/akiyo_cif.yuv' already exists. Overwrite ? [y/N] y
> Output #0, rawvideo, to '/tmp/akiyo_cif.yuv':
>   Stream #0.0: Video: rawvideo, yuv420p, 352x288, q=2-31, 200 kb/s, 15.00
>   fps(c)
> Stream mapping:
>   Stream #0.0 -> #0.0
> Press [q] to stop encoding
> frame=  180 q=0.0 Lsize=   26730kB time=12.0 bitrate=18247.7kbits/s
> video:26730kB audio:0kB global headers:0kB muxing overhead 0.000000%
> lmwang at laptop:~/yuvad/open/h264/ffmpeg$   
> 
> 
> After investigated , I found out it's caused by pts is set by default
> fps(25). Below is my fix, please review it.
> 
> Thanks,
> Limin
> 
> 
> Index: ffmpeg.c
> ===================================================================
> --- ffmpeg.c	(revision 7430)
> +++ ffmpeg.c	(working copy)
> @@ -2667,6 +2667,9 @@
>              frame_rate      = rfps;
>              frame_rate_base = rfps_base;
>  
> +            /* need update stream pts info also */
> +            av_set_pts_info(ic->streams[i], 64, frame_rate_base, frame_rate );

rejected
the user application cannot just mess with the internal input timebase

[...]
-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

Democracy is the form of government in which you can choose your dictator
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20070118/fd20e8dd/attachment.pgp>



More information about the ffmpeg-devel mailing list