GNOME Bugzilla – Bug 600043
subparse: fails to recognise Cyrillic subtitles in windows-1251 encoding
Last modified: 2011-06-15 17:42:16 UTC
Debian GNU/Linux 2.6.30-2-amd64 testing (squeeze); LANG=C and all others I'm load a "movie.avi" (automatically load subtitle is checked in preferences; font: DejaVu Sans Bold; encoding: windows-1251). Subtitle file is a "movie.sub" or "movie.srt". Console error is: ** Message: don't know how to handle application/x-subrip. Main menu: View / Subtitles -> Empty. I'm load a subtitle manually and but same error appears. I'm converted a subtitle file to UTF-8, change preferences and all OK! This error my be related to last upgrade of "libtotem-plparser12 (2.28.1-1) to 2.28.1-2" and my be this is a Debian bug.
Sorry but I'm checked wrong version of totem (2.28.x -> 2.26x): totem-common and totem-gstreamer is a 2.26.3
This means that GStreamer can't handle subrip files, or misdetects it. Can you please attach the subtitle in question here?
Created attachment 146514 [details] Subtitle (encoding: Windows-1251)
> ** Message: don't know how to handle application/x-subrip Is that really what is says? Not application/x-subtitle? What does $ gst-typefind-0.10 /path/to/foo.sub show? Does $ gst-launch-0.10 filesrc location=foo.sub ! subparse subtitle-encoding='WINDOWS-1251' ! fdsink work?
$ gst-typefind-0.10 /data/downloads/<...>/movie.sub /data/downloads/.../movie.sub - audio/mpeg, framed=(boolean)false, mpegversion=(int)4 $ gst-launch-0.10 filesrc location=movie.sub ! subparse Setting pipeline to PAUSED ... Pipeline is PREROLLED ... Setting pipeline to PLAYING ... New clock: GstSystemClock ERROR: from element /GstPipeline:pipeline0/GstFileSrc:filesrc0: Internal data flow error. Additional debug info: gstbasesrc.c(2378): gst_base_src_loop (): /GstPipeline:pipeline0/GstFileSrc:filesrc0: streaming task paused, reason not-linked (-1) Execution ended after 490228 ns. Setting pipeline to PAUSED ... Setting pipeline to READY ... Setting pipeline to NULL ... Freeing pipeline ...
Ooops... I'm missing second line. $ gst-launch-0.10 filesrc location=movie.sub ! subparse subtitle-encoding='WINDOWS-1251' ! fdsink ... <subtitle file> �������� ������.</span><span>���������� ������������������, ����������.</span><span>������ �������� ���������������� ���� ���� ����������?</span><span>���� ���� ���� ���� ����������������.</span><span>���������� ���� ����?</span><span>���� ���� ���������� ����������, ����������.</span><span>������ ���� ����?</span><span>���� ������ ��������������.</span><span>������������ ���� ���������� ��������.</span><span>������������ ���� �������������������� ���� ������.</span><span>���� ���� �������������� ���� ������ ����?</span><span>�������� ���� ���� ���� ������������������</span> <span>���� ���������� ����������������������.</span><span>���� ����-- �����������������</span>Got EOS from element "pipeline0". Execution ended after 416957554 ns. Setting pipeline to PAUSED ... Setting pipeline to READY ... Setting pipeline to NULL ... Freeing pipeline ...
I'm change preference in totem to Windows-1251 and load manually utf-8 variant of subtitles -> scrambled subtitles (normal). Load again manually cp1251 variant of subtitle file and no subtitles on movie.
$ locale -a C POSIX bg_BG.utf8 en_US.utf8 $ locale LANG=C LC_CTYPE="C" LC_NUMERIC="C" LC_TIME="C" LC_COLLATE="C" LC_MONETARY="C" LC_MESSAGES="C" LC_PAPER="C" LC_NAME="C" LC_ADDRESS="C" LC_TELEPHONE="C" LC_MEASUREMENT="C" LC_IDENTIFICATION="C" LC_ALL= $ export LANG=en_US.utf8 $ totem and all OK with cyrillic subtitles.
$ export LANG=C $ gst-typefind-0.10 movie.sub movie.sub - audio/mpeg, framed=(boolean)false, mpegversion=(int)4 $ export LANG=en_US.utf8 $ gst-typefind-0.10 movie.sub movie.sub - application/x-subtitle
John Saturday: Please do not set the GNOME target field. Thanks.
commit c867f677c0813c3dfe8a204c3bd339837d42a167 Author: Sebastian Dröge <sebastian.droege@collabora.co.uk> Date: Mon May 23 16:02:34 2011 +0200 subparse: Try to typefind even if conversion to UTF8 failed Fixes bug #600043. commit 3dc49871383cbf7f8ac2e07dcb583591668fbe57 Author: Sebastian Dröge <sebastian.droege@collabora.co.uk> Date: Mon May 23 15:51:14 2011 +0200 subparse: Interprete typefind strings passed to GRegex as raw bytes instead