The secret transcoding feature

General discussion about the media server. Feature requests. Hints, tips and tricks.
thomasfj99
Posts: 2
Joined: Wed Sep 22, 2010 10:50 am
AV Hardware: Playstation 3
Twonky media server 6.0.1 on Windows 7 Ultimate 64bit

The secret transcoding feature

Postby thomasfj99 » Thu Dec 09, 2010 8:31 am

Hi,

There seems to be no documentation on how the Transcoding feature of Twonky server 6.x works, so I hope someone is able to explain my how it work (or how it supposed to work).

Actually I got the serverside transcoding working.
I corrected the ffmpeg path in configfile in the cgi-bin folder and I was able to see that ffmpeg was running from the task manager.(I' running the Windows version)

I had to use "procmon" to figure what ffmpeg was doing. Ffmpeg is converting any item (in my case video) which matches the "desc" files in the cgi-bin folder. I my case it started to convert all my m4v files to wmv.

I could see from procmon that ffmpeg outputfile is stored in the "db\cache\<guid>\wmv" folder of the Twonky installation dir.
Uncool feature by the way as Your system drive get filled up quickly. But that's another issue.

Ok, now I got at cached WMV version of my videos..THEN WHAT?

I have been testing Transcoding on other DLNA servers. They create a "Transcoding" item in the media index when You browse though it from your device (ps3, tv or whatever), but on Twonky nothing happens.

The videos in the index are excatly the same as before the Transcoding was switched on. I can tell from the web interface that the files displayed in the index is still my old m4v files.

So....what is supposed to happen? How do I access the transcoded version of the content from my media device?


Thanks in advance

kennyj
Posts: 1
Joined: Thu Dec 16, 2010 7:39 pm
AV Hardware: Sony BDP-S570, WHS

Re: The secret transcoding feature

Postby kennyj » Thu Dec 16, 2010 8:37 pm

My Configuration:

Twonky server V6 on WHS home-built box using Intel D510MO motherboard , Sony BDP-S570 with R735 firmware, Motorola wireless cable modem running 1 Gb connections, Windows 7 PC, wireless N connection between Sony player and wireless modem (about 25 feet away).
................................................................................................................................................

It appears that there are numerous things not properly documented. I spent 18 hours working over 8 days trying to get it to work and finally managed to get Twonky V6 working with Sony BDP-S570 with most of my video formats.

Big thing that the software doesn't do and not documented well is that you have to "install" FFmpeg software, CREATE some desc files and MODIFY the clients.db file..

Here is what support told me to do. (I have my notes just past their instructions):

==============

For enabling transcoding you should follow following steps:
Install FFMPEG build from here:
http://ffmpeg.arrozcru.org/autobuilds/f ... -static.7z

Now go to C:\Program Files\TwonkyMedia\cgi-bin
Open ffmpeg.location and specify the path of ffmpeg exe.
save the changes.

Restart the twonkymedia server.

Regards,
Twonky Team

===================

NOTES:

1) The site software (.7z) that creates the ffmpeg software is a zip file and not an install executable. You must unzip it into c:\ffmpeg directory where it creates c:\ffmpeg\bin, \licenses, \doc, \presets. I copied the .exe files from the \bin into c:\ffmpeg directory so I wouldn't have to change the pointer contents of C:\Program Files\TwonkyMedia\cgi-bin\ffmpeg.location.

2) I installed Twonky Manager V 2.0.4. This installed files into the C:\Program Files\TwonkyMedia\ directory. I didn't install the server V6.0.28 Server for the WHS as the documentation says.

3) Once #1 & #2 above was done, then the transcode options became available. I checked the transcode to MPEG2 box.

4) I then created 2 desc files. The first was for Mpeg4 to Mpeg2. The second was for WMV to Mpeg2. Without these, then all you can play are MPEG1&2 formatted videos. At least for the Sony BDP-S570.

Contents of my 1st file to convert mpeg4 to mpeg2 in c:\program files\twonkymedia\cgi-bin\ffmpeg-mp4-mpg.desc

# transcode video (mpeg4 to mpg)
#(c) 2008 by PacketVideo
exec: ffmpeg -i $infile -vcodec mpeg2video $outfile
# capabilities
from=video/mp4
to=video/mpeg
asynchronous
priority=idle

