Hi mencoder experts. I have a file [1] that is exactly 250 frames long. It’s a countdown clock counting from 10 to 1 in seconds, frames and fields - every frame is uniquely identifiable. It was exported from an Avid to a MOV DV25 576i25 with two tracks of audio that are silent. Mplayer plays every frame. I can step through with [.] to see all the frames up to the end. I render that file to H264 (I’ve tried into a MOV and an AVI container) with this command (AVI version): mencoder -v -noskip -mc 0 -cache 65536 -af channels=2 -vf harddup -ofps 25 -oac mp3lame -lameopts cbr:br=192:mode=2 -ovc x264 -x264encopts psnr:interlaced:pass=$PASS:turbo=2:global_header:bitrate=4000:keyint=180:bframes=3:direct_pred=auto:frameref=3:me=umh:partitions=all:b_pyramid:threads=auto -passlogfile "Clock10.AVC-4000-2pass.log" -o "Clock10.AVC-4000-2pass.avi" "Clock10.mov" > Clock10.AVC-4000_pass2-out.txt 2>&1 I’m using -noskip -mc 0 because I absolutely know that the media is in sync and I absolutely do not want mencoder changing that sync. A snippet from the end of the log says there are 250 frames ([2] for full log) <SNIP> Pos: 9.8s 250f (99%) 31fps Trem: 0min 0mb A-V:0.000 [564:0] A/Vms 0/31 D/B/S 0/0/0 ds_fill_buffer: EOF reached (stream: video) Flushing video frames. Writing index... Writing header... ODML: vprp aspect is 16384:13107. Video stream: 561.203 kbit/s (70150 B/s) size: 701504 bytes 10.000 secs 250 frames Uninit video: ffmpeg </SNIP> If I play that file in mplayer and step through the last few frames the last two frames are not displayed. I convert that file BACK to a DV25 MOV with this command: mencoder -v -noskip -mc 0 -af channels=2 -vf harddup -ofps 25 -oac pcm -ovc lavc -lavcopts vcodec=dvvideo -of lavf -lavfopts format=mov -o "Clock10.AVC-4000-2pass.DV.mov" "Clock10.AVC-4000-2pass.avi" > Clock10.AVC-4000-DV-out.txt 2>&1 Again mencoder tells me there are 250 frames ([3] for full log) <SNIP> Pos: 9.9s 250f (99%) 58fps Trem: 0min 34mb A-V:0.000 [28800:0] A/Vms 0/17 D/B/S 0/2/0 ds_fill_buffer: EOF reached (stream: video) Flushing video frames. Writing index... Video stream: 28800.000 kbit/s (3600000 B/s) size: 35712000 bytes 9.920 secs 250 frames </SNIP> But the last two frames cannot be seen in mplayer or QuickTime. This is frustrating, as the exercise is to take broadcast quality video from a foreign bureau, compress it and transfer it across the Internet, and then reconstitute it at the home-broadcaster end. Any suggestions where the last two frames have gone and how I can get them back? [1] http://mdsh.com/tmp/Clock10.mov [2] Encode DV->h.264 MEncoder Sherpya-SVN-r29355-4.5.0 (C) 2000-2009 MPlayer Team Configuration: --extra-cflags=-I/c/Work/mplayer/live --prefix=/usr --enable-static --enable-md5sum --enable-menu --disable-vdpau --disable-vidix --disable-sdl --enable-caca --enable-gl --enable-matrixview --enable-freetype --enable-png --enable-mng --enable-jpeg --enable-gif --enable-tga --enable-mad --enable-tv --enable-theora --disable-dvb --disable-dvbhead --enable-libamr_nb --enable-libamr_wb --flavor=p4 init_freetype get_path('font/font.desc') -> 'D:\himslm01/mplayer/font/font.desc' font: can't open file: D:\himslm01/mplayer/font/font.desc font: can't open file: /usr/share/mplayer/font/font.desc Using MMX (with tiny bit MMX2) Optimized OnScreenDisplay get_path('fonts') -> 'D:\himslm01/mplayer/fonts' WINSOCK2 init: 0 WINSOCK2 init: 0 [file] File size is 36263829 bytes STREAM: [file] Clock10.mov STREAM: Description: File STREAM: Author: Albeu STREAM: Comment: based on the code from ??? (probably Arpi) success: format: 0 data: 0x0 - 0x2295795 CACHE_PRE_INIT: 0 [0] 0 pre:0 eof:0 LAVF_check: QuickTime/MPEG-4/Motion JPEG 2000 format libavformat file format detected. ==> Found video stream: 0 [lavf] Video stream found, -vid 0 ======= VIDEO Format ====== biSize 40 biWidth 720 biHeight 576 biPlanes 0 biBitCount 24 biCompression 1885566564='dvcp' biSizeImage 1244160 =========================== ==> Found video stream: 1 [lavf] Video stream found, -vid 1 ======= VIDEO Format ====== biSize 40 biWidth 720 biHeight 576 biPlanes 0 biBitCount 24 biCompression 1885566564='dvcp' biSizeImage 1244160 =========================== LAVF: 0 audio and 2 video streams found LAVF: build 3416576 VIDEO: [dvcp] 720x576 24bpp 25.000 fps 0.0 kbps ( 0.0 kbyte/s) [V] filefmt:44 fourcc:0x70637664 size:720x576 fps:25.000 ftime:=0.0400 WINSOCK2 init: 0 WINSOCK2 init: 0 [file] File size is 0 bytes STREAM: [file] Clock10.AVC-4000-2pass.avi STREAM: Description: File STREAM: Author: Albeu STREAM: Comment: based on the code from ??? (probably Arpi) Opening video filter: [expand osd=1] Expand: -1 x -1, -1 ; -1, osd: 1, aspect: 0.000000, round: 1 Opening video filter: [harddup] ========================================================================== Opening video decoder: [ffmpeg] FFmpeg's libavcodec codec family Unsupported PixelFormat -1 INFO: libavcodec init OK! Selected video codec: [ffdv] vfm: ffmpeg (FFmpeg DV) ========================================================================== [ffmpeg] aspect_ratio: 0.000000 VDec: vo config request - 720 x 576 (preferred colorspace: Planar YV12) Trying filter chain: harddup expand x264 Could not find matching colorspace - retrying with -vf scale... Opening video filter: [scale] SwScale params: -1 x -1 (-1=no scaling) Trying filter chain: scale harddup expand x264 VDec: using Planar YV12 as output csp (no 2) Movie-Aspect is undefined - no prescaling applied. VO Config (720x576->720x576,flags=0,'MPlayer',0x32315659) [swscaler @ 00DF6D14]using unscaled yuv420p -> yuv420p special converter REQ: flags=0x403 req=0x0 REQ: flags=0x403 req=0x0 REQ: flags=0x3 req=0x0 *** [scale] Allocating mp_image_t, 720x576x12bpp YUV planar, 622080 bytes *** [harddup] Allocating mp_image_t, 720x576x12bpp YUV planar, 622080 bytes *** [expand] Exporting mp_image_t, 720x576x12bpp YUV planar, 622080 bytes *** [x264] Allocating mp_image_t, 720x576x12bpp YUV planar, 622080 bytes get_path('subfont.ttf') -> 'D:\himslm01/mplayer/subfont.ttf' x264 [warning]: interlace + direct=temporal is not implemented x264 [info]: using SAR=1/1 x264 [info]: using cpu capabilities: MMX2 SSE2Fast SSSE3 Cache64 x264 [warning]: Error: 2pass curve failed to converge x264 [warning]: target: 4000.00 kbit/s, expected: 898.33 kbit/s, avg QP: 10.0010 x264 [warning]: try reducing target bitrate or reducing qp_min (currently 10) x264 [info]: profile Main, level 3.0 New_Face failed. Maybe the font path is wrong. Please supply the text font file (~/.mplayer/subfont.ttf). subtitle font: load_sub_face failed. get_path('subfont.ttf') -> 'D:\himslm01/mplayer/subfont.ttf' New_Face failed. Maybe the font path is wrong. Please supply the text font file (~/.mplayer/subfont.ttf). subtitle font: load_sub_face failed. Pos: 0.0s 1f ( 1%) 0fps Trem: 0min 0mb A-V:0.000 [0:0] A/Vms 0/23 D/B/S 0/0/0 *** [scale] Allocating mp_image_t, 720x576x12bpp YUV planar, 622080 bytes Pos: 0.0s 2f ( 1%) 0fps Trem: 0min 0mb A-V:0.000 [0:0] A/Vms 0/15 D/B/S 0/0/0 Pos: 0.0s 3f ( 1%) 0fps Trem: 0min 0mb A-V:0.000 [0:0] A/Vms 0/15 D/B/S 0/0/0 Pos: 0.0s 4f ( 1%) 0fps Trem: 0min 0mb A-V:0.000 [0:0] A/Vms 0/12 D/B/S 0/0/0 Pos: 0.0s 5f ( 2%) 0fps Trem: 0min 0mb A-V:0.000 [0:0] A/Vms 0/13 D/B/S 0/0/0 Muxer frame buffer sending 1 frame(s) to the muxer. Writing header... ODML: vprp aspect is 16384:13107. Writing header... ODML: vprp aspect is 16384:13107. Pos: 0.0s 6f ( 2%) 0fps Trem: 0min 1mb A-V:0.000 [0:0] A/Vms 0/22 D/B/S 0/0/0 Pos: 0.1s 7f ( 3%) 0fps Trem: 0min 1mb A-V:0.000 [0:0] A/Vms 0/23 D/B/S 0/0/0 Pos: 0.1s 8f ( 3%) 0fps Trem: 0min 1mb A-V:0.000 [0:0] A/Vms 0/22 D/B/S 0/0/0 Pos: 0.2s 9f ( 3%) 0fps Trem: 0min 1mb A-V:0.000 [0:0] A/Vms 0/22 D/B/S 0/0/0 Pos: 0.2s 10f ( 4%) 0fps Trem: 0min 1mb A-V:0.000 [0:0] A/Vms 0/22 D/B/S 0/0/0 <SNIP - NOTHING INTERESTING> Pos: 9.4s 240f (95%) 31fps Trem: 0min 0mb A-V:0.000 [569:0] A/Vms 0/31 D/B/S 0/0/0 Pos: 9.4s 241f (96%) 31fps Trem: 0min 0mb A-V:0.000 [568:0] A/Vms 0/31 D/B/S 0/0/0 Pos: 9.5s 242f (96%) 31fps Trem: 0min 0mb A-V:0.000 [568:0] A/Vms 0/31 D/B/S 0/0/0 Pos: 9.5s 243f (96%) 31fps Trem: 0min 0mb A-V:0.000 [567:0] A/Vms 0/31 D/B/S 0/0/0 Pos: 9.6s 244f (97%) 31fps Trem: 0min 0mb A-V:0.000 [566:0] A/Vms 0/31 D/B/S 0/0/0 Pos: 9.6s 245f (97%) 31fps Trem: 0min 0mb A-V:0.000 [566:0] A/Vms 0/31 D/B/S 0/0/0 Pos: 9.6s 246f (98%) 31fps Trem: 0min 0mb A-V:0.000 [566:0] A/Vms 0/31 D/B/S 0/0/0 Pos: 9.7s 247f (98%) 31fps Trem: 0min 0mb A-V:0.000 [565:0] A/Vms 0/31 D/B/S 0/0/0 Pos: 9.7s 248f (98%) 31fps Trem: 0min 0mb A-V:0.000 [565:0] A/Vms 0/31 D/B/S 0/0/0 Pos: 9.8s 249f (99%) 31fps Trem: 0min 0mb A-V:0.000 [565:0] A/Vms 0/31 D/B/S 0/0/0 Pos: 9.8s 250f (99%) 31fps Trem: 0min 0mb A-V:0.000 [564:0] A/Vms 0/31 D/B/S 0/0/0 ds_fill_buffer: EOF reached (stream: video) Flushing video frames. Writing index... Writing header... ODML: vprp aspect is 16384:13107. Video stream: 561.203 kbit/s (70150 B/s) size: 701504 bytes 10.000 secs 250 frames Uninit video: ffmpeg WINSOCK2 uninit x264 [info]: slice I:2 Avg QP:11.20 size: 26838 PSNR Mean Y:51.08 U:53.66 V:53.50 Avg:51.76 Global:51.76 x264 [info]: slice P:98 Avg QP:11.43 size: 3221 PSNR Mean Y:51.17 U:52.83 V:52.64 Avg:51.63 Global:51.62 x264 [info]: slice B:150 Avg QP:11.62 size: 2213 PSNR Mean Y:51.03 U:52.73 V:52.53 Avg:51.50 Global:51.50 x264 [info]: consecutive B-frames: 19.4% 0.0% 0.0% 80.6% x264 [info]: mb I I16..4: 71.0% 0.0% 29.0% x264 [info]: mb P I16..4: 0.9% 0.0% 1.2% P16..4: 14.2% 0.8% 3.7% 0.4% 0.3% skip:78.5% x264 [info]: mb B I16..4: 1.2% 0.0% 0.0% B16..8: 5.0% 0.6% 1.0% direct: 8.4% skip:83.8% L0:51.1% L1:45.4% BI: 3.6% x264 [info]: coded y,uvDC,uvAC intra:53.2% 81.5% 78.2% inter:2.2% 9.4% 0.9% x264 [info]: ref P L0 71.7% 3.0% 14.7% 1.2% 8.7% 0.7% x264 [info]: ref B L0 61.9% 13.3% 20.3% 4.5% x264 [info]: ref B L1 79.6% 10.8% 7.3% 2.2% x264 [info]: PSNR Mean Y:51.085 U:52.781 V:52.581 Avg:51.554 Global:51.547 kb/s:561.01 [3] MEncoder Sherpya-SVN-r29355-4.5.0 (C) 2000-2009 MPlayer Team Configuration: --extra-cflags=-I/c/Work/mplayer/live --prefix=/usr --enable-static --enable-md5sum --enable-menu --disable-vdpau --disable-vidix --disable-sdl --enable-caca --enable-gl --enable-matrixview --enable-freetype --enable-png --enable-mng --enable-jpeg --enable-gif --enable-tga --enable-mad --enable-tv --enable-theora --disable-dvb --disable-dvbhead --enable-libamr_nb --enable-libamr_wb --flavor=p4 init_freetype get_path('font/font.desc') -> 'D:\himslm01/mplayer/font/font.desc' font: can't open file: D:\himslm01/mplayer/font/font.desc font: can't open file: /usr/share/mplayer/font/font.desc Using MMX (with tiny bit MMX2) Optimized OnScreenDisplay get_path('fonts') -> 'D:\himslm01/mplayer/fonts' WINSOCK2 init: 0 WINSOCK2 init: 0 [file] File size is 711738 bytes STREAM: [file] Clock10.AVC-4000-2pass.avi STREAM: Description: File STREAM: Author: Albeu STREAM: Comment: based on the code from ??? (probably Arpi) success: format: 0 data: 0x0 - 0xadc3a LAVF_check: AVI format AVI file format detected. list_end=0x38E ======= AVI Header ======= us/frame: 40000 (fps=25.000) max bytes/sec: 0 padding: 0 MainAVIHeader.dwFlags: (2320) HAS_INDEX IS_INTERLEAVED TRUST_CKTYPE frames total: 250 initial: 0 streams: 1 Suggested BufferSize: 0 Size: 720 x 576 ========================== list_end=0x38E ==> Found video stream: 0 [aviheader] Video stream found, -vid 0 ====== STREAM Header ===== Type: vids FCC: h264 (34363268) Flags: 0 Priority: 0 Language: 0 InitialFrames: 0 Rate: 25/1 = 25.000 Start: 0 Len: 250 Suggested BufferSize: 28618 Quality 0 Sample size: 0 ========================== Found 'bih', 662 bytes of 40 ======= VIDEO Format ====== biSize 662 biWidth 720 biHeight 576 biPlanes 1 biBitCount 24 biCompression 875967080='h264' biSizeImage 1244160 Unknown extra header dump: [0] [0] [0] [1] [6] [5] [ff] [ff] [41] [dc] [45] [e9] [bd] [e6] [d9] [48] [b7] [96] [2c] [d8] [20] [d9] [23] [ee] [ef] [78] [32] [36] [34] [20] [2d] [20] [63] [6f] [72] [65] [20] [36] [37] [20] [72] [31] [31] [36] [35] [4d] [20] [36] [38] [34] [31] [63] [35] [65] [20] [2d] [20] [48] [2e] [32] [36] [34] [2f] [4d] [50] [45] [47] [2d] [34] [20] [41] [56] [43] [20] [63] [6f] [64] [65] [63] [20] [2d] [20] [43] [6f] [70] [79] [6c] [65] [66] [74] [20] [32] [30] [30] [33] [2d] [32] [30] [30] [39] [20] [2d] [20] [68] [74] [74] [70] [3a] [2f] [2f] [77] [77] [77] [2e] [76] [69] [64] [65] [6f] [6c] [61] [6e] [2e] [6f] [72] [67] [2f] [78] [32] [36] [34] [2e] [68] [74] [6d] [6c] [20] [2d] [20] [6f] [70] [74] [69] [6f] [6e] [73] [3a] [20] [63] [61] [62] [61] [63] [3d] [31] [20] [72] [65] [66] [3d] [33] [20] [64] [65] [62] [6c] [6f] [63] [6b] [3d] [31] [3a] [30] [3a] [30] [20] [61] [6e] [61] [6c] [79] [73] [65] [3d] [30] [78] [31] [3a] [30] [78] [31] [33] [31] [20] [6d] [65] [3d] [75] [6d] [68] [20] [73] [75] [62] [6d] [65] [3d] [36] [20] [70] [73] [79] [5f] [72] [64] [3d] [31] [2e] [30] [3a] [30] [2e] [30] [20] [6d] [69] [78] [65] [64] [5f] [72] [65] [66] [3d] [30] [20] [6d] [65] [5f] [72] [61] [6e] [67] [65] [3d] [31] [36] [20] [63] [68] [72] [6f] [6d] [61] [5f] [6d] [65] [3d] [31] [20] [74] [72] [65] [6c] [6c] [69] [73] [3d] [30] [20] [38] [78] [38] [64] [63] [74] [3d] [30] [20] [63] [71] [6d] [3d] [30] [20] [64] [65] [61] [64] [7a] [6f] [6e] [65] [3d] [32] [31] [2c] [31] [31] [20] [63] [68] [72] [6f] [6d] [61] [5f] [71] [70] [5f] [6f] [66] [66] [73] [65] [74] [3d] [2d] [32] [20] [74] [68] [72] [65] [61] [64] [73] [3d] [33] [20] [6e] [72] [3d] [30] [20] [64] [65] [63] [69] [6d] [61] [74] [65] [3d] [31] [20] [6d] [62] [61] [66] [66] [3d] [31] [20] [62] [66] [72] [61] [6d] [65] [73] [3d] [33] [20] [62] [5f] [70] [79] [72] [61] [6d] [69] [64] [3d] [31] [20] [62] [5f] [61] [64] [61] [70] [74] [3d] [31] [20] [62] [5f] [62] [69] [61] [73] [3d] [30] [20] [64] [69] [72] [65] [63] [74] [3d] [31] [20] [77] [70] [72] [65] [64] [62] [3d] [30] [20] [6b] [65] [79] [69] [6e] [74] [3d] [31] [38] [30] [20] [6b] [65] [79] [69] [6e] [74] [5f] [6d] [69] [6e] [3d] [32] [35] [20] [73] [63] [65] [6e] [65] [63] [75] [74] [3d] [34] [30] [20] [72] [63] [3d] [32] [70] [61] [73] [73] [20] [62] [69] [74] [72] [61] [74] [65] [3d] [34] [30] [30] [30] [20] [72] [61] [74] [65] [74] [6f] [6c] [3d] [31] [2e] [30] [20] [71] [63] [6f] [6d] [70] [3d] [30] [2e] [36] [30] [20] [71] [70] [6d] [69] [6e] [3d] [31] [30] [20] [71] [70] [6d] [61] [78] [3d] [35] [31] [20] [71] [70] [73] [74] [65] [70] [3d] [34] [20] [63] [70] [6c] [78] [62] [6c] [75] [72] [3d] [32] [30] [2e] [30] [20] [71] [62] [6c] [75] [72] [3d] [30] [2e] [35] [20] [69] [70] [5f] [72] [61] [74] [69] [6f] [3d] [31] [2e] [34] [30] [20] [70] [62] [5f] [72] [61] [74] [69] [6f] [3d] [31] [2e] [33] [30] [20] [61] [71] [3d] [31] [3a] [31] [2e] [30] [30] [0] [80] [0] [0] [0] [1] [67] [4d] [40] [1e] [9a] [72] [1] [68] [49] [b0] [11] [0] [0] [3] [0] [1] [0] [0] [3] [0] [32] [8f] [14] [29] [92] [0] [0] [0] [1] [68] [ee] [32] [c8] =========================== ======= Video Properties Header ======= Format: 0 VideoStandard: 0 VRefresh: 25 HTotal: 720 VTotal: 576 FrameAspect: 16384:13107 Framewidth: 720 Frameheight: 576 Fields: 1 == Field 0 description == CompressedBMHeight: 576 CompressedBMWidth: 720 ValidBMHeight: 576 ValidBMWidth: 720 ValidBMXOffset: 0 ValidBMYOffset: 0 VideoXOffsetInT: 0 VideoYValidStartLine: 0 ======================================= list_end=0x3C4 hdr=Software size=34 Software : MEncoder Sherpya-SVN-r29355-4.5.0 list_end=0xACC92 Found movie at 0x100C - 0xACC92 Reading INDEX block, 250 chunks for 250 frames (fpos=707738). AVI index offset: 0x1008 (movi=0x100C idx0=0x4 idx1=0x61FE) Auto-selected AVI video ID = 0 AVI: Searching for audio stream (id:-1) AVI: No audio stream found -> no sound. AVI video size=701504 (250) audio size=0 (0) VIDEO: [h264] 720x576 24bpp 25.000 fps 561.2 kbps (68.5 kbyte/s) [V] filefmt:3 fourcc:0x34363268 size:720x576 fps:25.000 ftime:=0.0400 WINSOCK2 init: 0 WINSOCK2 init: 0 [file] File size is 0 bytes STREAM: [file] Clock10.AVC-4000-2pass.DV.mov STREAM: Description: File STREAM: Author: Albeu STREAM: Comment: based on the code from ??? (probably Arpi) ** MUXER_LAVF ***************************************************************** REMEMBER: MEncoder's libavformat muxing is presently broken and can generate INCORRECT files in the presence of B-frames. Moreover, due to bugs MPlayer will play these INCORRECT files as if nothing were wrong! ******************************************************************************* OK, exit. ALLOCATED STREAM N. 1, type=0 Opening video filter: [expand osd=1] Expand: -1 x -1, -1 ; -1, osd: 1, aspect: 0.000000, round: 1 Opening video filter: [harddup] ========================================================================== Opening video decoder: [ffmpeg] FFmpeg's libavcodec codec family INFO: libavcodec init OK! Selected video codec: [ffh264] vfm: ffmpeg (FFmpeg H.264) ========================================================================== Pos: 0.0s 1f ( 0%) 0fps Trem: 0min 0mb A-V:0.000 [0:0] A/Vms 0/8 D/B/S 0/1/0 Pos: 0.0s 2f ( 3%) 0fps Trem: 0min 0mb A-V:0.000 [0:0] A/Vms 0/10 D/B/S 0/2/0 [ffmpeg] aspect_ratio: 1.250000 VDec: vo config request - 720 x 576 (preferred colorspace: Planar YV12) Trying filter chain: harddup expand lavc VDec: using Planar YV12 as output csp (no 0) Movie-Aspect is 1.25:1 - prescaling to correct movie aspect. VO Config (720x576->720x576,flags=0,'MPlayer',0x32315659) REQ: flags=0x401 req=0x0 REQ: flags=0x401 req=0x0 videocodec: libavcodec (720x576 fourcc=64737664 [dvsd]) *** [harddup] Exporting mp_image_t, 720x576x12bpp YUV planar, 622080 bytes *** [expand] Exporting mp_image_t, 720x576x12bpp YUV planar, 622080 bytes *** [lavc] Allocating mp_image_t, 720x576x12bpp YUV planar, 622080 bytes get_path('subfont.ttf') -> 'D:\himslm01/mplayer/subfont.ttf' New_Face failed. Maybe the font path is wrong. Please supply the text font file (~/.mplayer/subfont.ttf). subtitle font: load_sub_face failed. get_path('subfont.ttf') -> 'D:\himslm01/mplayer/subfont.ttf' New_Face failed. Maybe the font path is wrong. Please supply the text font file (~/.mplayer/subfont.ttf). subtitle font: load_sub_face failed. Muxer frame buffer sending 1 frame(s) to the muxer. VIDEO CODEC ID: 25 Writing header... Pos: 0.0s 3f ( 4%) 0fps Trem: 0min 3mb A-V:0.000 [0:0] A/Vms 0/15 D/B/S 0/2/0 Pos: 0.1s 4f ( 5%) 0fps Trem: 0min 5mb A-V:0.000 [0:0] A/Vms 0/15 D/B/S 0/2/0 Pos: 0.1s 5f ( 5%) 0fps Trem: 0min 7mb A-V:0.000 [0:0] A/Vms 0/15 D/B/S 0/2/0 Pos: 0.2s 6f ( 6%) 0fps Trem: 0min 8mb A-V:0.000 [0:0] A/Vms 0/15 D/B/S 0/2/0 Pos: 0.2s 7f ( 6%) 0fps Trem: 0min 10mb A-V:0.000 [0:0] A/Vms 0/15 D/B/S 0/2/0 Pos: 0.2s 8f ( 7%) 0fps Trem: 0min 11mb A-V:0.000 [0:0] A/Vms 0/15 D/B/S 0/2/0 Pos: 0.3s 9f ( 7%) 0fps Trem: 0min 12mb A-V:0.000 [0:0] A/Vms 0/15 D/B/S 0/2/0 Pos: 0.3s 10f ( 7%) 0fps Trem: 0min 13mb A-V:0.000 [0:0] A/Vms 0/15 D/B/S 0/2/0 <SNIP – NOTHING INTERESTING> Pos: 9.5s 240f (96%) 58fps Trem: 0min 33mb A-V:0.000 [28800:0] A/Vms 0/17 D/B/S 0/2/0 Pos: 9.6s 241f (96%) 58fps Trem: 0min 33mb A-V:0.000 [28800:0] A/Vms 0/17 D/B/S 0/2/0 Pos: 9.6s 242f (97%) 58fps Trem: 0min 33mb A-V:0.000 [28800:0] A/Vms 0/17 D/B/S 0/2/0 Pos: 9.6s 243f (97%) 58fps Trem: 0min 33mb A-V:0.000 [28800:0] A/Vms 0/17 D/B/S 0/2/0 Pos: 9.7s 244f (97%) 58fps Trem: 0min 33mb A-V:0.000 [28800:0] A/Vms 0/17 D/B/S 0/2/0 Pos: 9.7s 245f (98%) 58fps Trem: 0min 33mb A-V:0.000 [28800:0] A/Vms 0/17 D/B/S 0/2/0 Pos: 9.8s 246f (98%) 58fps Trem: 0min 33mb A-V:0.000 [28800:0] A/Vms 0/17 D/B/S 0/2/0 Pos: 9.8s 247f (98%) 58fps Trem: 0min 34mb A-V:0.000 [28800:0] A/Vms 0/17 D/B/S 0/2/0 Pos: 9.8s 248f (99%) 58fps Trem: 0min 34mb A-V:0.000 [28800:0] A/Vms 0/17 D/B/S 0/2/0 Pos: 9.9s 249f (99%) 58fps Trem: 0min 34mb A-V:0.000 [28800:0] A/Vms 0/17 D/B/S 0/2/0 Pos: 9.9s 250f (99%) 58fps Trem: 0min 34mb A-V:0.000 [28800:0] A/Vms 0/17 D/B/S 0/2/0 ds_fill_buffer: EOF reached (stream: video) Flushing video frames. Writing index... Video stream: 28800.000 kbit/s (3600000 B/s) size: 35712000 bytes 9.920 secs 250 frames Uninit video: ffmpeg WINSOCK2 uninit [mov @ 0x1b7c690]Codec for stream 0 does not use global headers but container format requires global headers
On Tuesday 23 June 2009 17:35:01 Mark Himsley wrote:
Hi mencoder experts. <snip> If I play that file in mplayer and step through the last few frames the last two frames are not displayed.
I convert that file BACK to a DV25 MOV with this command:
</SNIP>
But the last two frames cannot be seen in mplayer or QuickTime.
Hello, Mark, did you ever find a solution for this problem originally posted on the mencoder-user mailing list ? I stumbled on this post from searching in Google. I believe I have the same problem, from a slightly different situation: I have a number of PNG files which are visualization output of a computer simulations. So I know exactly how many files there are, and that there are visualization time stamped as part of the graphic in the file, which helps to identify the frames. I encode the files to H.264 using 2-pass encoding and put it into the mp4 container as follow (excuse the line wrapping): mencoder -ovc x264 -oac copy -x264encopts \ pass=1:turbo:bitrate=1000:bframes=1:me=umh:partitions=all \ :trellis=1:qp_step=4:qcomp=0.7:direct_pred=auto:keyint=300 \ mf://*.png -of rawvideo -o /dev/null mencoder -ovc x264 -oac copy -x264encopts \ pass=2:turbo:bitrate=1000:frameref=5:bframes=1:me=umh:partitions=all \ :trellis=1:qp_step=4:qcomp=0.7:direct_pred=auto:keyint=300 \ mf://${1} -of rawvideo -o output.264 MP4Box -add output.264 output.mp4 I step through the frames and found that last two frames are missing. Even with just 1-pass encoding, there are two frames that are missing. The output of those commands above says that I have the same number of frames as there are PNG files, but the last two just do not make it into the movie. This does not happen if I just encode it to MPEG-4, using the example in the manual: mencoder mf://*.png -mf w=800:h=600:fps=25:type=png -ovc lavc \ -lavcopts vcodec=mpeg4:mbd=2:trell -oac copy -o output.avi Any help is appreciated Thank you. RDB
On Mon, Jul 06, 2009 at 08:25:21PM -0400, Reuben Budiardja wrote:
On Tuesday 23 June 2009 17:35:01 Mark Himsley wrote:
Hi mencoder experts. <snip> If I play that file in mplayer and step through the last few frames the last two frames are not displayed.
I convert that file BACK to a DV25 MOV with this command:
</SNIP>
But the last two frames cannot be seen in mplayer or QuickTime.
Hello,
Mark, did you ever find a solution for this problem originally posted on the mencoder-user mailing list ?
No, not completely. I CAN get every frame if I encode with NO B-frames, that is - setting bframes=0 in your example. But that kind-of defeats the point of using h.264. If I encode with bframes=3 but without b_pyramid then I only loose one frame off the end of my test clip, instead of two. Interestingly, I get similar same results if I encode with ffmpeg into a .avi container except with one more frame, I mean bframes=3 with b_pyramid I loose one frame and bframes=3 without b_pyramid I loose NO frames. I need to make a full table to results and post it somewhere useful so that people more clever than I can say "oh, I know how to fix that" ;-)
I stumbled on this post from searching in Google. I believe I have the same problem, from a slightly different situation:
I have a number of PNG files which are visualization output of a computer simulations. So I know exactly how many files there are, and that there are visualization time stamped as part of the graphic in the file, which helps to identify the frames.
I encode the files to H.264 using 2-pass encoding and put it into the mp4 container as follow (excuse the line wrapping):
mencoder -ovc x264 -oac copy -x264encopts \ pass=1:turbo:bitrate=1000:bframes=1:me=umh:partitions=all \ :trellis=1:qp_step=4:qcomp=0.7:direct_pred=auto:keyint=300 \ mf://*.png -of rawvideo -o /dev/null
mencoder -ovc x264 -oac copy -x264encopts \ pass=2:turbo:bitrate=1000:frameref=5:bframes=1:me=umh:partitions=all \ :trellis=1:qp_step=4:qcomp=0.7:direct_pred=auto:keyint=300 \ mf://${1} -of rawvideo -o output.264
MP4Box -add output.264 output.mp4
I step through the frames and found that last two frames are missing. Even with just 1-pass encoding, there are two frames that are missing.
The output of those commands above says that I have the same number of frames as there are PNG files, but the last two just do not make it into the movie.
This does not happen if I just encode it to MPEG-4, using the example in the manual: mencoder mf://*.png -mf w=800:h=600:fps=25:type=png -ovc lavc \ -lavcopts vcodec=mpeg4:mbd=2:trell -oac copy -o output.avi
Any help is appreciated
Thank you. RDB
-- Mark Himsley
On Tue, Jul 07, 2009 at 11:50:45AM +0000, Mark Himsley wrote:
I need to make a full table to results and post it somewhere useful so that people more clever than I can say "oh, I know how to fix that" ;-)
Yes, use threads=1. This is a bug in libx264, when you call x264_encoder_encode with NULL as pic it is supposed to return the delayed frames, but with threads it at first returns nothing, making MPlayer think there are no more frames. Maybe using a newer x264 will help, mine is quite outdated... Attached patch fixes it, too (well, assuming you do not try to use more than 255 threads or so).
On Tue, Jul 07, 2009 at 02:59:11PM +0200, Reimar Döffinger wrote:
On Tue, Jul 07, 2009 at 11:50:45AM +0000, Mark Himsley wrote:
I need to make a full table to results and post it somewhere useful so that people more clever than I can say "oh, I know how to fix that" ;-)
Yes, use threads=1.
Interesting. Changing from threads=0 to threads=1 made no difference to my test results. I'm very bad^wlazy and am using the mencoder build from http://oss.netfarm.it/mplayer-win32.php This looses two frames off the end (sorry about the line length). @echo "PASS 1" mencoder -v -noskip -mc 0 -af channels=2 -vf harddup -ofps 25 -oac pcm -ovc x264 -x264encopts interlaced:pass=1:turbo=2:global_header:bitrate=4000:keyint=180:bframes=3:direct_pred=auto:frameref=1:me=umh:partitions=all:b_pyramid:threads=1 -passlogfile "Clock10.mov-004.avi.log" -o "Clock10.mov-004.avi" "..\Clock10.mov" > "Clock10.mov-004.avi-pass1.txt" 2>&1 @echo "PASS 2" mencoder -v -noskip -mc 0 -af channels=2 -vf harddup -ofps 25 -oac pcm -ovc x264 -x264encopts psnr:interlaced:pass=2:turbo=2:global_header:bitrate=4000:keyint=180:bframes=3:direct_pred=auto:frameref=6:me=umh:partitions=all:b_pyramid:threads=1 -passlogfile "Clock10.mov-004.avi.log" -o "Clock10.mov-004.avi" "..\Clock10.mov" > "Clock10.mov-004.avi-pass2.txt" 2>&1 echo "Back to DV 25" mencoder -v -noskip -mc 0 -af channels=2 -vf harddup -ofps 25 -oac pcm -ovc lavc -lavcopts vcodec=dvvideo -of lavf -lavfopts format=mov -o "Clock10.mov-004.avi-DV.mov" "Clock10.mov-004.avi" > "Clock10.mov-004.avi-DV.mov.txt" 2>&1 Remove b_pyramid from the above and I only loose one frame. I'll try to make the time to build my own mencoder and use your patch. -- Mark Himsley
participants (3)
-
Mark Himsley -
Reimar Döffinger -
Reuben Budiardja