user21224: I have 2 similar videos created on the same mobile. The first one can be downloaded here.
If I'm using the following command the result is correctly rotated by 90 degrees:
ffmpeg -i 20180114_193135.mp4 -vf "transpose=clock" -r 30 -acodec copy 20180114_193135_2.mp4

But if I'm using the same command for the second video it is rotated by 180 degrees instead 90:
ffmpeg -i 20180115_111730.mp4 -vf "transpose=clock" -r 30 -acodec copy 20180115_111730_2.mp4

Can somebody explain, why? I can not rotate the second video with ffmpeg.

user1871: FFmpeg, by default, autorotates videos if a rotation tag is detected. The output video will be oriented upright and have no rotation tag. During processing, this step happens before any filtering is done.
So, in this case, you can simply run
ffmpeg -i 20180115_111730.mp4 -r 30 -acodec copy 20180115_111730_2.mp4

Alternatively, to perform manual rotation, you can suppress auto-rotation
ffmpeg -noautorotate -i 20180115_111730.mp4 -vf "transpose=clock" -r 30 -acodec copy 20180115_111730_2.mp4


21224: <p>I have 2 similar videos created on the same mobile. The first one can be downloaded <a href="https://drive.google.com/open?id=1vppsp6GUObZ5Tdt_UZkVkTZROu1m2rQH" rel="nofollow noreferrer" title="here">here</a>.
If I'm using the following command the result is correctly rotated by 90 degrees:</p>

<pre><code>ffmpeg -i 20180114_193135.mp4 -vf "transpose=clock" -r 30 -acodec copy 20180114_193135_2.mp4
</code></pre>

<p>But if I'm using the same command for the <a href="https://drive.google.com/open?id=1ClNlsDPYvkPKXuqY_qsm9u2HAOOBLfww" rel="nofollow noreferrer">second video</a> it is rotated by 180 degrees instead 90:</p>

<pre><code>ffmpeg -i 20180115_111730.mp4 -vf "transpose=clock" -r 30 -acodec copy 20180115_111730_2.mp4
</code></pre>

<p>Can somebody explain, why? I can not rotate the second video with ffmpeg.</p>
 1871: <p>FFmpeg, by default, autorotates videos if a rotation tag is detected. The output video will be oriented upright and have no rotation tag. During processing, this step happens before any filtering is done.</p>

<p>So, in this case, you can simply run</p>

<pre><code>ffmpeg -i 20180115_111730.mp4 -r 30 -acodec copy 20180115_111730_2.mp4
</code></pre>

<p>Alternatively, to perform manual rotation, you can suppress auto-rotation</p>

<pre><code>ffmpeg -noautorotate -i 20180115_111730.mp4 -vf "transpose=clock" -r 30 -acodec copy 20180115_111730_2.mp4
</code></pre>
