1

I was able to rotate the movie with the following code

videoCompositionTrack.preferredTransform = CGAffineTransform(rotationAngle: CGFloat(M_PI_2))

I confirmed the information of the rotated video by ffmpeg. Rotate in the tag does not fluctuate as shown below, but a tag called side_data_list was generated and the value of rotation in side_data_list fluctuated, while keeping the information of rotate in tag unchanged.I want to change "tag" information.

"tags": {
                "rotate": "90"
        },
"side_data_list": [
                {
"rotation": -90
                }

Are there any good advice on AVFoundation and ffmpeg?

MGY
  • 7,245
  • 5
  • 41
  • 74
Ryosuke Hujisawa
  • 2,682
  • 1
  • 17
  • 18
  • Might be useful to tell us whether this is macOS or iOS. – matt Aug 15 '17 at 03:27
  • Also, see https://stackoverflow.com/questions/10480991/add-custom-metadata-to-video-using-avfoundation - unclear what all this has to do with ffmpeg, since you are apparently merely using it as a window into the metadata. – matt Aug 15 '17 at 03:28
  • this is iOS And This is all sources of my video rotation. https://github.com/Ryosuke-Hujisawa/Video-rotation-swift3 – Ryosuke Hujisawa Aug 15 '17 at 03:36
  • The command that confirmed the information about the outputted video is the following command. ffprobe -show_streams -print_format json rendered-audio.m4v 2>/dev/nul – Ryosuke Hujisawa Aug 15 '17 at 03:38
  • Right, but you didn't do that within iOS so it's kind of irrelevant; you stepped into another universe in order to see the metadata. :) I mean, you're not going to use ffmpeg to _set_ the tags, so this is not a question about ffmpeg at all; it's a question about how to set the tags. – matt Aug 15 '17 at 03:46

0 Answers0