Opened 12 years ago

Last modified 12 years ago

#1927 open defect

ffplay loop triggers image corruption with cut realvideo sample

Reported by: DonMoir Owned by:
Priority: normal Component: undetermined
Version: git-master Keywords: real
Cc: Blocked By:
Blocking: Reproduced by developer: yes
Analyzed by developer: no

Description (last modified by Carl Eugen Hoyos)

After the resolution changes in the attached file which is from ticket #1507, any attempt to seek to absolute zero will cause distortion. For the video stream, the first index entry timestamp is zero and the first_dts is zero. Any value greater than zero and it works. The reason for the distortion is because the packets contain the old resolution values, as does the AVFrame and AVCodecContext.

You can seek to zero fine before the resolution change.

The best way to show you the problem is to make ffplay loop. This is because using left arrow does not go back far enough in time to produce the problem and by allowing ffplay to loop it will seek to zero or to the very beginning of playback.

This is not an ffplay problem as I can reproduce it in my own code.

After the loop back to zero it will correct itself and get the resolution change about 6/7 seconds into playback.

ffplay -loop 10 Wrong_aspect_after_resolution_change.rmvb
ffplay version N-46469-gc995644 Copyright (c) 2003-2012 the FFmpeg developers
  built on Nov  5 2012 17:56:17 with gcc 4.7.2 (GCC)
  configuration: --disable-static --enable-shared --enable-gpl --enable-version3
 --disable-pthreads --enable-runtime-cpudetect --enable-avisynth --enable-bzlib
--enable-frei0r --enable-libass --enable-libopencore-amrnb --enable-libopencore-
amrwb --enable-libfreetype --enable-libgsm --enable-libmp3lame --enable-libnut -
-enable-libopenjpeg --enable-libopus --enable-librtmp --enable-libschroedinger -
-enable-libspeex --enable-libtheora --enable-libutvideo --enable-libvo-aacenc --
enable-libvo-amrwbenc --enable-libvorbis --enable-libvpx --enable-libx264 --enab
le-libxavs --enable-libxvid --enable-zlib
  libavutil      52.  5.100 / 52.  5.100
  libavcodec     54. 71.100 / 54. 71.100
  libavformat    54. 36.100 / 54. 36.100
  libavdevice    54.  3.100 / 54.  3.100
  libavfilter     3. 21.106 /  3. 21.106
  libswscale      2.  1.102 /  2.  1.102
  libswresample   0. 16.100 /  0. 16.100
  libpostproc    52.  1.100 / 52.  1.100
Input #0, rm, from 'Wrong_aspect_after_resolution_change.rmvb':
  Metadata:
    Audiences       : Easy RealMedia Tool's Audience;
    audioMode       : music
    Creation Date   : 3/22/2005 10:25:31
    Description     : +ú+++·+˜ú¦¦+-+¦¦+«¦¼+¦íó++-++·+¦+++Ñ-¬-°ú¼+÷¦¬+÷+-+¦-++¦+˜
-º
                    : -¦íó++-˜+«++íú¦+¦t+¦¦µ+¿¦T+¡¦t+¦¦½-+-·+-íú++¦++T+»+=+÷+-¦+
