Getting timestamp of each frame in a video

You want cv2.CAP_PROP_POS_MSEC. See all the different capture properties here. Edit: Actually, as Dan Mašek pointed out to me, when you grab that property, it looks like OpenCV is exactly doing that calculation (at least assuming you’re using FFMPEG): case CV_FFMPEG_CAP_PROP_POS_MSEC: return 1000.0*(double)frame_number/get_fps(); So it seems you’re always going to rely on a constant frame … Read more

Re-sampling H264 video to reduce frame rate while maintaining high image quality

A lot has changed since this posting in 2012. I am adding this answer for people like me who find this from the search engines. I had good luck with the following: ffmpeg -y -i source.mp4 -r 25 -s 160×90 -c:v libx264 -b:v 3M -strict -2 -movflags faststart destination.mp4 Here’s a short explanation on what … Read more

FFmpeg concat video and audio out of sync

This two step process should work Step 1 Pad out the audio in each segment ffmpeg -i segment1.mov -af apad -c:v copy <audio encoding params> -shortest -avoid_negative_ts make_zero -fflags +genpts padded1.mov Or Generate segments with synced streams ffmpeg -y -ss 00:00:02.750 -i input.MOV -c copy -t 00:00:05.880 -avoid_negative_ts make_zero -fflags +genpts segment.MOV Step 2 Concat … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)