Contents of my 2st file to convert wmv to mpeg2 in c:\program files\twonkymedia\cgi-bin\ffmpeg-wmv-mpg.desc

# transcode video (wmv to mpg)
#(c) 2008 by PacketVideo
exec: ffmpeg -i $infile -vcodec mpeg2video $outfile
# capabilities
from=video/x-ms-wmv
to=video/mpeg
asynchronous
priority=idle

Create those 2 files and then you can play mpeg4 and wmv's via transcoding on the Sony BDP-S570

5) I updated my Sony firmware today with version R735.

6) I Set my receivers property in Twonky Server Config to "Sony Blu-Ray Home Theater" instead of Sony Blu-Ray player (this is now been changed with solution #11 below)

7) In basic setup, I set D:\shares\Photos, D:\shares\Videos, D:\shares\Music for the shares off my WHS server.

8) I played various videos (Divx, WMV, Mpeg1, Mpeg2) that I have and most all play. I think there are a couple that don't play. I'll save that for later.

9) On my Windows 7 PC desktop, I created a shorcut to the Twonky Server Config on my WHS box that I can launch. It's http://server:9000/ that the browser launches. I'm sure most people know this but just in case.

10) WHS Update:
I found out, after one day, that my WHS C: drive was filled up. This is because the transcode puts the converted videos into cache on the C: drive. I had to go and point my cache to the D: drive by modifying the .ini file in C:\Documents and Settings\All Users\Application Data\twonkymedia\twonkymedia-server.ini to cachedir=D:\TwonkyMedia\db\cache. I had to clear out my C: drive cache that is in the db folder and had to create the D:\TwonkyMedia\db\cache folder and do a rebuild. My C drive went from 80 MB free to 11 GB free space.

11) SOLUTION FOR SONY BLU-RAY not playing MPEG's when Sony Blu-Ray player selected as receiver

For some reason I couldn't get my videos to show up. I found out that my receiver had changed back to Sony BluRay Player rather than Sony Blu-Ray Theater. Changing to Theater didn't work but when I changed it to PS3, I found that it now list and plays my videos.

OK, now have the solution so everyone can rest better. Sorry if someone else has already figured this out...

Go to the C:\Program Files\TwonkyMedia\resources\clients.db file and make the following change -

>>
NA:Sony Blu-Ray Player
HH:Blu-ray Disc Player
// next MT added by me
MT:mpeg,mpeg2/mpeg
XM:DLNA15
// Added ",MPEG" to end of next line by me
TR:JPEGORG,JPEG160x160,JPEG640x480,JPEG1024x768,JPEG1920x1080,MPEG
DB:AUTO

Restart the server and now your mpeg movies will show up in the listings.

12) Now working on getting MTS to play. The Sony documentation says that it supports MPEG and MTS via DLNA. I verified this by selecting Sony Home Theater using trial version of Mezz.mo that I installed. When playing via Mezzmo, Sony Blu-Ray player displays M2TS. I have tried modifying the clients.db with everything I could try and MTS doesn't play. I emailed support (12/20/10) and will post back with their reply.

They have elevated the issue but as of 01/24/2011 no reply yet.

======

FINALLY:

I don't understand why Twonky doesn't supply the desc for WMV and MPEG4 for the transcoding. I don't know if I have encoded it using the best options for FFmpeg but maybe someone can comment. Any why doesn't Twonky supply a good description in their documentation about using V6 with WHS and Sony player.

It would appear that saving videos in MPEG2 format would be better in the case of the Sony BDPS570 because you don't end up having 2 copies of the videos on your hard drive. Anyone care to tell me if videos stored in MPEG4 format are better than MPEG2?

MTS played from a Sony HD cam is stunning. I received some MTS files from my Dad's 100 birthday that a relative shot and they look as if I were actually there.
Last edited by kennyj on Mon Jan 24, 2011 8:35 am, edited 1 time in total.

User avatar
amunoz_tico
Posts: 67
Joined: Sat Jan 19, 2008 1:23 am
AV Hardware: Samsung UN46C7000 & BD-C6900 ¬ Sony PS3 & BPD-S370 ¬ Pioneer VSX-820-K ¬ Bose Acoustimass 15 ¬ Wii ¬ DLink DNS-323 & DIR-655 ¬ Monster HDP2400
Location: Costa Rica

