After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 593647 - ffdec_flashsv doesn't work
ffdec_flashsv doesn't work
Status: RESOLVED FIXED
Product: GStreamer
Classification: Platform
Component: gst-libav
git master
Other Linux
: Normal normal
: 0.10.10
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2009-08-31 10:28 UTC by Benjamin Otte (Company)
Modified: 2010-01-16 16:26 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
example video (165.93 KB, application/octet-stream)
2009-08-31 10:28 UTC, Benjamin Otte (Company)
  Details
Patch to preserve unchanged blocks for flashsv decoder (3.56 KB, patch)
2009-09-08 08:23 UTC, Jarkko Palviainen
rejected Details | Review

Description Benjamin Otte (Company) 2009-08-31 10:28:45 UTC
Created attachment 142116 [details]
example video

Playing back Screen video is broken. The decoder seems to replace the previous
picture to an all black image when decoding a new picture.
It works in mplayer.

An example video is attached.
Comment 1 Jarkko Palviainen 2009-09-07 06:42:12 UTC
Confirming. Mplayer even works when using the same ffmpeg/avcodec libraries as gst-ffmpeg in git.

Here's a snippet from libavcodec/flashsv.c for the bitstream description of Flash Screen Video decoder:

"Directly after the header are the compressed blocks. The blocks
have their compressed size represented with 16bits in the beginnig.
If the size = 0 then the block is unchanged from the previous frame.
All blocks are decompressed until the buffer is consumed."

This points out that previous frame should be preserved (and the codec implementation is not doing that for us). On the other hand, the gst plugin seems to only allocate an empty buffer for the next frame. The example video is a desktop recording, which contains a lot of unchanged regions, thus major parts of the frames show as black. 

I already wrote a quick hack to fix this, but it needs some checking to avoid breaking stuff elsewhere, since the gst plugin handles all codecs in one place.
Comment 2 Jarkko Palviainen 2009-09-08 08:23:59 UTC
Created attachment 142679 [details] [review]
Patch to preserve unchanged blocks for flashsv decoder
Comment 3 Benjamin Otte (Company) 2009-09-08 08:56:36 UTC
Wouldn't it be far better to check what the idea of the ffmpeg API is? Should buffers be kept around?

If so, ffdec should keep the buffer around for all plugins. There might be other plugins that require this behavior where we haven't found out yet.

If not, someone should fix ffmpeg's flashsv decoder instead of adding hacks to ffdec that make it even more incomprehensible.
Comment 4 Jarkko Palviainen 2009-09-09 08:01:08 UTC
I didn't find any way to handle it when using flashsv. But, I had a chat with the friendly developers at #ffmpeg-devel over this matter. The current implementation in flashsv does not support preserving the unchanged data, so I was asked to file a bug: 
https://roundup.ffmpeg.org/roundup/ffmpeg/issue1367

Let's see if it can be fixed there. Meanwhile, feel free to ignore the ffmpegdec patch.
Comment 5 Sebastian Dröge (slomo) 2009-09-09 13:22:04 UTC
Looks like this will be fixed in ffmpeg. I'm closing this bug as NOTGNOME now.

Baptiste Coudurier wrote:
> Baptiste Coudurier <baptiste.coudurier@gmail.com> added the comment:
>
> On 09/09/2009 12:57 AM, Jarkko Palviainen wrote:
>   
>> New submission from Jarkko Palviainen<jarkko.palviainen@sesca.com>:
>>
>> flashsv/libavcodec should keep the previous frame in case the current
>> contains unchanged blocks, so that application side does not have to
>> handle it explicitly. Otherwise it may lead to video output containing
>> black regions.
>>     
>
> Looks like reget_buffer should be used.
Comment 6 Jarkko Palviainen 2009-09-11 10:41:46 UTC
It's now fixed in ffmpeg side (r19814). AFAIK, this still requires implementing reget_buffer() in gstffmpegdec.
Comment 7 Sebastian Dröge (slomo) 2010-01-16 16:26:42 UTC
Fixed now by importing a newer ffmpeg snapshot.

commit eaac8503c0885924496d999e2f5377909522eb23
Author: Edward Hervey <bilboed@bilboed.com>
Date:   Wed Jan 6 11:53:01 2010 +0100

    ffmpegrev: Bump to ffmpeg r21150 from Jan 11th 2010