Work at SourceForge, help us to make it a better place! We have an immediate need for a Support Technician in our San Francisco or Denver office.


#32 support transcode Video and Audio


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.



<< < 1 2 3 4 .. 19 > >> (Page 2 of 19)
  • hiero

    support transcode Video and Audio patch against 1.0.19

  • hiero

    patch against 1.0.19 is added.
    I tested on Ubuntu 10.04 and 11.04 alpha

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

  • P Walden
    P Walden

    I built and executed the 1.0.19 patch successfully on Fedora 14. Thank you!

    One thing I noticed while reviewing a log of the debug mode output is that the transcoder, in my case ffmpeg, gets run repeatedly many times for the same source video. From my blu-ray player I do not see any outward affect of this. So I would not have noticed it unless I reviewed the log.

    Do you know why the log has several transcoder exec's per video viewing?

  • HTTP-REQUESTs are issued twice for every play back from my Toshiba TV.
    I guess TV gets detailed parameters of the stream at the first time,
    then issues HTTP-REQUEST to start real play back .
    I think it depends on rendere's(TV's) implementasion of DLNA.

  • Is the -ofps option really necessary? I have material in 24p, 25p, 30p, 50i, 60i and removing the option was the only solution I found to keep video and audio in reasonable sync for all material.

  • It looks like it's only in exec_transcode that any differentiation is made between mencoder and ffmpeg, and only some extra options are added to produce the pipe.

    Why not make the transcoding program independent? As an example, the following would be specified in the config instead:

    transcode_video_options=(all previous options) -o -


    transcode_video_options=-i (all previous options) pipe:1


    transcode_video_options=(new options)

    and so on...

  • Why is the PS3 not deinterlacing content that has been transcoded, when it is for non-transcoded material? Changing the harddup option to pp=fd deinterlaces the data before sending it, but it would be much better to let the PS3 do it.

  • P Walden
    P Walden

    The -ofps sets the frame per second to 30. At least my player expects 30fps. I tried it without the -ofps and I get sound but no picture.

  • hiero

    hmmm, interesting

    for my contents and renderer(TV/BDP/players).
    mencoder with default(hard coded) options works best.
    other than "-ofps 30000/1001" makes AV sync issues.

    for some contents and renderer.
    "-ofps 24000/1001" is the best

    for some contents and renderer.
    not specify -ofps is the best

    for some contents and renderer.
    ffmpeg with default options is the best.

    At the first, I thought it is possible to find out
    almighty transcoder/options combination.
    But, it turns out impossible.

    by the way,
    following parameters are needed to be specified internally.

    - source path/filename
    - start time (position) in second
    - duration in second

    it is different how to specify them between transcoders.
    following might work for the transcoders including unknown one.

    define key words:

    user specify options as following.

    for mencoder
    transcode_video_mencoder_options=-ss $STARTPOSITION -endpos $DURATION
    transcode_video_mencoder_options=-msglevel all=-1 -really-quiet -oac lavc
    transcode_video_mencoder_options=-of mpeg -mpegopts format=mpeg2:muxrate=8000:vbuf_size=1194:abuf_size=64 -vf scale=720:480,harddup -ovc lavc -channels 2
    transcode_video_mencoder_options=-lavdopts debug=0 -lavcopts autoaspect=1:vcodec=mpeg2video:vbitrate=8000:acodec=ac3:abitrate=128:keyint=18:vqscale=1:vqmin=2
    transcode_video_mencoder_options=-subdelay 20000 -ofps 30000/1001 -mc 0 -noskip -af lavcresample=48000 -srate 48000
    transcode_video_mencoder_options=-o- $SOURCE

    for ffmpeg
    transcode_video_ffmpeg_options=-ss $STARTPOSITION -t $DURATION -i $SOURCE -v 0 -loglevel quiet -target ntsc-dvd pipe:1

  • Another possibility would be to use a wrapper (in which you could use mediainfo on $SOURCE to determine the best action, for example to deinterlace or not) like this: $SOURCE $STARTPOSITION $DURATION

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