Re: The secret transcoding feature

Postby amunoz_tico » Tue Jan 11, 2011 1:18 am

Hi kennyj, thanks a lot for your post. I will try your recommendations this week.


kennyj wrote:12) Now working on getting MTS to play. The Sony documentation says that it supports MPEG and MTS via DLNA. I verified this by selecting Sony Home Theater using trial version of Mezz.mo that I installed. When playing via Mezzmo, Sony Blu-Ray player displays M2TS. I have tried modifying the clients.db with everything I could try and MTS doesn't play. I emailed support (12/20/10) and will post back with their reply.


Did you get an answer for the Notes #12? :?:

FYI, I tried Serviio (a freeware) and It works like Mezzmo, My S370 (US model) shows M2TS for my DivX movies.



By the way, Do you have any idea how enable the subtitles? Currently, my PS3 can play any DivX videos with XSUB subtitles (embedded subtitles). :( I'm worry about the S370 which can't play any DivX video with any subtitles (XSUB or SRT)

I'd appreciate your comments!

Regards!
Samsung UN46C7000, BD-C6900 & BD-D5500 ¬ Sony PS3 ¬ Pioneer VSX-820-K ¬ Bose Acoustimass 15 ¬ Wii ¬ DLink DNS-323 & DIR-655 ¬ Monster HDP2400

User avatar
amunoz_tico
Posts: 67
Joined: Sat Jan 19, 2008 1:23 am
AV Hardware: Samsung UN46C7000 & BD-C6900 ¬ Sony PS3 & BPD-S370 ¬ Pioneer VSX-820-K ¬ Bose Acoustimass 15 ¬ Wii ¬ DLink DNS-323 & DIR-655 ¬ Monster HDP2400
Location: Costa Rica

Re: The secret transcoding feature

Postby amunoz_tico » Tue Jan 11, 2011 6:55 pm

kennyj wrote:11) SOLUTION FOR SONY BLU-RAY not playing MPEG's when Sony Blu-Ray player selected as receiver

For some reason I couldn't get my videos to show up. I found out that my receiver had changed back to Sony BluRay Player rather than Sony Blu-Ray Theater. Changing to Theater didn't work but when I changed it to PS3, I found that it now list and plays my videos.

OK, now have the solution so everyone can rest better. Sorry if someone else has already figured this out...

Go to the C:\Program Files\TwonkyMedia\resources\clients.db file and make the following change -

>>
NA:Sony Blu-Ray Player
HH:Blu-ray Disc Player
// next MT added by me
MT:mpeg,mpeg2/mpeg
XM:DLNA15
// Added ",MPEG" to end of next line by me
TR:JPEGORG,JPEG160x160,JPEG640x480,JPEG1024x768,JPEG1920x1080,MPEG
DB:AUTO

Restart the server and now your mpeg movies will show up in the listings.



@Hi kennyj

I tried your setup but my S370 is not working yet. I can navigate through the tree, but I got this error when I want to see the content of any folder = "There is no playable video".

Any idea how result this issue?
Samsung UN46C7000, BD-C6900 & BD-D5500 ¬ Sony PS3 ¬ Pioneer VSX-820-K ¬ Bose Acoustimass 15 ¬ Wii ¬ DLink DNS-323 & DIR-655 ¬ Monster HDP2400

User avatar
amunoz_tico
Posts: 67
Joined: Sat Jan 19, 2008 1:23 am
AV Hardware: Samsung UN46C7000 & BD-C6900 ¬ Sony PS3 & BPD-S370 ¬ Pioneer VSX-820-K ¬ Bose Acoustimass 15 ¬ Wii ¬ DLink DNS-323 & DIR-655 ¬ Monster HDP2400
Location: Costa Rica

Re: The secret transcoding feature

Postby amunoz_tico » Tue Jan 11, 2011 8:26 pm

Dear friends,

Since I am not an expert, I don't sure if the following test is fine. However, I want to share my comments about a test that I did with FFmpeg subtitles options.

I expect that one of the Experts can help us to get Subtitles support for our devices. I think it is transcoding too.


TOOLS
- FFmpeg version SVN-r23012
- My video is a DivX movie with embedded subtitles


FFmpeg OPTIONS
I used the following options:

Code: Select all

