#32 support transcode Video and Audio

open
nobody
None
5
2014-08-17
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 .. 8 > >> (Page 2 of 8)
  • hiero

    hiero - 2011-03-27

    I uploaded "minidlna_transcode_1.0.19_samsung-support_20110327.patch".
    please try it.

     
  • Comment has been marked as spam. 
    Undo

    You can see all pending comments posted by this user  here

    Anonymous

    Anonymous - 2011-03-27

    Thanks for the great patch. It is almost working. But I have the same problem as lkristensen mentioned in his comment "24000/1001 breaks A/V sync" with my Sony Bravia KDL-32V5500 TV.
    hieroun, you suggested some option for it, could you please tell me, what and where I need to change?

     
  • FifiTheReal

    FifiTheReal - 2011-03-27

    Hello hiero,

    Thank you for samsung support! It works fine!

    Bye, Fifi

     
  • Michalis Giannakidis

    Hello,

    I tested this patch on Ubuntu 9.04 with Samsung LE32B653 T2 TV. Some of the issues I had to deal with (DLNA Root menu not working, compilation problems), are reported here:
    https://sourceforge.net/tracker/?func=detail&atid=1121518&aid=3148380&group_id=243163 (comment 65, user mgiannakidis)

    In addition, I used the transcoding features introduced by this patch. I used the ffmpeg option. The default settings given in the .conf file, gave no improvement in my sample avis. While I was able to have sound on one of my two videos, after the transcoding patch, I had no sound in both videos.

    Could it be that I need different options for ffmpeg or a newer ffmpeg? How can I debug this problem?

    Thank you in advance

    Michalis

     
  • hiero

    hiero - 2011-03-28

    Hello,

    Following is how to change -ops option to "24000/1001".

    --------------------
    1) erase leading '#' of following lines in minidlna.conf

    #transcode_video_mencoder_options=

    2) replace "30000/1001" with "24000/1001" in fourth line
    of "transcode_video_mencoder_options=" lines.

     
  • hiero

    hiero - 2011-03-28

    Hello Michalis,

    I do not have Samsung TV. What I can do is import
    existing patch. It might be bettert to wait for stable
    samsung patch.

    Does mencoder works? mencoder is better for my contents and TV.
    An idea to check transcode is transcode contents off line
    and send it to TV via minidlna without on-the-fly transcoding.
    Adequate transcoder and options depends on contents and renderer(TV).
    It is very dufficult to suggest what transcoder and options works
    fine for each environment.

    heiro

     
  • Comment has been marked as spam. 
    Undo

    You can see all pending comments posted by this user  here

    Anonymous

    Anonymous - 2011-03-28

    hieroun, thank you so much. I made changes as your instructions:

    Following is how to change -ops option to "24000/1001".

    --------------------
    1) erase leading '#' of following lines in minidlna.conf

    #transcode_video_mencoder_options=

    2) replace "30000/1001" with "24000/1001" in fourth line
    of "transcode_video_mencoder_options=" lines.

    But, after changing fourth line with "24000/1001" it shows "Playback error message" for all mkv files. Before it was playing mkv files which are in 30000/1001 encoded format.

     
  • P Walden

    P Walden - 2011-03-28

    Himali,

    Players are all different in how fussy they are about the format of the transcoded videos. It also depends on your location as your player may be either ntsc-dvd or pal-dvd. For example my Sony blu-ray player only support playing ntsc-dvd formatted mpeg2 files at 30fps. Your symptoms are similar to the ones I had when trying different frame rates. When I tried 24fps, I got sound but no picture. The mplayer document here gives a good description of what is needed to be compliant

    http://www.mplayerhq.hu/DOCS/HTML/en/menc-feat-vcd-dvd.html

    Also, you can run your chosen transcoder (e.g ffmpeg or mencoder) stand-alone and test the mpeg2 files it generates on your player. In that way you can finalize the options you need to configure in minidlna.conf.

     
  • Comment has been marked as spam. 
    Undo

    You can see all pending comments posted by this user  here

    Anonymous

    Anonymous - 2011-03-28

    pcwalden Thank you so much for the guidance. I will test based on your suggestion.

     
  • Comment has been marked as spam. 
    Undo

    You can see all pending comments posted by this user  here

    Anonymous

    Anonymous - 2011-03-29

    pcwalden

    I could solve my problem. Could you please share which argument worked for you. My problem is similar to yours.

     
  • Comment has been marked as spam. 
    Undo

    You can see all pending comments posted by this user  here

    Anonymous

    Anonymous - 2011-03-29

    pcwalden

    I could not solve my problem. Could you please share which argument worked for
    you. My problem is similar to yours.

     
  • Nobody/Anonymous

    Hello Himali,

    Following options are related to AV sync.
    Try to remove them one by one to get better for your contents.
    harddup
    -mc 0
    -noskip
    -ofps 30000/1001
    though top three options improve A/V sync in general,
    they make side effects for some streams.

    hiero

     
  • Comment has been marked as spam. 
    Undo

    You can see all pending comments posted by this user  here

    Anonymous

    Anonymous - 2011-03-31

    hiero,
    Thank you so much. I will test line by line.

     
    Last edit: Anonymous 2014-09-03
  • hiero

    hiero - 2011-04-03

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

     
  • hiero

    hiero - 2011-04-03

    "minidlna_transcode_1.0.19_20110402.tar.gz " is uploaded.

    followings are changed from "minidlna_transcode_1.0.19_20110320.patch".

    1. options for transcodeing are slightly changed, read minidlna.conf
    2. streams which continer is "ogg" are supported.
    3. This pacth can be build under Linux and Cygwin without any modification.
    read "How to build on Cygwin.txt" to build on Cygwin.
    4. 3246932 - Add option to show only contents of "Browse Folders" is imported.

     
  • Lars Rönnbäck

    Lars Rönnbäck - 2011-04-05

    Trying your latest patch, it is still locked down to using either mencoder or ffmpeg for the transcoding. For example, in minidlna.c there is a section:

    case TRANSCODE_V_TRANSCODER:
    strcpy(transcoder_video, ary_options[i].value);
    if(strstr(ary_options[i].value, "mencoder") != NULL)
    transcode_video = TRANSCODE_VIDEO_MENCODER;

    I still cannot see why this cannot be done in a generic fashion, where you only concatenate the "transcode_video_transcoder" and "transcode_video_options" from the config file.

    I want to be able to specify "mencoder/ffmpeg/or_any_filename_here/DISABLE" for the "transcode_video_transcoder" option. That way I am free to use whatever transcoder I want, or as in my case, my own script using mediainfo to pull information from $SOURCE and based on that select the optimal transcoding options.

     
  • hiero

    hiero - 2011-04-06

    I tested followings. They work.

    transcode_video_transcoder=/usr/bin/mencoder
    transcode_video_options=-ss $STARTPOSITION -endpos $DURATION
    transcode_video_options=(other options)
    transcode_video_options=-o - $SOURCE

    or

    transcode_video_transcoder=./transcode.sh
    transcode_video_options=$SOURCE $STARTPOSITION $DURATION

    It is not recomended, following also work.

    transcode_video_transcoder=
    transcode_video_options=/usr/bin/ffmpeg -ss $STARTPOSITION -t $DURATION -i $SOURCE -v 0 -loglevel quiet -target ntsc-dvd pipe:1

    hiero

     
  • hiero

    hiero - 2011-04-09

    I got the FFMPEG options which has good A/V sync.
    If anyone has A/V sync issue, it is worth trying.

    minidlna.conf ----------
    transcode_video_transcoder=ffmpeg
    transcode_video_options=-ss $STARTPOSITION -t $DURATION -i $SOURCE -v 0 -loglevel quiet -async 1 -target ntsc-dvd pipe:1
    ----------

     
  • P Walden

    P Walden - 2011-05-08

    hello hieroun

    The latest cvs download supports native mp4 and mkv on my Sony BDP-S370. I selectively merged your minidlna_transcode_1.0.19_20110320.patch into this latest download.

    It seems to work. the mpeg2 and mp4 files do not get transcoded, while the other file types do get transcoded.

    You may want to produce another transcode patch as there have been many significant changes since 1.0.19

     
  • hiero

    hiero - 2011-05-15

    hello pcwalden

    I uploaded the patch against CVS 384.

    hiero

     
  • hiero

    hiero - 2011-06-11

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

     
  • hiero

    hiero - 2011-06-11

    patch against 1.0.20 is added.
    I tested on Ubuntu 11.04 and Windows7/Vista/XP.

    transcoder and transcode option can be specified in .conf file.
    read "minidlna.conf" after patch

     
  • AzaToth

    AzaToth - 2011-06-12

    I would recommend you to remove all #If 1 litter

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

Log in to post a comment.