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 398875 - [ffdec_camtasia] requires "bits_per_sample" to be set or playback fails
[ffdec_camtasia] requires "bits_per_sample" to be set or playback fails
Status: RESOLVED FIXED
Product: GStreamer
Classification: Platform
Component: gst-libav
git master
Other All
: Normal normal
: 0.10.3
Assigned To: Tim-Philipp Müller
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2007-01-20 23:18 UTC by Martin Szulecki
Modified: 2007-01-22 10:28 UTC
See Also:
GNOME target: ---
GNOME version: 2.15/2.16


Attachments
Add depth to caps in camtasia codec (949 bytes, patch)
2007-01-20 23:23 UTC, Martin Szulecki
committed Details | Review

Description Martin Szulecki 2007-01-20 23:18:28 UTC
Please describe the problem:
Playback of a movie with the "Techsmith Camtasia video" codec using GStreamer fails with:

ERROR ffmpeg :0:: Camtasia error: unknown depth 0 bpp

It appears the caps don't set the AVCodecContext->bits_per_sample to the correct value which actually seems to be stored in the AVI (24bpp in this case).

Steps to reproduce:
---

GST_DEBUG="avi*:5,ffmpeg*:5" gst-launch gnomevfssrc location=http://videos.aircrack-ng.org/WEP_Cracking_with_Airoscript.avi ! avidemux ! ffdec_camtasia ! ffmpegcolorspace ! xvimagesink

---

Actual results:
You see the log ouput.

Expected results:
Video should play.

Does this happen every time?
Yes.

Other information:
I have a lack of overview thus unable to fully find the cause of the problem and fixing the issue completly.

All I know is that manually setting/enforcing the bits_per_sample makes it work:

--- ext/ffmpeg/gstffmpegcodecmap.c      11 Jan 2007 10:02:40 -0000      1.137
+++ ext/ffmpeg/gstffmpegcodecmap.c      20 Jan 2007 23:16:46 -0000
@@ -1571,11 +1577,14 @@
 
     case CODEC_ID_MSRLE:
     case CODEC_ID_QTRLE:
+    case CODEC_ID_TSCC:
     {
       gint depth;
 
       if (gst_structure_get_int (str, "depth", &depth))
         context->bits_per_sample = depth;
+
+      context->bits_per_sample = 24;
     }
       break;
Comment 1 Martin Szulecki 2007-01-20 23:23:11 UTC
Created attachment 80782 [details] [review]
Add depth to caps in camtasia codec

Partial patch for fixing the issue.
As noted before, it lacks the final fix to set the actual bits_per_sample on the AVCodecContext which the ffmpeg camtasia decoder requires.
Comment 2 Tim-Philipp Müller 2007-01-22 10:28:08 UTC
Thanks for the patch, committed:

 2007-01-22  Tim-Philipp Müller  <tim at centricular dot net>

        Patch by: Martin Szulecki  <gnomebugzilla at sukimashita com>

        * ext/ffmpeg/gstffmpegcodecmap.c: (gst_ffmpeg_codecid_to_caps),
        (gst_ffmpeg_caps_with_codecid):
          Need to set depth on context for camtasia decoder (fixes #398875).

but needs fixes in gst-plugins-base (libgstriff) as well:

 2007-01-22  Tim-Philipp Müller  <tim at centricular dot net>

        * gst-libs/gst/riff/riff-media.c: (gst_riff_create_video_caps):
          On second thought, use "depth" field rather than "bpp" field.

 2007-01-22  Tim-Philipp Müller  <tim at centricular dot net>

        * gst-libs/gst/riff/riff-media.c: (gst_riff_create_video_caps):
          Camtasia caps apparently need a bpp field (#398875).