-vcodec codec
    Force video codec to codec. Use the copy special value to tell that the raw codec data must be copied as is.

-scodec codec
    Force subtitle codec ('copy' to copy stream).

Source: http://ffmpeg.org/ffmpeg-doc.html


COMMAND LINE
ffmpeg -i mytest.divx -vcodec mpeg2video -scodec copy mytestout.mpg

Where:
mytest.divx => input video
-vcodec mpeg2video => codec the video to mpeg2video (MPEG-2 or MP2T)
-scodec copy => subtitle codec ('copy' to copy stream)
mytestout.mpg => output video based on mpg


FFmpeg REPORT

Code: Select all

FFmpeg version SVN-r23012, Copyright (c) 2000-2010 the FFmpeg developers
  built on May  3 2010 19:05:24 with gcc 3.4.5 (mingw-vista special r3)
  configuration: --enable-static --disable-shared --disable-ffplay --disable-ffserver --enable-memalign-hack --enable-libmp3lame --enable-w32threads --extra-ldflags=-L/static/lib --extra-cflags=-I/static/include
  libavutil     50.15. 0 / 50.15. 0
  libavcodec    52.66. 0 / 52.66. 0
  libavformat   52.62. 0 / 52.62. 0
  libavdevice   52. 2. 0 / 52. 2. 0
  libswscale     0.10. 0 /  0.10. 0

Seems stream 0 codec frame rate differs from container frame rate: 23.98 (65535/2733) -> 23.98 (24000/1001)
Input #0, avi, from 'mytest.divx':
  Duration: 01:30:10.82, start: 0.000000, bitrate: 1093 kb/s
    Stream #0.0: Video: mpeg4, yuv420p, 688x288 [PAR 1:1 DAR 43:18], 23.98 fps,23.98 tbr, 23.98 tbn, 23.98 tbc
    Metadata:
      strn            : Video
    Stream #0.1: Audio: ac3, 48000 Hz, stereo, s16, 192 kb/s
    Metadata:
      strn            : Audio
    Stream #0.2: Subtitle: xsub
    Metadata:
      strn            : Subtitle - es;02

Output #0, mpeg2video, to 'mytestout.m2v':
  Metadata:
    encoder         : Lavf52.62.0
    Stream #0.0: Video: mpeg2video, yuv420p, 688x288 [PAR 1:1 DAR 43:18], q=2-31, 200 kb/s, 90k tbn, 23.98 tbc
    Metadata:
      strn            : Video
    Stream #0.1: Audio: ac3, 48000 Hz, stereo, s16, 64 kb/s
    Metadata:
      strn            : Audio
    Stream #0.2: Subtitle: xsub
    Metadata:
      strn            : Subtitle - es;02
Stream mapping:
  Stream #0.0 -> #0.0
  Stream #0.1 -> #0.1
  Stream #0.2 -> #0.2
Press [q] to stop encoding



MY COMMENTS
Based on my test, I have the following comments/observations:
- FFmpeg identifies three metadata: Video (Stream #0.0), Audio (Stream #0.1) and Subtitles (Stream #0.2)
- FFmpeg can streams the three metadata, including the subtitles.
- I think Twonky could support the streaming of subtitles with the right settings.


One more time, I am not an expert. Sorry if the previous test is so basic. I just want to contribute with this Topic.

.
Samsung UN46C7000, BD-C6900 & BD-D5500 ¬ Sony PS3 ¬ Pioneer VSX-820-K ¬ Bose Acoustimass 15 ¬ Wii ¬ DLink DNS-323 & DIR-655 ¬ Monster HDP2400

agent0014
Posts: 1
Joined: Fri Feb 11, 2011 12:22 am
AV Hardware: Mac Mini for server
PS3 as client
Sony Blu Ray Player as client
Various android phones

Re: The secret transcoding feature

Postby agent0014 » Fri Feb 11, 2011 12:26 am

Does this work on the mac version? I'm also unsure as to what exactly to set the path to for the FFMPEG location setting... as in which slashes to use, since mac uses forward slashes as a standard and doesn't use drive letters. I'm not sure if twonky is translating it or what. I'd really like to get this working with my sony BD570... would make me very happy to be able to play videos!


Return to “TwonkyServer”

Who is online

Users browsing this forum: Bing [Bot] and 2 guests