0

I have a few .ts files which I've downloaded from the web that I want to chop up into smaller files. I'm using FFmpeg to do this, but each time, after about 3 minutes the video starts to fall behind and go out of sync with the audio.

I've been experimenting with async and vsync and have gotten this far...

ffmpeg -I test.ts -async 1 -c:v copy -channel_layout '5.1' -ss 01:00:12 -to 01:07:45 -y test.mp4

The result is a file where the audio and video and in sync, but every few seconds the audio jumps. I assume this is because the audio has been trimmed to align with the video stream?

Does anyone know how I could get the video to align to the audio? i.e. leave the audio as-is and shrink/stretch the video stream to keep aligned with the audio?

9
  • Is test.ts a directly downloaded file, or has it been modified before this command?
    – Gyan
    Commented Jul 26, 2021 at 5:12
  • Directly downloaded. I've tried recoding the whole file using both Handbrake and FFmpeg. Handbrake aligns the video and audio, but has similar sound blips as using async with FFmpeg. Recoding with FFmpeg doesn't seem to change anything. Commented Jul 26, 2021 at 10:40
  • It's as if the audio is running slightly quicker than the video. If I play the source file I can see the lag building up as time progresses, and after about 5 min it's completely out of sync. However, if I jump to (say) 10 minutes then it goes back in sync and slowly starts to fall out again. Commented Jul 26, 2021 at 10:57
  • I'm sure the problem is with the source file, but was hoping to find a way to re-sync the audio and video. Commented Jul 26, 2021 at 10:58
  • Which player?..
    – Gyan
    Commented Jul 27, 2021 at 4:21

0

You must log in to answer this question.

Browse other questions tagged .