¦+¦½+¬¦
    Email           : rick@redcheek.net
    Generated By    : Easy RealMedia Tools V1.8
    HomeWeb         : http://redcheek.net
    Keywords        :
    Modification Date: 3/22/2005 10:25:31
    videoMode       : sharp
    File ID         : 545932b0-2885-caea-bdd7-d268c869a693
    title           : [YY]0419.¦++-+¦¦¦_¦¦¦·+t+¦+-+n-O-¦f(+-)- -++-¦8 +¦-([YY]¦ñ
+˜-- YYTvO+¦+˜
    author          : feng
    copyright       : YY@2005
    comment         :
  Duration: 00:43:16.92, start: 0.000000, bitrate: 7 kb/s
    Stream #0:0: Audio: cook (cook / 0x6B6F6F63), 44100 Hz, stereo, fltp, 44 kb/s
    Stream #0:1: Video: rv40 (RV40 / 0x30345652), yuv420p, 480x360, 391 kb/s, 23
 fps, 23 tbr, 1k tbn, 1k tbc
Frame changed from size:0x0 to size:480x360  97KB sq=    0B f=0/0
  15.74 A-V: -0.017 f[rv40 @ 0119d800] d= Changing dimensions to 480x288
  15.82 A-V: -0.021 fd=   7 aq=    1KB vq=   28KB sq=   Frame changed from size:
480x360 to size:480x288
  39.3[rv40 @ 0117dc20] 6 AFirst slice header is incorrectB f=0/0
[rv40 @ 0119d800] warning: first frame is no keyframe    0B f=0/0
   9.76 A-V: -0.004[rv40 @ 0119d800]  fdChanging dimensions to 480x360
   9.83 A-V: -0.008 fd=  60 aq=    1KB vq=   4Frame changed from size:480x288 to
 size:480x360
  12.34 A-V:  0.086 fd=  62 aq=    1KB vq=   17KB sq=    0B f=0/1

Attachments (3)

Wrong_aspect_after_resolution_change.rmvb (2.4 MB ) - added by DonMoir 12 years ago.
no_resolution_change.rm (925.0 KB ) - added by Carl Eugen Hoyos 12 years ago.
src_with_resolution_change_segment_cut.rm (1.4 MB ) - added by Carl Eugen Hoyos 12 years ago.

Change History (9)

comment:1 by DonMoir, 12 years ago

The fact that its a cut file does not seem to have anything to do with it. I can produce the problem after the resolution change and before it gets to the end in my own code.

I also cannot reproduce the problem in the other players I tested with.

Last edited 12 years ago by DonMoir (previous) (diff)

comment:2 by Carl Eugen Hoyos, 12 years ago

Description: modified (diff)
Keywords: real added
Reproduced by developer: set
Status: newopen
Summary: Seek bug in rv40 video after resolution changeffplay loop triggers image corruption with cut realvideo sample
Version: unspecifiedgit-master

comment:3 by DonMoir, 12 years ago

Again, it's not just an ffplay problem so the title change is misleading.

comment:4 by Carl Eugen Hoyos, 12 years ago

Also reproducible with a significantly shorter sample that contains no resolution change, never reproducible with seeking, neither with the sample from ticket #1507 nor with the cut sample without resolution change.

$ ffplay no_resolution_change.rm -loop 2 -autoexit
ffplay version N-46806-g83cab07 Copyright (c) 2003-2012 the FFmpeg developers
  built on Nov 16 2012 16:24:58 with gcc 4.7 (SUSE Linux)
  configuration: --enable-libx264 --enable-libvo-aacenc --enable-libfdk-aac --enable-libfaac --disable-indev=jack --enable-gpl --enable-version3 --enable-nonfree
  libavutil      52.  7.100 / 52.  7.100
  libavcodec     54. 72.100 / 54. 72.100
  libavformat    54. 36.100 / 54. 36.100
  libavdevice    54.  3.100 / 54.  3.100
  libavfilter     3. 23.100 /  3. 23.100
  libswscale      2.  1.102 /  2.  1.102
  libswresample   0. 16.100 /  0. 16.100
  libpostproc    52.  1.100 / 52.  1.100
loas_probe: p->buf_size: 2048, first_frames: 0, max_frames: 1
Input #0, rm, from 'no_resolution_change.rm':
  Metadata:
    Audiences       : Easy RealMedia Tool's Audience;
    audioMode       : music
    Creation Date   : 3/22/2005 10:25:31
    Description     : ???????????????????????????????????????????
                    : ????????á????????????????????????????????????ù????
    Email           : rick@redcheek.net
    Generated By    : Easy RealMedia Tools V1.8
    HomeWeb         : http://redcheek.net
    Keywords        :
    Modification Date: 3/22/2005 10:25:31
    videoMode       : sharp
    File ID         : 545932b0-2885-caea-bdd7-d268c869a693
    title           : [YY]0419.????_????????????-???(??)- ?????? ???[YY]?????? YYTvO???[0m
    author          : feng
    copyright       : YY@2005
    comment         :
  Duration: 00:43:16.92, start: 0.000000, bitrate: 2 kb/s
    Stream #0:0: Audio: cook (cook / 0x6B6F6F63), 44100 Hz, stereo, fltp, 44 kb/s
    Stream #0:1: Video: rv40 (RV40 / 0x30345652), yuv420p, 480x360, 391 kb/s, 23 fps, 23 tbr, 1k tbn, 1k tbc
Frame changed from size:0x0 to size:480x360
[rv40 @ 0x7f7dc403cbc0] First slice header is incorrect
[rv40 @ 0x7f7dc4074ae0] warning: first frame is no keyframe
  16.88 A-V:  0.000 fd=   2 aq=    0KB vq=    0KB sq=    0B f=0/0

Not reproducible if the last 25k are cut off (reproducible if the last 50k are cut).

Last edited 12 years ago by Carl Eugen Hoyos (previous) (diff)

by Carl Eugen Hoyos, 12 years ago

Attachment: no_resolution_change.rm added

by Carl Eugen Hoyos, 12 years ago

comment:5 by DonMoir, 12 years ago

Yes not reproducible unless there is a resolution change and also not related to looping as your title change would indicate. The loop thing is because its the only way to show you the problem using ffplay.

Version 0, edited 12 years ago by DonMoir (next)

comment:6 by Carl Eugen Hoyos, 12 years ago

I also attached a longer sample that does contain a resolution change but does not allow to reproduce the problem of image corruption on loop.

Note: See TracTickets for help on using tickets.