Opened 4 years ago

Closed 4 years ago

Last modified 4 years ago

#5198 closed defect (invalid)

FFmpeg flips rawvideo vertically with -vcodec copy

Reported by: JasonC Owned by:
Priority: normal Component: undetermined
Version: unspecified Keywords:
Cc: Blocked By:
Blocking: Reproduced by developer: no
Analyzed by developer: no

Description

Log file attached.

When attempting to trim a video (rawvideo, avi) to a certain length of time using -vcodec copy, the output video is vertically flipped (verified with mplayer, VLC, Windows Media Player, and the Quicktime player):

ffmpeg -i input.avi -t 120 -vcodec copy -f avi output.avi

A workaround is to use -vcodec rawvideo instead of copy to re-encode the video. Doing this, the output is not flipped:

ffmpeg -i input.avi -t 120 -vcodec rawvideo -f avi output.avi

Note that running the flipped video through one more time with -vcodec copy does not continue flipping it, the video remains upside down (I make this comment because I read https://ffmpeg.org/pipermail/ffmpeg-devel/2007-July/029690.html):

ffmpeg -i input.avi -t 120 -vcodec copy -f avi output.avi
ffmpeg -i output.avi -vcodec copy -f avi output-still-flipped.avi

Attachments (2)

ffmpeg-20160126-214715.log (5.5 KB) - added by JasonC 4 years ago.
Output of -report
testvideos.zip (63.0 KB) - added by JasonC 4 years ago.
Contains an example input video, and example output videos after both -vcodec copy (problem) and -vcodec rawvideo (workaround).

Download all attachments as: .zip

Change History (16)

Changed 4 years ago by JasonC

Output of -report

comment:1 Changed 4 years ago by JasonC

  • Component changed from undetermined to ffmpeg

comment:2 follow-ups: Changed 4 years ago by cehoyos

Please provide cuatro.avi - how was it created?

comment:3 Changed 4 years ago by cehoyos

  • Component changed from ffmpeg to undetermined

comment:4 in reply to: ↑ 2 Changed 4 years ago by JasonC

Replying to cehoyos:

Please provide cuatro.avi - how was it created?

It was created through the Windows' VFW API. I cannot provide that video, but will prepare another short sample as soon as I can, which may be a day or two.

Changed 4 years ago by JasonC

Contains an example input video, and example output videos after both -vcodec copy (problem) and -vcodec rawvideo (workaround).

comment:5 in reply to: ↑ 2 Changed 4 years ago by JasonC

Replying to cehoyos:

Please provide cuatro.avi - how was it created?

I had some time. I've added an attachment:

test.avi - A test input video.
test-vcodec-copy.avi - Result of "-i test.avi -vcodec copy"; this video is flipped.
test-vcodec-rawvideo.avi - Result of "-i test.avi -vcodec rawvideo"; this is the workaround.

comment:6 Changed 4 years ago by JasonC

In a hex editor, the output of "-vcodec copy" contains the string "BottomUp?" (no question mark; trac is making that a wiki link and I don't know how to stop it) in the header, while neither the original video nor the output of "-vcodec rawvideo" contain this string.

Last edited 4 years ago by JasonC (previous) (diff)

comment:7 follow-up: Changed 4 years ago by cehoyos

  • Resolution set to invalid
  • Status changed from new to closed
ffmpeg version N-60106-ge6d1c66 Copyright (c) 2000-2014 the FFmpeg developers

Please test current FFmpeg git head before reporting issues here.

comment:8 in reply to: ↑ 7 ; follow-up: Changed 4 years ago by JasonC

Replying to cehoyos:

ffmpeg version N-60106-ge6d1c66 Copyright (c) 2000-2014 the FFmpeg developers

Please test current FFmpeg git head before reporting issues here.

Are you saying that the issue has been resolved in the current version?

Why did you ask me to go to the trouble of generating test videos in the first place?

Last edited 4 years ago by JasonC (previous) (diff)

comment:9 in reply to: ↑ 8 ; follow-up: Changed 4 years ago by cehoyos

Replying to JasonC:

Why did you ask me to go to the trouble of generating test videos in the first place?

Several reasons: I couldn't guess that you chose to ignore the first paragraph of https://ffmpeg.org/bugreports.html and since you reported the bug including a command line I was under the impression that uploading the sample would be no effort.

In any case I reserve the right to not see every bug in a bug report immediately, I only reported the (at the time) most obvious one.

comment:10 in reply to: ↑ 9 ; follow-up: Changed 4 years ago by JasonC

Replying to cehoyos:

Replying to JasonC:

Why did you ask me to go to the trouble of generating test videos in the first place?

Several reasons: I couldn't guess that you chose to ignore the first paragraph of https://ffmpeg.org/bugreports.html and since you reported the bug including a command line I was under the impression that uploading the sample would be no effort.

I did choose to ignore it, but only because I don't know how to do what you request. I don't know how to build the latest head revision on Windows, sorry. I'm not even sure where the version I have right now came from.

I reserve the right to not know how to do everything and to sometimes file a less-than-ideal bug report.

Last edited 4 years ago by JasonC (previous) (diff)

comment:11 in reply to: ↑ 10 ; follow-up: Changed 4 years ago by llogan

Replying to JasonC:

I don't know how to build the latest head revision on Windows, sorry.

Getting a build from Zeranoe will generally suffice:
http://ffmpeg.zeranoe.com/builds/

comment:12 in reply to: ↑ 11 Changed 4 years ago by JasonC

Replying to llogan:

Replying to JasonC:

I don't know how to build the latest head revision on Windows, sorry.

Getting a build from Zeranoe will generally suffice:
http://ffmpeg.zeranoe.com/builds/

Oh great!

I've downloaded the latest build from there:

ffmpeg version N-78067-g9079e99 Copyright (c) 2000-2016 the FFmpeg developers
built with gcc 5.2.0 (GCC)
configuration: --enable-gpl --enable-version3 --disable-w32threads --enable-avisynth --enable-bzlib --enable-fontconfig
--enable-frei0r --enable-gnutls --enable-iconv --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --en
able-libdcadec --enable-libfreetype --enable-libgme --enable-libgsm --enable-libilbc --enable-libmodplug --enable-libmp3
lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-libopus --enable-librtmp --enab
le-libschroedinger --enable-libsoxr --enable-libspeex --enable-libtheora --enable-libtwolame --enable-libvidstab --enabl
e-libvo-aacenc --enable-libvo-amrwbenc --enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libwebp --enable-
libx264 --enable-libx265 --enable-libxavs --enable-libxvid --enable-libzimg --enable-lzma --enable-decklink --enable-zli
b
libavutil      55. 15.100 / 55. 15.100
libavcodec     57. 22.102 / 57. 22.102
libavformat    57. 23.100 / 57. 23.100
libavdevice    57.  0.100 / 57.  0.100
libavfilter     6. 27.100 /  6. 27.100
libswscale      4.  0.100 /  4.  0.100
libswresample   2.  0.101 /  2.  0.101
libpostproc    54.  0.100 / 54.  0.100

And tested it with my test videos and the problem is indeed resolved in this version. Everything is working properly now.

Thanks!!

comment:13 Changed 4 years ago by JasonC

  • Resolution changed from invalid to fixed

comment:14 Changed 4 years ago by cehoyos

  • Resolution changed from fixed to invalid
Note: See TracTickets for help on using tickets.