I am using h264 for optimising MP4 for web. I have a video which has some supposedly corrupt frame(s) within it's initial 1-2 seconds. (Frame provided below)
On transcoding using :
ffmpeg -i orig.mp4 -c:v libx264 -crf 25 -vf scale="-2:min(ih\,720)" -b:v 600K -g 90 -c:a libfdk_aac output.mp4
The output MP4 has these frames dropped out and I have my output with it's start about 1 to 2 seconds delayed from original video, thus resulting in overall less time duration in output video.
Moreover, most media players also skip these frames in playback (like quicktime player, etc). But VLC media player was able to play this video without skipping these frames.
Is there a way to not drop frames using ffmpeg? And if possible is it possible to identify and fix these frames in a video?
Note: I tried encoding same video using AWS Elastic transcoder which actually fixed these frames (Frame provided below) :
Note: Original video can be found here - https://drive.google.com/file/d/0B9VkhR9Zu60ybXFDeno3RGpQTUE/view?usp=sharing Video transcoded by AWS Elsatic transcoder can be found here - https://drive.google.com/file/d/0B9VkhR9Zu60yWUVHQk5MTk05QVk/view?usp=sharing
EDIT1: As suggested by @Mulvya in comments, TS-transcoded video can be found here - ( https://drive.google.com/file/d/0B9VkhR9Zu60yU0t6T0dMME9ZMmc/view?usp=sharing )
Your source video has some frames without timestamps.
In this particular case, extracting to raw bitstream and then transcoding works:
ffmpeg -i orig.mp4 -c copy orig.264
ffmpeg -i orig.264 -i orig.mp4 -map 0 -map 1:a -c:v libx264 -crf 25 -vf scale="-2:min(ih\,720)" -b:v 600K -g 90 -c:a libfdk_aac output.mp4
ffmpeg -i VID_1550287359485.mp4 -vcodec copy -an -bsf:v h264_mp4toannexb raw2.h264
ffmpeg -framerate 24 -i raw2.h264 -c copy output-a.mp4
ffmpeg -i VID_1550287359485.mp4 -b:a 192K -vn music2.mp3
ffprobe -i music2.mp3 -show_entries format=duration -v quiet -print_format json
ffprobe -i output-a.mp4 -show_entries format=duration -v quiet -print_format json
ffmpeg -i music2.mp3 -filter:a atempo="0.827415438" new-latest2.mp3
ffmpeg -i output-a.mp4 -vf "transpose=2" output-new.mp4
ffmpeg -i output-new.mp4 -i new-latest2.mp3 -c:v libx264 -c:a aac -strict experimental -shortest output-second.mp4
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.