I'm using a real simple python script to capture a video file to a file, taken from the "simple recipes" guide :
import picamera
camera = picamera.PiCamera()
camera.resolution = (640, 480)
camera.start_recording('my_video.h264')
camera.wait_recording(30)
camera.stop_recording()
When I play 'my_video.h264' with vlc or omxplayer, the video speed is slowed, so the video last 35 seconds instead of the 30 expected.
Converting the video to AVI with ffmpeg
ffmpeg -i test.h264 -c:v copy -f avi test.avi
or to mp4 with MP4Box :
MP4Box -add test.h264 test.mp4
don't solve anything, video is still slow and last 35 seconds.
Here is the informations I gathered about the video files :
ffprobe -i test.h264
:
Duration: N/A, bitrate: N/A Stream #0:0: Video: h264 (High), yuv420p(progressive), 640x480, 25 fps, 25 tbr, 1200k tbn, 50 tbc
ffprobe -i test.avi
:
Duration: 00:00:35.76, start: 0.000000, bitrate: 685 kb/s Stream #0:0: Video: h264 (High) (H264 / 0x34363248), yuv420p(progressive), 640x480, 675 kb/s, 50 fps, 25 tbr, 50 tbn, 100 tbc
ffprobe -i test.mp4
:
Duration: 00:00:35.76, start: 0.000000, bitrate: 675 kb/s Stream 0:0(und): Video: h264 (High) (avc1 / 0x31637661), yuv420p, 640x480, 674 k b/s, 25 fps, 25 tbr, 25k tbn, 50k tbc (default)
Am I missing something obvious ?
Note : raspivid is capturing without this problem.