Skip to content

Instantly share code, notes, and snippets.

@tothi
Last active May 15, 2019 08:37
Show Gist options
  • Save tothi/5dcfc2b7c4a3b927cbd9673ee266fc0f to your computer and use it in GitHub Desktop.
Save tothi/5dcfc2b7c4a3b927cbd9673ee266fc0f to your computer and use it in GitHub Desktop.
fix ip camera stream timestamp recorded with ffmpeg segment option
#!/bin/bash
IFS=$'\n' ; for s in `ls stream_*.asf | head -n -1` ; do
ffmpeg -i ${s} -y -c:v copy -an -bsf:v h264_mp4toannexb ${s%.asf}.h264
ffmpeg -r 25 -y -i ${s%.asf}.h264 -c copy ${s%.asf}.mp4 && touch -r ${s} ${s%.asf}.mp4 && rm ${s%.asf}.h264 $s
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment