(almost) success with Sony Bravia KDL-32W5500

3 messages Options
Embed this post
Permalink
Alexander E. Patrakov

(almost) success with Sony Bravia KDL-32W5500

Reply Threaded More More options
Print post
Permalink
Hi,

I have a Sony Bravia KDL-32W5500 TV set and want to use it to watch
films stored on my computer. For this purpose, I installed Coherence
(SVN r1407).

The documentation for my TV says that supported formats are: AVCHD, HDV,
MPEG2-PS. I know nothing about AVCHD or HDV, and MPEG-2 files straight
from a DVD play fine without transcoding. So, I tried to use the
transcoding feature of Coherence to play other files. It didn't work out
of the box, because it produces MPEG-TS. So, as a quick hack, I changed
the gstreamer pipeline in the MP2TSTranscoder class as follows:

self.pipeline = gst.parse_launch(
            "mplex format=3 vbr=true mux-bitrate=15360 bufsize=1024
name=mux %s ! decodebin2 name=d ! ffmpegcolorspace ! mpeg2enc format=3
bitrate=10000 constraints=false bufsize=1024 reduction-4x4=4
reduction-2x2=4 ! mux. d. ! queue ! audioconvert ! twolame ! mux."  %
self.uri)

The intention is to have a high-bitrate MPEG2-PS stream with the fastest
encoding options. Note that I had to remove the queue between twolame
and mux because otherwise it doesn't want to play. I also removed
several other redundant queues. "constraints=false" is needed for HDTV
resolutions (although the aspect ratio becomes wrong for 2.35:1 content
encoded as 1280x544). bufsize has to be increased from the default value
for the same reason (HDTV). "mplex" is needed, because "ffmux_mpeg"
produces streams that are playable only by ffmpeg-based players.

Still, there are some problems:

1) Coherence uses 100% CPU when doing nothing, and over 180% when
playing any clip (even SD). Looks like a busy-wait somewhere.
2) Audio and video sometimes get out of sync after skips.
3) If I stop and restart Coherence, it will appear as a different server
in the menu of my TV. Very annoying, given that the TV remembers all
previously seen servers and has a limit of 10-or so menu entries, after
which it refuses to recognize new servers.
4) I cannot seek in the transcoded streams.
5) It would be nice to avoid reencoding the file when it is sufficient
to remux it (e.g., H.264 + AC3 in MKV => AVCHD, but note that I don't
know where to get an AVCHD sample for testing if this would work and
could not produce a working sample myself with ffmpeg).

Unrelated to video:

6) Coherence doesn't list ape files in the TV menu, even though other
gstreamer-based applications can decode them to wav.

Are there any plans to fix these issues? Any patches for me to try?

--
Alexander E. Patrakov
_______________________________________________
coherence-dev mailing list
[hidden email]
http://lists.beebits.net/cgi-bin/mailman/listinfo/coherence-dev
Frank Scholz

Re: (almost) success with Sony Bravia KDL-32W5500

Reply Threaded More More options
Print post
Permalink
Hi Alexander

some quick answers:

> self.pipeline = gst.parse_launch(
>             "mplex format=3 vbr=true mux-bitrate=15360 bufsize=1024
> name=mux %s ! decodebin2 name=d ! ffmpegcolorspace ! mpeg2enc format=3
> bitrate=10000 constraints=false bufsize=1024 reduction-4x4=4
> reduction-2x2=4 ! mux. d. ! queue ! audioconvert ! twolame ! mux."  %
> self.uri)

great, pls add any findings about working pipelines to

http://coherence-project.org/wiki/TransCoding

There you'll too find an example upon how to override internal pipelines
in the config file.

> 1) Coherence uses 100% CPU when doing nothing, and over 180% when
> playing any clip (even SD). Looks like a busy-wait somewhere.

what platform/distro?

Maybe it is related to

http://coherence-project.org/ticket/235#comment:3

> 2) Audio and video sometimes get out of sync after skips.

probably an issue of the pipeline above, maybe the removed queues.


> 3) If I stop and restart Coherence, it will appear as a different server
> in the menu of my TV.

you should use an xml config file. There Coherence will add
automatically an unique UUID to each backend which will be
persistent over restarts.

http://coherence-project.org/wiki/XMLConfig

> 4) I cannot seek in the transcoded streams.

that's on the todo list and one of the things we want
to address during

http://coherence-project.org/wiki/Sprints/Two

> 6) Coherence doesn't list ape files in the TV menu, even though other
> gstreamer-based applications can decode them to wav.

you might need to add the extension/mimetype to the FSStore

http://coherence-project.org/browser/trunk/Coherence/coherence/backends/fs_storage.py#L24

Again this is something we should put into a more global module, make it
configurable from the config and accessible from all backends.

Regards,
Frank

_______________________________________________
coherence-dev mailing list
[hidden email]
http://lists.beebits.net/cgi-bin/mailman/listinfo/coherence-dev
Alexander E. Patrakov

Re: (almost) success with Sony Bravia KDL-32W5500

Reply Threaded More More options
Print post
Permalink
Frank Scholz wrote:

> Hi Alexander
>
> some quick answers:
>
>  
>> self.pipeline = gst.parse_launch(
>>             "mplex format=3 vbr=true mux-bitrate=15360 bufsize=1024
>> name=mux %s ! decodebin2 name=d ! ffmpegcolorspace ! mpeg2enc format=3
>> bitrate=10000 constraints=false bufsize=1024 reduction-4x4=4
>> reduction-2x2=4 ! mux. d. ! queue ! audioconvert ! twolame ! mux."  %
>> self.uri)
>>    
>
> great, pls add any findings about working pipelines to
>
> http://coherence-project.org/wiki/TransCoding
>
> There you'll too find an example upon how to override internal pipelines
> in the config file.
>  

Thanks, will do so later, when I solve the issue with wmv files (after
adding wmv to mime_types, Coherence doesn't even attempt to eat CPU time
transcoding them according to my pipeline, and the TV times out waiting
for it - queue issue again?). Also, I have a trouble getting transcoding
work together with XML config. Does this option always need to be
specified on the command line? I tried putting this in the config:

<transcoding active="yes">yes</transcoding>

but this had no effect.

>> 1) Coherence uses 100% CPU when doing nothing, and over 180% when
>> playing any clip (even SD). Looks like a busy-wait somewhere.
>>    
>
> what platform/distro?
>  

Gentoo x86.

> Maybe it is related to
>
> http://coherence-project.org/ticket/235#comment:3
>  

Disabling glib2 reactor removes the "100% CPU after starting" problem,
but the CPU usage still rises to nearly 200% (and memory usage grows)
while playing an SD clip and this doesn't cease after pressing the
"stop" button on the TV remote control.

OTOH, restoring the glib2 reactor and rebuilding pygobject with the
latest patch mentioned in
https://bugzilla.gnome.org/show_bug.cgi?id=481569 helps against the
"100% CPU after starting" problem, too. With an SD clip, the CPU usage
is 110%, and with HD, 140%.

Looking at the CPU usage while playing a long (44 minutes) ape file,
though, I see 100% usage and growing memory consumption during the first
2 minutes or so, followed by a completely idle system. It looks like
Coherence transcoded the whole file to LPCM into memory (and finally ate
476 MB of reserved memory and 522 MB of virtual memory, which matches
the uncompressed file size). I don't want it to do that with video files.

>  
>> 2) Audio and video sometimes get out of sync after skips.
>>    
>
> probably an issue of the pipeline above, maybe the removed queues.
>  

Will investigate further. Maybe a Core 2 Duo at 2.13 GHz is a tiny bit
too slow to transcode 720p movies to MPEG2 in real time. Altough on
#ffmpeg there was a statement that, if one doesn't care about quality,
it can compress 1080i into H.264 in real time. I didn't try to verify this.

>> 3) If I stop and restart Coherence, it will appear as a different server
>> in the menu of my TV.
>>    
>
> you should use an xml config file. There Coherence will add
> automatically an unique UUID to each backend which will be
> persistent over restarts.
>
> http://coherence-project.org/wiki/XMLConfig
>  

Yes, this works, but I can't work out how to enable transcoding in the
XML config. OTOH, adding uuid=... manually to the non-XML config works too.

>> 6) Coherence doesn't list ape files in the TV menu, even though other
>> gstreamer-based applications can decode them to wav.
>>    
>
> you might need to add the extension/mimetype to the FSStore
>
> http://coherence-project.org/browser/trunk/Coherence/coherence/backends/fs_storage.py#L24
>  

Done, works, but with the "transcodes the whole file into memory" issue.

Another issue: the "pause" button on my TV remote works with transcoded
files (it does work with MP3s).

--
Alexander E. Patrakov
_______________________________________________
coherence-dev mailing list
[hidden email]
http://lists.beebits.net/cgi-bin/mailman/listinfo/coherence-dev