-1

I have a bunch of .dav files in a directory, need to convert all the files in the directory to .mp4 format. I'm on Linux btw, so looking for a commandline option preferably

Mark Rotteveel
  • 82,132
  • 136
  • 114
  • 158
pgp
  • 1
  • 3

1 Answers1

0

After a bunch of digging, found the solution I was looking for. Bash is your friend :)

cd to the directory:

for i in `ll|awk '{print $9}'|cut -d '.' -f1`;do ffmpeg -y -i $i.dav -vcodec libx264 -crf 24 -filter:v "setpts=1*PTS" $i.mp4; done

Reference to the ffmpeg solution: here

pgp
  • 1
  • 3
  • No need for `-filter:v "setpts=1*PTS"`: it is doing nothing. [Avoid using `ls` to provide file names](https://github.com/koalaman/shellcheck/wiki/SC2045). You can just do this: `for i in *.dav; do ffmpeg -i "$i" "${i%.*}.mp4"; done` adapted from [How do you convert an entire directory with ffmpeg?](https://stackoverflow.com/a/33766147/1109017) – llogan Dec 06 '19 at 19:29
  • okay much better, thank you – pgp Dec 07 '19 at 12:28