Henk Schoneveld <belca...@zonnet.nl> added the comment:

in a time-frame which is impossible at .04 per frame/aka 25fps.
> would you mind
> telling us what your problem is (instead of pasting random output that proves 
> my
> point)?
My problem is that if I have 10 multi-GOP's as source with a total of
1000 frames, after encoding I'm left with ~ 980-990 frames. So sync with
sound is lost and playback obviously isn't smooth.
I'm doing this because I'm doing distributed encoding with 5PC's and a
total of 12Cores. This way I achieve a substantially higher encoding
performance than with -threads 0 or 2 or 4 or whatever option.
> Note that even if CoreAVC would produce more frames (which isn't the case), 
> the
> reference decoder would still be the, well, "reference".
> 
> My out.yuv is only 265939200, so I don't think you are using the same input 
> for
> that comparison.
> 
Sorry for getting the wrong source file.
1 mythtv users 265939920 2010-08-05 10:17 /spvfs/CoreAVC.yuv*
1 mythtv users 265939946 2010-08-05 10:47 /spvfs/ffh264-ffmpeg.yuv
1 mythtv users 254275890 2010-08-05 10:13 /spvfs/ffh264-mplayer.yuv*

And from CoreAVC.yuv and ffh264-ffmpeg.yuv I indeed get 114frames with
current FFmpeg version SVN-r24704 from this morning.

But I'll give another example, hope you're not getting that frustated as
I am with this thing.

Summarizing what's beneath:
A. Original 293frames.ts to out.yuv 290 frames
B. Original 293frames.ts copy to raw 293 frames
C. Original 293frames.ts encoded results in 289 frames
D. From result of B, encoding from raw as source 290 frames
E. From result of B, to another out.yuv 291 frames.
F. From result of B, mencoder/Coreavc results in 293 frames

F. Reported time and #fra...@25fps is as it should be and mplayer agrees 
on it when palying the file.
V:  11.7 293/293

Probably it has something to do with matters as described here:
http://lists.mplayerhq.hu/pipermail/ffmpeg-user/2010-January/023613.html
and especially the part:

--------------
As mplayer does the right thing when viewing on screen, I tried that, 
with video output yu4mpeg and audio output pcm. Doesn't work. Apparently 
the synchronisation is done using timing the display of the frame,
information that is lost when exporting to yuv4meg.
--------------

ffmpeg -r 25 -i /spvfs/293frames.ts -f yuv4mpegpipe -r 25 out.yuv
FFmpeg version SVN-r24704, Copyright (c) 2000-2010 the FFmpeg developers
   built on Aug  5 2010 07:10:17 with gcc 4.2.3 (4.2.3-6mnb2)
   configuration: --prefix=/usr --enable-gpl --enable-libfaac
--enable-libmp3lame --enable-pthreads --disable-ffserver --enable-ffplay
--as=yasm --enable-nonfree --enable-libx264 --enable-libxvid
   libavutil     50.23. 0 / 50.23. 0
   libavcore      0. 2. 0 /  0. 2. 0
   libavcodec    52.84. 2 / 52.84. 2
   libavformat   52.78. 0 / 52.78. 0
   libavdevice   52. 2. 0 / 52. 2. 0
   libavfilter    1.27. 0 /  1.27. 0
   libswscale     0.11. 0 /  0.11. 0
[h264 @ 0x8f57b30] non-existing SPS 32 referenced in buffering period
     Last message repeated 1 times
[h264 @ 0x8f57b30] mmco: unref short failure
     Last message repeated 2 times
[mpegts @ 0x8f53470] Invalid timestamps stream=0, pts=172177200,
dts=172180800, size=3461
[mpegts @ 0x8f53470] max_analyze_duration reached
Input #0, mpegts, from '/spvfs/293frames.ts':
   Duration: 00:00:11.56, start: 1910.160000, bitrate: 5478 kb/s
   Program 1
     Stream #0.0[0x1011]: Video: h264, yuv420p, 1440x1080 [PAR 4:3 DAR
16:9], 25 fps, 25 tbr, 90k tbn, 50 tbc
[buffer @ 0x8f56800] w:1440 h:1080 pixfmt:yuv420p
[h264 @ 0x8f57b30] non-existing SPS 32 referenced in buffering period
Output #0, yuv4mpegpipe, to 'out.yuv':
   Metadata:
     encoder         : Lavf52.78.0
     Stream #0.0: Video: rawvideo, yuv420p, 1440x1080 [PAR 4:3 DAR
16:9], q=2-31, 200 kb/s, 90k tbn, 25 tbc
Stream mapping:
   Stream #0.0 -> #0.0
Press [q] to stop encoding
[h264 @ 0x8f57b30] non-existing SPS 32 referenced in buffering period
[h264 @ 0x8f57b30] mmco: unref short failure
     Last message repeated 2 times159469kB time=2.80
bitrate=466561.4kbits/s dup=0 drop=1
[mpegts @ 0x8f53470] Invalid timestamps stream=0, pts=172177200,
dts=172180800, size=3461
frame=  290 fps= 26 q=0.0 Lsize=  660658kB time=11.60
bitrate=466561.2kbits/s dup=0 drop=1
video:0kB audio:0kB global headers:0kB muxing overhead inf%

ffmpeg -r 25 -i /spvfs/293frames.ts -vcodec copy -f rawvideo -r 25
/spvfs/293frames.264
FFmpeg version SVN-r24704, Copyright (c) 2000-2010 the FFmpeg developers
   built on Aug  5 2010 07:10:17 with gcc 4.2.3 (4.2.3-6mnb2)
   configuration: --prefix=/usr --enable-gpl --enable-libfaac
--enable-libmp3lame --enable-pthreads --disable-ffserver --enable-ffplay
--as=yasm --enable-nonfree --enable-libx264 --enable-libxvid
   libavutil     50.23. 0 / 50.23. 0
   libavcore      0. 2. 0 /  0. 2. 0
   libavcodec    52.84. 2 / 52.84. 2
   libavformat   52.78. 0 / 52.78. 0
   libavdevice   52. 2. 0 / 52. 2. 0
   libavfilter    1.27. 0 /  1.27. 0
   libswscale     0.11. 0 /  0.11. 0
[h264 @ 0x8c1eb30] non-existing SPS 32 referenced in buffering period
     Last message repeated 1 times
[h264 @ 0x8c1eb30] mmco: unref short failure
     Last message repeated 2 times
[mpegts @ 0x8c1a470] Invalid timestamps stream=0, pts=172177200,
dts=172180800, size=3461
[mpegts @ 0x8c1a470] max_analyze_duration reached
Input #0, mpegts, from '/spvfs/293frames.ts':
   Duration: 00:00:11.56, start: 1910.160000, bitrate: 5478 kb/s
   Program 1
     Stream #0.0[0x1011]: Video: h264, yuv420p, 1440x1080 [PAR 4:3 DAR
16:9], 25 fps, 25 tbr, 90k tbn, 50 tbc
Output #0, rawvideo, to '/spvfs/293frames.264':
   Metadata:
     encoder         : Lavf52.78.0
     Stream #0.0: Video: libx264, yuv420p, 1440x1080 [PAR 4:3 DAR 16:9],
q=2-31, 90k tbn, 25 tbc
Stream mapping:
   Stream #0.0 -> #0.0
Press [q] to stop encoding
[NULL @ 0x8c1eb30] non-existing SPS 32 referenced in buffering period
[mpegts @ 0x8c1a470] Invalid timestamps stream=0, pts=172177200,
dts=172180800, size=3461
frame=  293 fps=271 q=-1.0 Lsize=    7518kB time=11.52
bitrate=5346.0kbits/s
video:7518kB audio:0kB global headers:0kB muxing overhead 0.000000%

In less time 11.52 vs 11.60 it gets more frames 293 vs 290

And mplayer indeed plays 293 frames if mplayer's frame-numbering starts
at 0. Playing the source.ts I get 1 frame less.

Encoding with ffmpeg -r 25 -i /spvfs/293frames.ts -vcodec libx264 -vpre
default  -r 25 /spvfs/293framesfromts.mp4
gives:
frame=  289 fps=  7 q=-1.0 Lsize=    1394kB time=11.60 bitrate=
984.7kbits/s dup=0 drop=2

Encoding with ffmpeg -r 25 -i /spvfs/293frames.264 -vcodec libx264 -vpre
default -r 25 /spvfs/293framesfromraw.mp4
gives:
frame=  290 fps=  7 q=-1.0 Lsize=    1391kB time=11.60 bitrate=
982.5kbits/s dup=0 drop=1

Encoding with mencoder z:\293frames.264 -fps 25 -ofps 25 -o 
z:\mencoder293framesCoreAVC.avi -vc dsncoreavc -vf scale=720:576:0 
-demuxer lavf -nosound -ovc x264 -x264encopts 
bitrate=1672:me=umh:me_range=24:nodct_decimate:nointerlaced:8x8dct:nofast_pskip:trellis=1:partitions=p8x8,b8x8,i8x8,i4x4:mixed_refs:keyint=250:keyint_min=25:psy_rd=0.8,0.2:frameref=3:bframes=3:b_adapt=2:b_pyramid=none:weight_b:weightp=2:direct_pred=auto:subq=7:mbtree:chroma_me:cabac:aud:aq_mode=1:deblock:vbv_maxrate=12500:vbv_bufsize=5000:level_idc=30:threads=auto:ssim:psnr
gives:
Video stream: 1690.388 kbit/s  (211298 B/s)  size: 2476418 bytes  11.720 
secs  293 frames

Reported time and #fra...@25fps is as it should be.

________________________________________________
FFmpeg issue tracker <iss...@roundup.ffmpeg.org>
<https://roundup.ffmpeg.org/issue2020>
________________________________________________

Reply via email to