0

I have a bunch of videos filmed on a Sony A7Rii that are upside down and need to be flipped 180. I'd like to do this lossless and been trying to use the following command:

ffmpeg -i input.mp4 -c copy -metadata:s:v:0 rotate=180 output.mp4

I understand this updates orientation information in the metadata of the video file, avoiding the need to reencode. However, it is generating an error relating to the audio codec:

[mp4 @ 000001db6a69cd80] Could not find tag for codec pcm_s16be in stream #1, codec not currently supported in container Could not write header for output file #0 (incorrect codec parameters ?): Invalid argument Stream mapping: Stream #0:0 -> #0:0 (copy) Stream #0:1 -> #0:1 (copy)

After some searching, I understand this is expected behaviour because the MP4 container isn't supposed to have audio encoded with that codec. Unfortunately for me, that is how the Sony A7Rii produces files.

What FFMPEG command will offer the best work-around? Ideally I'd not re-encode the audio, but that would be tolerable if there is no other way.

Thanks!

Jeffs
  • 11
  • 1
  • You can save it as mov, or re-encode to aac. – Gyan Jan 12 '20 at 05:46
  • Is there / do can you tell me the FFMPEG command that will do both the flip 180 and resave in mov container in a single action? thanks – Jeffs Jan 12 '20 at 11:50
  • Use your command but change output extension to mov – Gyan Jan 12 '20 at 14:29
  • Brilliant. Thank-you - that seemed to work. FFMPEG still showed the frames being processed, but it was fast i.e. it took about 60 seconds to process my 14gb video file. Presumably this is just the time it takes to copy the 14gb to the new file? – Jeffs Jan 12 '20 at 16:14
  • Yes, ffmpeg constructed a new file copying all data from input to output, along with the metadata change. ffmpeg does not ever edit input files in place. – Gyan Jan 12 '20 at 16:43

0 Answers0