Hey all, I am currently trying to encode a YUV420P video stream to H264 using libavcodec with x264 and store it in an mp4 container using libavformat. I hacked following example:
http://ffmpeg.org/doxygen/0.5/output__example_8c-source.html#l00042 I am able to encode and store video in divX (amongst other) format without any issues. I encode and store 150 frames (5secs) @ 30fps. I play the files using mplayer and VLC and they work just fine. However, whenever I attempt to encode the video stream in H264 and write it to an mp4 container, the resulting file stores the video at double the desired frame rate and drops frames. Following is the output of mplayer playing the corrupt file: MPlayer 1.0rc2-4.2.3 (C) 2000-2007 MPlayer Team CPU: Intel(R) Xeon(R) CPU E5430 @ 2.66GHz (Family: 6, Model: 23, Stepping: 6) CPUflags: MMX: 1 MMX2: 1 3DNow: 0 3DNow2: 0 SSE: 1 SSE2: 1 Compiled with runtime CPU detection. mplayer: could not connect to socket mplayer: No such file or directory Failed to open LIRC support. You will not be able to use your remote control. Playing recording1.mp4. H264-ES file format detected. FPS seems to be: 60.000000 xscreensaver_disable: Could not find XScreenSaver window. ========================================================================== Opening video decoder: [ffmpeg] FFmpeg's libavcodec codec family Selected video codec: [ffh264] vfm: ffmpeg (FFmpeg H.264) ========================================================================== Audio: no sound Starting playback... VDec: vo config request - 1280 x 720 (preferred colorspace: Planar YV12) VDec: using Planar YV12 as output csp (no 0) Movie-Aspect is undefined - no prescaling applied. VO: [xv] 1280x720 => 1280x720 Planar YV12 V: 0.0 109/109 10% 1% 0.0% 0 0 As we can see only a 109 frames get encoded and stored. The quality of the video is not very great either. VLC fails to play the video with the following error message: Pop-up msg: Unrecognized format for 'recording1.mp4' VLC media player 0.8.6e Janus starting VLC root wrapper... using UID 0 (root) *************************************** * Running VLC as root is discouraged. * *************************************** It is potentially dangerous, and might not even work properly. [mp3 @ 0x7fb836f36160]Could not find codec parameters (Audio: mp1, 64 kb/s) [00000310] ffmpeg demuxer error: av_find_stream_info failed [00000310] ps demuxer error: cannot peek [00000298] main input error: no suitable demux module for `/://recording1.mp4' [00000289] main playlist: nothing to play [00000289] main playlist: stopping playback For some reason VLC can't determine that there is no audio encoded which leads me to believe that the file is corrupted. I've tried to google solutions but did not find much information. It would be great if someone could shed some light on this situation. Thanks, Naveed _______________________________________________ libav-user mailing list [email protected] https://lists.mplayerhq.hu/mailman/listinfo/libav-user
