On Sun, 1 Sep 2019 at 01:04, Micael Silva <[email protected]> wrote:
> On Thu, Aug 29, 2019 at 6:41 PM Alejandro Escudero < > [email protected]> wrote: > > > Hi! > > > > I am trying to cut a video file in to parts, without re-enconding the > > video, but i get a video file with non sync audio, how can I solve these > > with out re-encoding since I need a fast way to cut. > > > > I used this command: > > > > > > ffmpeg -i file.mp4 -ss 00:03:00 -t 00:05:00 -c copy part1.mp4 > > > > Thanks! > > > > > > Alejandro > > > > By my own experience I found that it usually happens because the cut falls > somewhat distant of the next keyframe of the video. The player tries to > play the video track but have to wait until the next keyframe but the audio > start to play immediately, resulting in loss of sync. > > Try to cut closeset to the keyframe. Unfortunally I had no recipe for that, > I fixed my cases on the try-and-error method. > _______________________________________________ > ffmpeg-user mailing list > [email protected] > https://ffmpeg.org/mailman/listinfo/ffmpeg-user > > To unsubscribe, visit link above, or email > [email protected] with subject "unsubscribe". to get the times of the keyframes you can use this command: ffprobe -show_frames <video_file_name.avi>|grep -B 14 pict_type=I|grep pkt_pts_time=|awk -F'=' '{print $2}'|xargs -I{} date -d@"{}" -u +%H:%M:%S.%N E _______________________________________________ ffmpeg-user mailing list [email protected] https://ffmpeg.org/mailman/listinfo/ffmpeg-user To unsubscribe, visit link above, or email [email protected] with subject "unsubscribe".
