Reputation: 28076
I am trying to re encode my h265 files from AAC to PCM audio for the ability to edit them in Davinci Resolve.
I originally used this for h264 files and replaced the codec with hevc_mp4toannexb out.h265
but with no luck!
## .sh script
#!/bin/bash
for f in *.mp4; \
do ffmpeg -i "$f" "${f/%mp4/wav}"; \
ffmpeg -i "$f" -vcodec copy -an -bsf:v hevc_mp4toannexb "${f/%mp4/m4v}"; \
ffmpeg -i "${f/%mp4/m4v}" -i "${f/%mp4/wav}" \
-acodec copy -vcodec copy "${f/%mp4/mov}"; \
rm "${f/%mp4/m4v}"; \
rm "${f/%mp4/wav}"; \
done
Upvotes: 0
Views: 1188
Reputation: 5463
You just need to re-encode the audio stream (I picked signed 16-bit, pcm_16le, but use an PCM codec of your choice). A single FFmpeg call should suffice. Something like this (I'm not familiar with sh script):
## .sh script
#!/bin/bash
for f in *.mp4; \
do ffmpeg -i "$f" -acodec pcm_16le -vcodec copy "${f/%mp4/mov}"; \
done
Upvotes: 1