Menu

#32 support transcode Video and Audio

open
nobody
None
5
2023-08-16
2011-02-26
hiero
No

Hello,
This patch supports transcoding for both Video and Audio using mencoder/ffmpeg as transcoder.
This uses multiple <res> elements. It means minidlna present multiple media format for one stream.
For example, in case source stream is H.264/AAC, minidlna presents both H.264/AAC and MPEG2/AC3.
If a client (TV) supports only MPEG2/AC3, it select MPEG2/AC3 stream.
All the Video stream can be transcoded to MPEG2/AC3 (DVD) stream.
All the Audio stream can be transcoded to LPCM stream.

mencoder/ffmpeg is required to be installed.

I tested on Ubunts 10.04 and Fedora 12.

I hope this patch is helpful to the users who's TV only supports MPEG2 and LPCM.

This patch is for minidlna_1.0.18_src.tar.gz.
This patch also support Toshiba TV.

heiro

Discussion

<< < 1 2 3 4 > >> (Page 2 of 4)
  • Leon Botha

    Leon Botha - 2011-07-06

    Hi hieroun

    I loaded your patch against 1.0.20 on my ClearOS and it all worked fine.
    I have noticed that i get a error message in the LOG file every time i connect with minidlna stating that it as received a showdown command "15" but minidlna is still working. Do you have any idea what this could be?

    Regards
    Leon

     
  • hiero

    hiero - 2011-07-08

    Hello Leon,

    Would you show the LOG around the error message.

    hiero

     
  • Leon Botha

    Leon Botha - 2011-07-10

    Hi hieroun

    While watching video's, the log is filled with the following:

    [2011/07/09 12:06:15] minidlna.c:157: warn: received signal 15, good-bye
    [2011/07/09 12:09:03] minidlna.c:157: warn: received signal 15, good-bye
    [2011/07/09 23:18:49] minidlna.c:157: warn: received signal 15, good-bye
    [2011/07/09 23:24:36] minidlna.c:157: warn: received signal 15, good-bye
    [2011/07/10 00:18:16] minidlna.c:157: warn: received signal 15, good-bye
    [2011/07/10 00:56:46] minidlna.c:157: warn: received signal 15, good-bye
    [2011/07/10 00:56:46] upnpsoap.c:1542: warn: SoapMethod: Unknown: X_SetBookmark

    Regard

    Leon

     
  • hiero

    hiero - 2011-07-16

    Hello Leon,

    Thank you for the information.

    In some cases, SIGTERM is issued to kill the transcode process.
    The log messages are written when the SIGTERM is received in the transcode process.
    But the message should be as following:
    [2011/07/12 12:26:05] upnphttp.c:1314: warn: received signal 15
    because the signal handler in the process is replaced with "sigterm_child()" in upnphttp.c.

    I think the log can be ignored, if minidlna still works, because the logs are written in the transcode process which should be killed.
    Anyway, I should check more.

    hiero

     
  • Leon Botha

    Leon Botha - 2011-07-22

    Hi hieroun

    Any update on the error i have ?
    [2011/07/22 18:00:09] minidlna.c:157: warn: received signal 15, good-bye
    [2011/07/22 18:00:09] upnpsoap.c:1542: warn: SoapMethod: Unknown: X_SetBookmark
    [2011/07/22 18:00:09] upnpsoap.c:1590: warn: Returning UPnPError 401: Invalid Action
    [2011/07/22 18:00:28] minidlna.c:157: warn: received signal 15, good-bye
    [2011/07/22 18:01:01] minidlna.c:157: warn: received signal 15, good-bye
    [2011/07/22 18:01:01] upnpsoap.c:1542: warn: SoapMethod: Unknown: X_SetBookmark
    [2011/07/22 18:01:01] upnpsoap.c:1590: warn: Returning UPnPError 401: Invalid Action
    [2011/07/22 18:02:02] minidlna.c:157: warn: received signal 15, good-bye
    [2011/07/22 18:02:49] minidlna.c:157: warn: received signal 15, good-bye
    [2011/07/22 18:02:49] upnpsoap.c:1542: warn: SoapMethod: Unknown: X_SetBookmark
    [2011/07/22 18:02:49] upnpsoap.c:1590: warn: Returning UPnPError 401: Invalid Action
    It seems that Minidlna does not set a bookmark in my case, any idea where i can look to see why?
    I have a ClearOS box.

    Leon

     
  • hiero

    hiero - 2011-07-27

    Hello Leon,

    Do the following warnings appear only after the transcode patch is applied?
    I do not think the patch makes influence to these process.

    [2011/07/22 18:01:01] upnpsoap.c:1542: warn: SoapMethod: Unknown: X_SetBookmark
    [2011/07/22 18:01:01] upnpsoap.c:1590: warn: Returning UPnPError 401:Invalid Action

    hiero

     
  • Leon Botha

    Leon Botha - 2011-07-27

    Hi hieroun

    Yes, i had Ver. 1.0.20 running fine before the patch.
    This is new after the patch.

    Leon

     
  • hiero

    hiero - 2011-07-27

    Hello Leon,

    OK, I will investigate it.

    hiero

     
  • Leon Botha

    Leon Botha - 2011-07-27

    Hi hieroun

    How do you "snoop" the messages between minidlna and your tv?
    I am a bit new to this. Want to see if i can understand what is going on.
    I have a Win. XP box, still new to Linux as well

    You can email me on leonbotha.69@gmail.com if you want
    Leon

     
  • hiero

    hiero - 2011-07-27

    Hello Leon,

    I think you are using Samsung TV for client.
    I got the information from the internet resources
    that Samsung product issues "X_SetBookmark" for resume function.
    MiniDLNA does not support "X_SetBookmark" function.
    The warnings shows:
    - the client requests "X_SetBookmark".
    - MiniDLNA does not know it, so returns UPnPError401:Invalid Action.

    As a result, resume does not work on the client.

    Easier way to "snoop" is using -d option on MiniDLNA like
    minidlna -d
    You can get more information than log file.

    If you want to capture all of the messages between MiniDLNA and cliens,
    wireshark is the best, though it is not so easy to use it.

    BTW.
    "minidlna_transcode_1.0.19_samsung-support_20110327.patch" supports "X_SetBookmark".

    hiero.

     
  • Anonymous

    Anonymous - 2011-07-28

    I'm trying this patch on my Ubuntu 11.04 with a Panasonic TX-P42VT20 tv. Some files that were not possible to play before work with this patch and ffmpeg, but others do not. I have a few mkv files with H264 video and DTS audio that still don't work. I started minidlna with the -d option in order to have a look. It seems there is no attempt to transcode the file, but the tv can't play it. How is it determined what files should be transcoded? Do I need to provide further information?

     

    Last edit: Anonymous 2014-03-16
  • hiero

    hiero - 2011-07-28

    At first, please read above "Details".

    With this patch, minidlna shows both non-transcoded and transcoded resources to the client(TV) for each title.
    In the message with -d option, followings may be seen.

    ----------
    &lt;dc:title&gt;(Title of the file)&lt;/dc:title&gt
    ...
    &lt;res ... protocolInfo= ... &lt;/res&gt
    &lt;res ... protocolInfo= ... MPEG_PS_NTSC ... &lt;/res&gt
    ----------

    The first "protocolInfo" shows the original one and second(MPEG_PS_NTSC) shows the transcoded one.
    Then the client selects the resource of the two.

    If the client selects the transcoded resource, ffmpeg message is displayed in the minidlna message.

    It may be helpful to show the last 30 lines of the message after a mkv file is selected.

     
  • Anonymous

    Anonymous - 2011-07-28

    Thank you for the response. Below I have enclosed some debug output. I interpret the info as the client choosing the original, not transcoded variant. Is that correct? The original file contains DTS audio though, something that the tv media player does not support. Can it be seen that that there is DTS audio in the communication?

    I hope that this problem is relevant to the patch in question.

    <?xml version="1.0" encoding="utf-8"?>
    <s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/" s:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><s:Body><u:BrowseResponse xmlns:u="urn:schemas-upnp-org:service:ContentDirectory:1"><Result>&lt;DIDL-Lite xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:upnp="urn:schemas-upnp-org:metadata-1-0/upnp/" xmlns="urn:schemas-upnp-org:metadata-1-0/DIDL-Lite/"&gt;
    &lt;item id="64$2$1D$0" parentID="64$2$1D" restricted="1"&gt;&lt;dc:title&gt;f-justgowithit720&lt;/dc:title&gt;&lt;upnp:class&gt;object.item.videoItem&lt;/upnp:class&gt;&lt;dc:date&gt;2011-07-16T11:13:46&lt;/dc:date&gt;&lt;res size="5858955800" duration="1:56:29.974" resolution="1280x688" protocolInfo="http-get:*:video/x-matroska:DLNA.ORG_OP=01;DLNA.ORG_CI=0"&gt;http://192.168.1.73:8200/MediaItems/6051.mkv&lt;/res&gt;&lt;res duration="1:56:29.974" resolution="720x480" protocolInfo="http-get:*:video/mpeg:DLNA.ORG_PN=MPEG_PS_NTSC;DLNA.ORG_OP=10;DLNA.ORG_CI=1;DLNA.ORG_FLAGS=01500000000000000000000000000000"&gt;http://192.168.1.73:8200/MediaItems/TranscodeVideo/NTSC/6051.mkv&lt;/res&gt;&lt;/item&gt;&lt;/DIDL-Lite&gt;</Result>
    <NumberReturned>1</NumberReturned>
    <TotalMatches>1</TotalMatches>
    <UpdateID>27</UpdateID></u:BrowseResponse></s:Body></s:Envelope>

    [2011/07/28 15:57:31] minidlna.c:1339: debug: HTTP connection from 192.168.1.71:60223
    [2011/07/28 15:57:31] upnphttp.c:276: debug: Range Start-End: 0 - -1
    [2011/07/28 15:57:31] upnphttp.c:168: debug: Client found in cache. [type 100/entry 0]
    [2011/07/28 15:57:31] upnphttp.c:853: debug: HTTP REQUEST: GET /MediaItems/6051.mkv HTTP/1.1
    Host: 192.168.1.73:8200
    Range: bytes=0-
    transferMode.dlna.org: Streaming
    Connection: keep-alive

    [2011/07/28 15:57:31] upnphttp.c:2217: info: Serving DetailID: 6051 [/mnt/2TBDisk/My Shared Folder/Torrents/Just.Go.With.It.2011.720p.BluRay.x264--Felony/f-justgowithit720.mkv]
    [2011/07/28 15:57:31] upnphttp.c:2401: info: Following is the response
    HTTP/1.1 206 OK
    Content-Type: video/x-matroska
    Content-Length: 5858955800
    Content-Range: bytes 0-5858955799/5858955800
    transferMode.dlna.org: Streaming
    Accept-Ranges: bytes
    Connection: close
    Date: Thu, 28 Jul 2011 13:57:31 GMT
    EXT:
    realTimeInfo.dlna.org: DLNA.ORG_TLAG=*
    contentFeatures.dlna.org: DLNA.ORG_OP=01;DLNA.ORG_CI=0
    Server: Ubuntu/11.04 DLNADOC/1.50 UPnP/1.0 MiniDLNA/1.0

    [2011/07/28 15:57:31] upnphttp.c:2410: info: last_file.mime=video/x-matroska
    [2011/07/28 15:57:31] upnphttp.c:1225: info: start sendfile, offset=0, end=5858955799
    [2011/07/28 15:57:31] minidlna.c:1339: debug: HTTP connection from 192.168.1.71:51200
    [2011/07/28 15:57:31] upnphttp.c:276: debug: Range Start-End: 0 - -1
    [2011/07/28 15:57:31] upnphttp.c:168: debug: Client found in cache. [type 100/entry 0]
    [2011/07/28 15:57:31] upnphttp.c:853: debug: HTTP REQUEST: GET /MediaItems/6051.mkv HTTP/1.1
    Host: 192.168.1.73:8200
    Range: bytes=0-
    transferMode.dlna.org: Streaming
    Connection: keep-alive

    [2011/07/28 15:57:31] upnphttp.c:2196: info: !!!! kill(SIGTERM() childpid = 23852
    [2011/07/28 15:57:31] upnphttp.c:2217: info: Serving DetailID: 6051 [/mnt/2TBDisk/My Shared Folder/Torrents/Just.Go.With.It.2011.720p.BluRay.x264--Felony/f-justgowithit720.mkv]
    [2011/07/28 15:57:31] minidlna.c:157: warn: received signal 15, good-bye
    [2011/07/28 15:57:31] upnphttp.c:2401: info: Following is the response
    HTTP/1.1 206 OK
    Content-Type: video/x-matroska
    Content-Length: 5858955800
    Content-Range: bytes 0-5858955799/5858955800
    transferMode.dlna.org: Streaming
    Accept-Ranges: bytes
    Connection: close
    Date: Thu, 28 Jul 2011 13:57:31 GMT
    EXT:
    realTimeInfo.dlna.org: DLNA.ORG_TLAG=*
    contentFeatures.dlna.org: DLNA.ORG_OP=01;DLNA.ORG_CI=0
    Server: Ubuntu/11.04 DLNADOC/1.50 UPnP/1.0 MiniDLNA/1.0

     
  • hiero

    hiero - 2011-07-28

    Thank you for the log.
    Yes, the original(non-transcoded) is selected.

    Following can be known from the log.

    For the title of "f-justgowithit720", following two resources are presented from minidlna.

    ----------
    protocolInfo="http-get:*:video/x-matroska:DLNA.ORG_OP=01;DLNA.ORG_CI=0"
    http://192.168.1.73:8200/MediaItems/6051.mkv

    protocolInfo="http-get:*:video/mpeg:DLNA.ORG_PN=MPEG_PS_NTSC;DLNA.ORG_OP=10;DLNA.ORG_CI=1;DLNA.ORG_FLAGS=01500000000000000000000000000000"
    http://192.168.1.73:8200/MediaItems/TranscodeVideo/NTSC/6051.mkv
    ----------

    Following is the request from the TV:
    ----------
    [2011/07/28 15:57:31] upnphttp.c:853: debug: HTTP REQUEST: GET
    /MediaItems/6051.mkv HTTP/1.1
    ----------
    This shows the TV selects the original one.

    The information in protocolInfo is very limited. Especially MKV case, there is no Video/Audio codec types.
    This is a weak point of "multiple <res> elements", because clients can make a mistake to select resource which codec is not supported.

    BTW,
    I checked "Operating Instructions" of TX-P42VT20B. There described "MKV (Matroska Video) files are not supported by DLNA".
    It is interesting why the TV selects the MKV.

     
  • Anonymous

    Anonymous - 2011-07-29

    Thank you again for the explanation. Now I understand what is happening. It is a shame that the protocol is defined in such a way that the renderer cannot with confidence automatically choose a format that is supported. I guess the only options are to live with the occational problem like this or to have manual configuraton for each renderer in minidlna (which would be a pain in the ...).

    The tv does play matroska files through DLNA. As long as the used codecs are supported, it works fine. The manual doesn't seem to be correct regarding this!

     
  • Anonymous

    Anonymous - 2011-07-30

    Hi,

    Is it possible to have the patch against 1.0.21 version?

    Regards

     
  • hiero

    hiero - 2011-08-07

    support transcode Video and Audio patch against 1.0.21 support Linux and Cygwin

     
  • hiero

    hiero - 2011-08-07

    patch against 1.0.21 is uploaded.
    I tested on Ubuntu 11.04 and Windows7/Vista/XP.

     
  • Leon Botha

    Leon Botha - 2011-08-30

    Hi hieroun
    Are you planning an update against 1.0.22?

     
  • goro69

    goro69 - 2011-09-01

    Is this patch make difference bеtwееn PAL or NTSC system, or coding of input files. My audio is 10 sec. behind video.

     
  • hiero

    hiero - 2011-09-01

    Though currently only NTSC is supported, try to replace option as following.
    This may work.

    if using mencoder,
    replace "-ofps 30000/1001" with "-ofps 25"

    if using ffmpeg,
    "-target ntsc-dvd" with "-target pal-dvd"

     
  • hiero

    hiero - 2011-09-01

    support transcode Video and Audio patch against 1.0.22 support Linux and Cygwin

     
  • hiero

    hiero - 2011-09-01

    patch against 1.0.22 is uploaded.
    I tested on Ubuntu 11.04 and Windows7/Vista/XP.

     
  • Anonymous

    Anonymous - 2011-09-02

    Would it be possible to add an option to force transcoding? An more advanced extension could be to force transcoding for certain containers and/or codecs. This would serve as a workaround for the problem where the tv selects a file which it doesn't support due to lack of information about the codec.

    Another improvement that would be really good would be to enable audio transcoding to mp3 - my tv won't play the lpcm (yes, really!)

     
  • hiero

    hiero - 2011-09-10

    force transcoding:
    For this purpose, it is necessity to omit presenting original(not transcoded) profile.
    Though it is possible to support it technically, there is a problem.
    It is necessity to modify database structure, but it is not preferable.
    I will look for another way.

    transcoding to mp3:
    I will upload it soon.

     
  • hiero

    hiero - 2011-09-10

    transcodeing to mp3 for audio is added

     
  • hiero

    hiero - 2011-09-10

    transcodeing to mp3 for audio is added.

    In order to enable it, please read "minidlna.conf".

     
  • joost

    joost - 2011-10-18

    I have done a lot of tweaking for my Sony KDL-32EX715
    These settings now work perfectly. The trick is not to change the original framerate. The 100Hz Bravia engine can play any rate very smoothly!
    It mantains correct aspect ratio by adding black bordes as needed to get 16/9. It tells the TV that it is 4/3, so everything displays correctly when tv display is set to "wide". (otherwise TV behaviour depends on resolution)
    It spreads load on all cpu cores and supports a range of subtitle formats.

    In minidlna.conf:
    transcode_video_transcoder=/etc/minidlna/transcode.sh
    transcode_video_options=$STARTPOSITION $DURATION $SOURCE

    This starts a script to do the transcoding work.
    Content for transcode.sh:

    #!/bin/sh

    RATE=8000
    LANGUAGE="en,eng,nl,ned"

    STARTPOSITION=$1
    DURATION=$2
    SOURCE="$3"

    THREADS=`grep -c ^processor /proc/cpuinfo`

    CMD="mencoder -ss $STARTPOSITION -endpos $DURATION -msglevel all=-1 -really-quiet \ -af volume=-3,volnorm \ -noslices -vf expand=:::::16/9:8 \ -of mpeg -mpegopts format=dvd:tsaf -channels 2 -alang $LANGUAGE \ -oac mp3lame -lameopts br=192 \ -ovc lavc -lavdopts debug=0 -lavcopts aspect=4/3:threads=$THREADS:vcodec=mpeg2video:vbitrate=$RATE:keyint=25:vstrict=-2 \ -autosub -subpos 98 -sub-fuzziness 1 -slang $LANGUAGE \ -o - \"$SOURCE\""

    # For Debug:
    echo $CMD > /etc/minidlna/transcode.log

    eval $CMD

     
  • joost

    joost - 2011-10-18

    In my previous comment, this should all be on one line:

    -ovc lavc -lavdopts debug=0 -lavcopts
    aspect=4/3:threads=$THREADS:vcodec=mpeg2video:vbitrate=$RATE:keyint=25:vstrict=-2
    \

     
  • joost

    joost - 2011-10-18

    Uploaded the Bravia script at http://agris.nl/files/transcode.sh
    Added support for vobsub vob/idx subtitles.

     
  • Terje Io

    Terje Io - 2011-10-24

    I have made some tweaks to this patch to get my flac files to behave better on a Samsung UE40D6515 TV. Problems solved are missing album art and time info while playing. If this is of interest to anybody I can make them available.

     
  • Anonymous

    Anonymous - 2011-10-27

    Hi,

    Sorry this may be a silly question, but if I'm running 1.0.21 what do I need to do to enable transcoding? I guess all the patches talked about here have been moved into the stable/release binaries by now?

    I have some .mkv files that I would like to watch, but they never appear on the list of available videos being served up.......

    Any help would be much appreciated, or direction towards a guide would help a lot!

    Cheers, Jon

     

    Last edit: Anonymous 2014-05-09
  • hiero

    hiero - 2011-10-27

    Hello Jon,

    This patch has not pulled in stable/release.
    It is necessary to apply this patch and build.

    Would you tell me what OS are you using?
    Itf it is Ubuntu, it is easy. But not easy on other OS.

    hiero

     
  • Terje Io

    Terje Io - 2011-10-29

    I have now changed the code to use "handlers" for transcoding and have added crude support for streaming ISO-files (by automounting the image and streaming the VOB-files). I have managed to move nearly all of hierouns code out to a separate file (some small bits left in metadata.c - I will eventually look into adding handlers for these too) , just like my ISO-support. If the main code could be changed to accomodate the "handlers" concept then it will provide for easier patching of new releases as changes for adding transcoders will be minimal. Since this is my first go at modifying open source code I am unsure how to proceed and if this is of any interest of others.

    terje

     
  • Lukas Jirkovsky

    Lukas Jirkovsky - 2011-12-27

    terjeio: it would be great if you could share your patch! I'm certainly interested in it. I don't think it's possible to attach a patch to someone else ticket, but you can use eg. pastebin.com

     
  • Mateus de Oliveira Caruccio

    Hello,

    I'm having trouble to download the files.
    It's returning a html file (wrongly name .tar.gz) that states:

    "ERROR
    Could not get ArtifactFile filename"

    Probably some trouble with sourceforge.
    Could someone please import this to a github repo?

    thanks,
    Mateus

     
  • Anonymous

    Anonymous - 2012-01-17

    Hi Hieroun,
    I also seem to have the problem that my TV still wants to pick the mkv which it cannot play. Is there some way to prevent that?
    It might also have something to do with that it is offering NTSC.
    From this website: http://forum.serviio.org/viewtopic.php?f=27&t=3944

    I have found that the following is what my Philips 2011 model tv wants:
    http-get:*:video/mpeg:DLNA.ORG_PN=MPEG_TS_SD_EU_ISO

    The original mkv does not get played. So I need to transcode it somehow.
    Or maybe faking it is good enough? But I don't know how to test for that.

    Can I change the header the the thing above?
    I already changed the ffmpeg options to:
    transcode_video_options=-ss $STARTPOSITION -t $DURATION -i $SOURCE -v 0 -loglevel quiet -threads 2 -async 2 -target dvd pipe:1

    So that it would make dvd compliant files, which I now to be working fine.
    Any help is greatly appreciated!

     

    Last edit: Anonymous 2014-10-21
  • Jonathan Bowley

    Jonathan Bowley - 2012-02-15

    Hi Hieroun,

    I noticed there are instructions for Cygwin but not for Ubuntu. As a Linux newcomer, I have tried several combinations of the patch command, but none of them seem to work. Please could you give me some pointers in how to compile minidlna with your patch? Really looking forward to getting my KDL22PX300 working properly with your patch and joost's script.

    Thanks in anticipation!

     
  • Mateus de Oliveira Caruccio

    In fact, the 'patch' command needs an extra option:

    $ patch -p1 < ../minidlna_1.0.22_transcode.patch

    This is because you will be inside minidlna-1.0.22/ directory, so the first part of the patched files must be striped:

    $ head -n 1 minidlna_1.0.22_transcode.patch
    diff -uprN minidlna-1.0.22/Makefile minidlna-1.0.22_transcode_MP3/Makefile

    "-p 1" means "remove the first part of each patched file", "minidlna-1.0.22/" on this case.
    Hope it help.

    PS: I'm finishing a (very) little patch to this patch (a patch within a patch, a patchception:) with support to hardsubtitles (mencoder only).

     
  • Anonymous

    Anonymous - 2012-02-17

    Hi,
    I've been able to use minidlna (1.0.19 - standard Backfire package) installed on my openwrt router to serve files to Sony BDP-S370 blue-ray player. The problem is limited format support in the player through DLNA.

    I would like to be able to play flac files using minidlna but to be able to do that I would need to decode them to LPCM wav on the fly and also disguise them as mp3. This is because player does not support FLAC at all and LPCM wav is not supported via DLNA. When I share wav files renamed as mp3 they stream and play OK, so the only thing missing for me is transcoding (well, in the matter of fact - decoding) flac to LPCM wav.

    Is it possible to use minidlna with your patch to achieve this? I've managed to compile minidlna 1.0.22 with your patch on my Debian box, but it does not run on my router - "Applet not found". This probably has to do with missing mencoder on my OpenWrt Backfire but I have not been able to find mencoder package for openwrt.

    Another question, but this is less important one:
    Is it possible to use patched minidlna to transcode (in case of aac/aac+) or simply buffer (in case of mp3) the shoutcast radio stations and be able to feed them to blu-ray players this way?

    Any help appreciated.

     
  • hiero

    hiero - 2012-02-18

    hello gneomer,

    Yes. This patch can transcode flac to LPCM.

    This patch uses FFMPEG for audio transcoder.
    SO, you need to build FFMPEG. I think you know how to cross-compile.
    Download source code from following and build it and install on the router.
    http://ffmpeg.org/releases/ffmpeg-0.10.tar.gz

    Support shoutcast:
    Technically yes.
    I will upload the new patch soon.
    It will experimentally support shoutcast.

    Hiero

     
  • hiero

    hiero - 2012-02-18

    patch against 1.0.24 is uploaded.
    I tested on Ubuntu 11.10 and Windows7.

    50Hz(PAL) support is added.

    SHOUTcast support is added.
    Instruction is in "Note-for-MiniDLNA-cygwin-transcode-1.0.24.txt"

     
  • Zoli

    Zoli - 2012-02-18

    Hi Hiero,
    Thanks for all the work.
    I built the 1.0.24 with the patch, but now I get the following error:
    parsing error file /etc/minidlna.conf line 104 : transcode_video_transcoder_pal=mencoder
    Looks like the new pal transcoder option is not recognized.

    I was experimenting with 1.0.22 earlier, could get it up and running on Ubuntu server 11.10. However transcoding function never seem to have started.
    My ultimate goal would be to use ffmpeg to covert format to stream to iPad. I was testing with iPad and XBMC on PC running WinXP, but no luch, could not see any alternative formats, always only the originals. What I might be doing wrong? Can this be due to DLNA client capabilities?
    Thanks a lot, Zoltan

     
  • hiero

    hiero - 2012-02-18

    Hello zolizzz,

    Thanks for the error report. I will fix it.

    What client software are you using on iPAD? This patch transcode to MPEG2 video/AC3 audio only for video files. I think your client software supports only H264 or MPEG4.
    Clients get transcoded only for the codecs which the client deos not support.
    Because XMBC supports most codecs, you see only originals.

    Hiero

     
  • hiero

    hiero - 2012-02-18

    patch against 1.0.24 is uploaded.
    parsing error for PAL was fixed.

    Unfortunately, I do not have 50Hz(PAL) TV(client).
    More issues may be included.
    Please test it.

     
  • joost

    joost - 2012-02-19

    I do live in PAL country, but I dont see why PAL support is needed.

    Any modern video equipment can handle both standards and convert framerates when needed. Even my previous century CRT could handle both PAL and NTSC analog input sources.

    Your default transcode_video_options change the framerates, resulting in choppy playback with a lot of content.
    TV sets are often 100Hz (or 120Hz for NTSC) and sometimes much higher than that. This means that converting 23.976023fps to 100(120)Hz gives MUCH better result than first converting it to 25Hz at the server side.
    My Bravia TV plays any framerate you throw at it, perfectly smooth. I bet this is the same for a lot of equipment out there.

    The script I am using with the transcode patch does not change the original framerate, so special PAL handling is not needed.
    That helper script is easy to use. You can make changes, then save and press pause/play on the remote and you see the result immediately. You do not need te restart the server.
    But there is one improvement I would like to see, that minidlna would pass the file and client properties to the script, for example by means of environment vars. Then the script can decide how to handle the content based on framerate, video format, client name, supported client codecs, etc...

    The shoutcast feature can also be implemented in script, you dont need to change the source for that.
    I included a live streaming example in my latest script:
    http://agris.nl/files/transcode.sh

     
  • Zoli

    Zoli - 2012-02-20

    Hi Hiero,

    thanks for your reply and the correction patch. I installed it and the parsing error is now gone.
    You are right, iPad takes MPEG4, H.264, but I did not understand the mechanism. So I will try to create options for ffmpeg to create the stream and let you know the result.
    Regards,
    Zoltan

     
  • hiero

    hiero - 2012-02-21

    Hello joost69,

    I understand what you wrote. My concern is previous patch always present "protocolInfo" : DLNA.ORG_PN=MPEG_PS_NTSC. In the case of 25Hz contents, this is incorrect. If the client accept only "MPEG_PS_PAL", transcode function does not work. If the client determines frame rate based on protocolInfo, it will be problem. Even if the Sony TV gets "MPEG_PS_NTSC" for all frame rate and handle correctly, I am not sure for other clients. I will consider better way to address the concern.

    I have the same concern regarding shoutcast(streaming). Currently, presented "duration" comes from duration of the specified files. Some clients may stop playing at the time duration time passed. I will update to present No "duration".

    hiero

     
  • hiero

    hiero - 2012-02-21

    Hello zolizzz,

    iPad requires MP4 container. FFMPEG can not format in MP4 for on the fly streaming. The reason is MP4 container requires "seekable" access. This is the problem to support iPad/iPhone.

    Hiero

     
<< < 1 2 3 4 > >> (Page 2 of 4)

Log in to post a comment.