[FFmpeg-trac] #6616(avcodec:new): Decoded frames contain information about previous encoded frame

FFmpeg trac at avcodec.org
Mon Aug 28 20:50:23 EEST 2017

#6616: Decoded frames contain information about previous encoded frame
             Reporter:  rubensanchez  |                    Owner:
                 Type:  defect        |                   Status:  new
             Priority:  normal        |                Component:  avcodec
              Version:  git-master    |               Resolution:
             Keywords:                |               Blocked By:
             Blocking:                |  Reproduced by developer:  0
Analyzed by developer:  0             |

Comment (by rubensanchez):

 Replying to [comment:4 heleppkes]:
 > Replying to [comment:3 rubensanchez]:
 > > Replying to [comment:2 Cigaes]:
 > > > It looks like you are modifying the frame data returned by the
 decoder, are you not?
 > >
 > > Yes, the application must modify the decoded frames in order to apply
 an overlay image.
 > Well, there is your problem then. Frames are not guaranteed to be
 writeable, because they can still be used as reference frames by the
 decoder - which results in what you are seeing here.
 > If you need to write to a frame, you can use "av_frame_make_writable",
 which will copy the data if the frame is read-only, so you don't mess with
 the reference frame.

 Great! You were right. I ended up creating a copy of the decoded frame and
 modifying this copy instead the original one. With this approach, the
 problem is solved.

 Then this ticket must be closed as it is not a bug.

Ticket URL: <https://trac.ffmpeg.org/ticket/6616#comment:5>
FFmpeg <https://ffmpeg.org>
FFmpeg issue tracker

More information about the FFmpeg-trac mailing list