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
Hi Hieroun,
Thanks for the explanation. I understand the issue now, you cannot read or modify the protocol info from script. It would be nice if it could though..
The Bravia accepts any input, I bet it does not even look at the protocol info. When i use the wrong mux or codec, it just displays garbage.
I noticed the same thing with the duration issue. I was passing the duration info from the file directly to mencoder, while substituting the file for a stream. Then I was surprised it suddenly stopped playing ;)
Now I dont pass duration info to mencoder for streams and when the Bravia reaches the end of the imaginary file it keeps playing, but I guess that may not be the same for all players.
Hello joost69,
Yes. It is OK for transcodder not to specify duration. However, you can see "duration="x:xx:xx.xxx" before protocolInfo= with -d option. I am not sure whether most clients use it or not.
Anyway, I think your script works fine for a lot of clients.
Thanks,
Hiero
Hi there.
I think i asked minidlna to use ffmpeg as transcoder/demuxer, but in debug log i still see it have been changed to mencoder with some kind of default settings.
minidlna.conf:
...
transcode_video_transcoder=ffmpeg
transcode_video_options="-ss $STARTPOSITION -i $SOURCE -vcodec copy"
transcode_video_options="-acodec copy -ab 640 -ar 48000 -ac 6 -vbsf h264_mp4toannexb -f mpegts"
transcode_video_options="-v 0 -loglevel quiet pipe:1"
...
debug output:
...
2012/02/24 19:09:30] upnphttp.c:1655: info: start transcode and send data
[2012/02/24 19:09:30] upnphttp.c:1657: info: fork/exec MENCODER/FFMPEG, PPID=29154, PID=29155
[2012/02/24 19:09:30] upnphttp.c:1559: info: exec mencoder as following:
mencoder -ss 0.0 -endpos 7648.192 -msglevel all=-1 -really-quiet -oac lavc -of mpeg -mpegopts format=mpeg2:muxrate=8000:vbuf_size=1194:abuf_size=64 -vf scale=720:576,harddup -ovc lavc -channels 2 -lavdopts debug=0 -lavcopts autoaspect=1:vcodec=mpeg2video:vbitrate=8000:acodec=ac3:abitrate=128:keyint=25:vqscale=1:vqmin=2 -subdelay 20000 -ofps 25 -mc 0 -noskip -af lavcresample=48000 -srate 48000 -o - "/media/maa/Movies/mkv_aac_ac3/Agora (2009)/Agora (2009).mkv"
..
Panasonic Viere TV start playing after while, but with manu pauses :(
Using minidlna CVS + transcoding patch against 1.0.24.
Any ideas why its acting like that?
Hello normaal,
It seems you are using 50Hz(PAL) based TV.
specify following option.
transcode_video_transcoder_pal=ffmpeg
Hiero
Hi Hieroun.
Switching to 'transcode_video_transcoder_pal' really switched to ffmpeg as transcoder. But its probably still ignoring my remuxing options (minidlna.conf is in earlier post):
[2012/02/25 09:25:21] upnphttp.c:2592: info: last_file.mime=video/x-matroska
[2012/02/25 09:25:21] upnphttp.c:1655: info: start transcode and send data
[2012/02/25 09:25:21] upnphttp.c:1657: info: fork/exec MENCODER/FFMPEG, PPID=3014, PID=3041
[2012/02/25 09:25:21] upnphttp.c:1559: info: exec ffmpeg as following:
ffmpeg -ss 0.0 -t 10689.472 -i "/media/maa/Movies/mkv_aac_ac3/Avatar (2009)/Avatar (2009).mkv" -v 0 -async 1 -target pal-dvd pipe:1
btw, TV introduse itself as:
X-PANASONIC-Registration: VklFUkEAAAAAAAAAAAAAAAAAAAAAAAAAAAA=
X-PANASONIC-DMP-Profile: MPEG_PS_PAL JPEG_SM PV_DIVX_DIV3 PV_DIVX_DIV4 PV_DIVX_DIVX PV_DIVX_DX50 PV_DRM_DIVX_DIV3 PV_DRM_DIVX_DIV4 PV_DRM_DIVX_DIVX PV_DRM_DIVX_DX50
Hello normaal,
Sorry, I made mistake in sample "minidlna.conf".
Replace "transcode_video_options" with "transcode_video_options_pal" as following.
----
transcode_video_transcoder_pal=ffmpeg
transcode_video_options_pal="-ss $STARTPOSITION -i $SOURCE -vcodec copy"
transcode_video_options_pal="-acodec copy -ab 640 -ar 48000 -ac 6 -vbsf h264_mp4toannexb -f mpegts"
transcode_video_options_pal="-v 0 -loglevel quiet pipe:1"
----
I need to correct sample "minidlna.conf".
Hiero
patch against 1.0.24 is uploaded.
SHOUTcast support is improved.
The way to specify address is changed.
Instruction is in "Note-for-MiniDLNA-transcode.txt".
patch against 1.0.24(minidlna_transcode_1.0.24-3.tar.gz) is uploaded.
"force transcoding" support is added.
Instruction is in "Note-for-MiniDLNA-transcode.txt".
Hiero
patch against 1.0.24(minidlna_transcode_1.0.24-4.tar.gz) is uploaded.
transcode process handling is improved.
Hiero
support transcode Video and Audio patch against 1.0.24 support Linux and Cygwin
Hi again.
I have tried to use your transcoding patch a few times allready, but unfortunately without big success. Default settings for ffmpeg is like slideshow on my low profile dlna server
(not enoght CPU power for full transcode), my custom options (only remux to new container) doesn not start streaming pipe in some reason.
As someone once before, i recomend a bit different concept for transcode.
1) separete hardcoded transcoding from mainstream code. Put all transcoding options and logic to bash scripts to get full dynamic usage. In mainstream code keep only minimum logic
for calling out transcoder(s) for some filetypes and/or some clients and handling transcoder output (pipe) as input for minidlna streamingg capabilities.
Then more people can provide profiles and options to get needed configurations to work. I have some scripts from MediaTomb and they are working on my Panasonic Viera.
# minidlna.conf transcode profiles lines. or section by client
# n=5 fields: extensions array, somekindof client_pattern from request script, SOURCE file, additional options to use directly in ffmpeg or mencoder or analysed by script.
transcoder=[mkv][PANASONIC_tv xx yy zz][/root/bin/transcoder-common.sh][$SOURCE][-]
transcoder=[mp3,LPCM][ipad][ffmpeg][$SOURCE][-v 0 -acodec pcm_s16be -f s16be -ar 4410]
transcoder=[mov][*][/root/bin/transcoder-mov.sh][$SOURCE][-]
transcoder=[mp4][PANASONIC_tv][ffmpeg][$SOURCE][-ss $STARTPOSITION -t $DURATION -i $SOURCE -v 0 -loglevel quiet -async 2 -target pal-dvd pipe:1]
transcoder=[mov][*][/usr/bin/mencoder][$SOURCE][x x x]
What doesn't go under any transcoding profile line (extension/client pairs) these will be streamed directly by minidlna with or without success depending from client potential.
ps. terjeio made some part of that handlers coding, but patch or code was never posted. I hope that this work can be used as well ;)
On debian I have errors after "make" (ver.1.0.24-4) please help
Compiling metadata.c
metadata.c: In function ‘GetVideoMetadata’:
metadata.c:715:2: warning: ‘av_find_stream_info’ is deprecated (declared at /usr/include/libavformat/avformat.h:1526) [-Wdeprecated-declarations]
metadata.c:737:3: warning: ‘av_close_input_file’ is deprecated (declared at /usr/include/libavformat/avformat.h:1706) [-Wdeprecated-declarations]
metadata.c:1538:4: warning: ‘AVMetadataTag’ is deprecated (declared at /usr/include/libavutil/dict.h:77) [-Wdeprecated-declarations]
metadata.c:1541:4: warning: ‘av_metadata_get’ is deprecated (declared at /usr/include/libavformat/avformat.h:251) [-Wdeprecated-declarations]
metadata.c:1558:2: warning: ‘av_close_input_file’ is deprecated (declared at /usr/include/libavformat/avformat.h:1706) [-Wdeprecated-declarations]
Compiling scanner.c
scanner.c: In function ‘insert_containers’:
scanner.c:168:4: warning: format ‘%lX’ expects argument of type ‘long unsigned int’, but argument 3 has type ‘sqlite_int64’ [-Wformat]
scanner.c:191:4: warning: format ‘%lX’ expects argument of type ‘long unsigned int’, but argument 3 has type ‘sqlite_int64’ [-Wformat]
scanner.c:203:4: warning: format ‘%lX’ expects argument of type ‘long unsigned int’, but argument 4 has type ‘sqlite_int64’ [-Wformat]
scanner.c:272:5: warning: format ‘%lX’ expects argument of type ‘long unsigned int’, but argument 3 has type ‘sqlite_int64’ [-Wformat]
scanner.c:277:5: warning: format ‘%lX’ expects argument of type ‘long unsigned int’, but argument 4 has type ‘sqlite_int64’ [-Wformat]
scanner.c:293:5: warning: format ‘%lX’ expects argument of type ‘long unsigned int’, but argument 4 has type ‘sqlite_int64’ [-Wformat]
scanner.c:314:5: warning: format ‘%lX’ expects argument of type ‘long unsigned int’, but argument 3 has type ‘sqlite_int64’ [-Wformat]
scanner.c:319:5: warning: format ‘%lX’ expects argument of type ‘long unsigned int’, but argument 4 has type ‘sqlite_int64’ [-Wformat]
scanner.c:334:5: warning: format ‘%lX’ expects argument of type ‘long unsigned int’, but argument 4 has type ‘sqlite_int64’ [-Wformat]
Hello gorata,
No error is found in your log.
The line numbers in scanner.c look different from 1.0.24.
Have you patched against 1.0.24 source?
Hiero
Hi there.
Still wrestling with 1.0.24-4 patch on ARM :)
1) When using ffmpeg and option directly on minidlna.conf:
transcode_video_transcoder_pal=ffmpeg
transcode_video_options_pal=$SOURCE $STARTPOSITION $DURATION
it result ffmpeg to run shortly and cancelation with message:
File '/media/maa/Movies/mkv_aac_ac3/Cube (1997)/Cube (1997).mkv' already exists. Overwrite ? [y/N] [2012/03/27 20:52:51] upnphttp.c:1681: debug: poll error : No data in Pipe
[2012/03/27 20:52:51] upnphttp.c:1721: info: kill PID(7244) : No child processes
[2012/03/27 20:52:51] upnphttp.c:1730: info: total bytes : read=0, send=0
2)When using a bit more advanced options:
transcode_video_transcoder_pal=ffmpeg
transcode_video_options_pal='-ss $STARTPOSITION -t $DURATION-i $SOURCE -vcodec copy'
transcode_video_options_pal='-acodec copy -ab 640 -ar 48000 -ac 6 -vbsf h264_mp4toannexb -f mpegts'
transcode_video_options_pal='-v 0 -loglevel quiet pipe:1'
it result cancelation with:
[2012/03/27 21:02:03] upnphttp.c:1581: info: exec ffmpeg as following:
ffmpeg '-ss 0.0 -t 5417.120-i "/media/maa/Movies/mkv_aac_ac3/Cube (1997)/Cube (1997).mkv" -vcodec copy' '-acodec copy -ab 640 -ar 48000 -ac 6 -vbsf h264_mp4toannexb -f mpegts' '-v 0 -loglevel quiet pipe:1'
[2012/03/27 21:02:03] upnphttp.c:1687: info: reached to EOF in PID:7282
[2012/03/27 21:02:03] upnphttp.c:1721: info: kill PID(7283) : No child processes
[2012/03/27 21:02:03] upnphttp.c:1730: info: total bytes : read=0, send=0
3) when same option is given without ' or ":
transcode_video_transcoder_pal=ffmpeg
transcode_video_options_pal=-ss $STARTPOSITION -t $DURATION-i $SOURCE -vcodec copy
transcode_video_options_pal=-acodec copy -ab 640 -ar 48000 -ac 6 -vbsf h264_mp4toannexb -f mpegts
transcode_video_options_pal=-v 0 -loglevel quiet pipe:1
it result offcource syntax error right away when starting minidlna
/etc/minidlna.conf: line 78: -t: command not found
/etc/minidlna.conf: line 79: copy: command not found
/etc/minidlna.conf: line 80: 0: command not found
4) calling transcoding script:
transcode_video_transcoder_pal=/srv/minidlna/transcode-common.sh
transcode_video_options_pal=$SOURCE $STARTPOSITION $DURATION
which then calls out command:
ffmpeg -threads 2 -i "${INPUT}" -vcodec copy -acodec copy -vbsf h264_mp4toannexb -f mpegts -y pipe:1
it gives like streaming in logs, but no picture on tv ("pleas wait"... "cannot read file"). The number on last line starts
increasing/changing btw.
[2012/03/27 21:10:55] upnphttp.c:1658: info: start transcode and send data
[2012/03/27 21:10:55] upnphttp.c:1660: info: fork/exec MENCODER/FFMPEG, PPID=7340, PID=7341
[2012/03/27 21:10:55] upnphttp.c:1530: debug: streaming from: /media/maa/Movies/mkv_aac_ac3/Cube (1997)/Cube (1997).mkv
[2012/03/27 21:10:55] upnphttp.c:1581: info: exec /srv/minidlna/transcode-common.sh as following:
/srv/minidlna/transcode-common.sh "/media/maa/Movies/mkv_aac_ac3/Cube (1997)/Cube (1997).mkv" 0.0 5417.120
ffmpeg version N-37208-g01fcbdf Copyright (c) 2000-2012 the FFmpeg developers
built on Feb 8 2012 17:28:52 with gcc 4.6.2 20120120 (prerelease)
configuration: --prefix=/usr --enable-libmp3lame --enable-libvorbis --enable-libxvid --enable-libx264 --enable-libvpx --enable-libtheora --enable-libgsm --enable-libspeex --enable-postproc --enable-shared --enable-x11grab --enable-libopencore_amrnb --enable-libopencore_amrwb --enable-libschroedinger --enable-libopenjpeg --enable-librtmp --enable-libpulse --enable-gpl --enable-version3 --enable-runtime-cpudetect --disable-debug --disable-static
libavutil 51. 34.101 / 51. 34.101
libavcodec 53. 60.100 / 53. 60.100
libavformat 53. 31.100 / 53. 31.100
libavdevice 53. 4.100 / 53. 4.100
libavfilter 2. 60.100 / 2. 60.100
libswscale 2. 1.100 / 2. 1.100
libswresample 0. 6.100 / 0. 6.100
libpostproc 52. 0.100 / 52. 0.100
Input #0, matroska,webm, from '/media/maa/Movies/mkv_aac_ac3/Cube (1997)/Cube (1997).mkv':
Duration: 01:30:17.12, start: 0.000000, bitrate: 5866 kb/s
Stream #0:0: Video: h264 (High), yuv420p, 1280x704, SAR 1:1 DAR 20:11, 24 fps, 24 tbr, 1k tbn, 48 tbc (default)
Stream #0:1(eng): Audio: ac3, 48000 Hz, 5.1(side), s16, 448 kb/s (default)
[mpegts @ 0x3bb10] muxrate VBR, pcr every 2 pkts, sdt every 200, pat/pmt every 40 pkts
Output #0, mpegts, to 'pipe:1':
Metadata:
encoder : Lavf53.31.100
Stream #0:0: Video: h264, yuv420p, 1280x704 [SAR 1:1 DAR 20:11], q=2-31, 24 fps, 90k tbn, 24 tbc (default)
Stream #0:1(eng): Audio: ac3, 48000 Hz, 5.1(side), 448 kb/s (default)
Stream mapping:
Stream #0:0 -> #0:0 (copy)
Stream #0:1 -> #0:1 (copy)
Press [q] to stop, [?] for help
frame= 5039 fps= 83 q=-1.0 size= 207466kB time=00:03:29.87 bitrate=8098.0kbits/s
What i am doning wrong as anyone else gets transcodings and i get nothing lol.
If same transcoder is called from Mediatomb then is executed command:
ffmpeg -threads 2 -i /media/maa/Movies/mkv_aac_ac3/Cube (1997)/Cube (1997).mkv -vcodec copy -acodec copy -map 0:0 -map 0:1 -vbsf h264_mp4toannexb -f mpegts -y /tmp/mt_transcode_IJV2BW 2>/dev/null
and movie starts at TV.
Hello hieroun,
I am wrestling with 1.0.24-4 patch too.
When I try a to transcode a FLAC file to MP3, the ffmpeg is started three times and killed immediatly. I believe that the HTTP connections were closed in the meantime.
My environment:
* media server:
- minidlna-1.0.24 with minidlna_transcode1.0.24-4
- on Debian squeezeplug Linux 2.6.38-8
- running on a Seagate GoFlex Net, arch=ARMv5TE
* media client:
- Windows Media Player 12.0.7601.17514
- on Windows 7 Home Premium SP1
The minidlna.log is shown below. Please contact me, if you need further informations.
Widi
---------
[2012/03/31 01:41:22] upnphttp.c:170: debug: Client found in cache. [type 100/entry 0]
[2012/03/31 01:41:22] upnphttp.c:944: debug: HTTP REQUEST: GET /MediaItems/35.flac HTTP/1.1
Accept: */*
User-Agent: Windows-Media-Player/12.0.7601.17514
TransferMode.DLNA.ORG: Streaming
Accept-Encoding: gzip, deflate
Host: 192.168.18.23:8200
Connection: Keep-Alive
[2012/03/31 01:41:22] upnphttp.c:2417: info: Serving DetailID: 35 [/music/Music/Blues Brothers/The Blues Brothers - Original Soundtrack Recording/11 Jailhouse Rock.flac]
[2012/03/31 01:41:22] upnphttp.c:2616: info: Following is the response
HTTP/1.1 200 OK
Content-Type: audio/x-flac
Content-Length: 21274761
transferMode.dlna.org: Streaming
Accept-Ranges: bytes
Connection: close
Date: Fri, 30 Mar 2012 23:41:22 GMT
EXT:
realTimeInfo.dlna.org: DLNA.ORG_TLAG=*
contentFeatures.dlna.org:
Server: Debian/6.0.4 DLNADOC/1.50 UPnP/1.0 MiniDLNA/1.0.24
[2012/03/31 01:41:22] upnphttp.c:1310: info: start sendfile, offset=0, end=21274760
[2012/03/31 01:41:22] upnphttp.c:1322: debug: sendfile error :: error no. 32 [Broken pipe]
[2012/03/31 01:41:22] upnphttp.c:292: debug: Range Start-End: 0 - -1
[2012/03/31 01:41:22] upnphttp.c:170: debug: Client found in cache. [type 100/entry 0]
[2012/03/31 01:41:22] upnphttp.c:944: debug: HTTP REQUEST: GET /MediaItems/35.flac HTTP/1.1
Cache-Control: no-cache
Connection: Keep-Alive
Pragma: getIfoFileURI.dlna.org
Accept: */*
Range: bytes=0-
User-Agent: NSPlayer/12.00.7601.17514 WMFSDK/12.00.7601.17514
GetContentFeatures.DLNA.ORG: 1
TransferMode.DLNA.ORG: Streaming
Host: 192.168.18.23:8200
[2012/03/31 01:41:22] upnphttp.c:2417: info: Serving DetailID: 35 [/music/Music/Blues Brothers/The Blues Brothers - Original Soundtrack Recording/11 Jailhouse Rock.flac]
[2012/03/31 01:41:22] upnphttp.c:2616: info: Following is the response
HTTP/1.1 206 OK
Content-Type: audio/x-flac
Content-Length: 21274761
Content-Range: bytes 0-21274760/21274761
transferMode.dlna.org: Streaming
Accept-Ranges: bytes
Connection: close
Date: Fri, 30 Mar 2012 23:41:22 GMT
EXT:
realTimeInfo.dlna.org: DLNA.ORG_TLAG=*
contentFeatures.dlna.org:
Server: Debian/6.0.4 DLNADOC/1.50 UPnP/1.0 MiniDLNA/1.0.24
[2012/03/31 01:41:22] upnphttp.c:1310: info: start sendfile, offset=0, end=21274760
[2012/03/31 01:41:22] upnphttp.c:170: debug: Client found in cache. [type 100/entry 0]
[2012/03/31 01:41:22] upnphttp.c:944: debug: HTTP REQUEST: GET /MediaItems/35.flac?WMContentFeatures=DLNA.ORG_OP=01;DLNA.ORG_CI=0;DLNA.ORG_FLAGS=01700000000000000000000000000000&WMHME=1&WMQ=1 HTTP/1.1
Accept: */*
User-Agent: NSPlayer/12.00.7601.17514 WMFSDK/12.00.7601.17514
Icy-Metadata: 1
Accept-Encoding: gzip, deflate
Host: 192.168.18.23:8200
Connection: Keep-Alive
[2012/03/31 01:41:22] upnphttp.c:2417: info: Serving DetailID: 35 [/music/Music/Blues Brothers/The Blues Brothers - Original Soundtrack Recording/11 Jailhouse Rock.flac]
[2012/03/31 01:41:22] upnphttp.c:2616: info: Following is the response
HTTP/1.1 200 OK
Content-Type: audio/x-flac
Content-Length: 21274761
transferMode.dlna.org: Streaming
Accept-Ranges: bytes
Connection: close
Date: Fri, 30 Mar 2012 23:41:22 GMT
EXT:
realTimeInfo.dlna.org: DLNA.ORG_TLAG=*
contentFeatures.dlna.org:
Server: Debian/6.0.4 DLNADOC/1.50 UPnP/1.0 MiniDLNA/1.0.24
[2012/03/31 01:41:22] upnphttp.c:1310: info: start sendfile, offset=0, end=21274760
[2012/03/31 01:41:22] upnphttp.c:1322: debug: sendfile error :: error no. 32 [Broken pipe]
[2012/03/31 01:41:22] upnphttp.c:1322: debug: sendfile error :: error no. 32 [Broken pipe]
[2012/03/31 01:41:22] upnphttp.c:292: debug: Range Start-End: 40960 - 21274760
[2012/03/31 01:41:22] upnphttp.c:170: debug: Client found in cache. [type 100/entry 0]
[2012/03/31 01:41:22] upnphttp.c:944: debug: HTTP REQUEST: GET /MediaItems/35.flac HTTP/1.1
Cache-Control: no-cache
Connection: Keep-Alive
Pragma: getIfoFileURI.dlna.org
Accept: */*
If-Unmodified-Since: Fri, 30 Mar 2012 23:38:26 GMT
Range: bytes=40960-21274760
User-Agent: NSPlayer/12.00.7601.17514 WMFSDK/12.00.7601.17514
GetContentFeatures.DLNA.ORG: 1
Host: 192.168.18.23:8200
[2012/03/31 01:41:22] upnphttp.c:2417: info: Serving DetailID: 35 [/music/Music/Blues Brothers/The Blues Brothers - Original Soundtrack Recording/11 Jailhouse Rock.flac]
[2012/03/31 01:41:22] upnphttp.c:2616: info: Following is the response
HTTP/1.1 206 OK
Content-Type: audio/x-flac
Content-Length: 21233801
Content-Range: bytes 40960-21274760/21274761
transferMode.dlna.org: Streaming
Accept-Ranges: bytes
Connection: close
Date: Fri, 30 Mar 2012 23:41:22 GMT
EXT:
realTimeInfo.dlna.org: DLNA.ORG_TLAG=*
contentFeatures.dlna.org:
Server: Debian/6.0.4 DLNADOC/1.50 UPnP/1.0 MiniDLNA/1.0.24
[2012/03/31 01:41:22] upnphttp.c:1310: info: start sendfile, offset=40960, end=21274760
[2012/03/31 01:41:23] upnphttp.c:1322: debug: sendfile error :: error no. 32 [Broken pipe]
[2012/03/31 01:41:23] upnphttp.c:170: debug: Client found in cache. [type 100/entry 0]
[2012/03/31 01:41:23] upnphttp.c:944: debug: HTTP REQUEST: GET /MediaItems/TranscodeAudio/MP3/35.flac HTTP/1.1
Accept: */*
User-Agent: Windows-Media-Player/12.0.7601.17514
TransferMode.DLNA.ORG: Streaming
Accept-Encoding: gzip, deflate
Host: 192.168.18.23:8200
Connection: Keep-Alive
[2012/03/31 01:41:23] upnphttp.c:2289: info: NET RADIO : SELECT ARTIST=Blues Brothers, ALBUM=The Blues Brothers - Original Soundtrack Recording
[2012/03/31 01:41:23] upnphttp.c:2417: info: Serving DetailID: 35 [/music/Music/Blues Brothers/The Blues Brothers - Original Soundtrack Recording/11 Jailhouse Rock.flac]
[2012/03/31 01:41:23] upnphttp.c:2616: info: Following is the response
HTTP/1.1 200 OK
Content-Type: audio/mpeg
TimeSeekRange.dlna.org : npt=0.0-198.93/198.93
transferMode.dlna.org: Streaming
Accept-Ranges: none
Connection: close
Date: Fri, 30 Mar 2012 23:41:23 GMT
EXT:
realTimeInfo.dlna.org: DLNA.ORG_TLAG=*
contentFeatures.dlna.org:
Server: Debian/6.0.4 DLNADOC/1.50 UPnP/1.0 MiniDLNA/1.0.24
[2012/03/31 01:41:23] upnphttp.c:2629: info: last_file.mime=audio/x-flac
[2012/03/31 01:41:23] upnphttp.c:1658: info: start transcode and send data
[2012/03/31 01:41:23] upnphttp.c:1660: info: fork/exec MENCODER/FFMPEG, PPID=22679, PID=22690
[2012/03/31 01:41:23] upnphttp.c:1530: debug: streaming from: /music/Music/Blues Brothers/The Blues Brothers - Original Soundtrack Recording/11 Jailhouse Rock.flac
[2012/03/31 01:41:23] upnphttp.c:1581: info: exec ffmpeg as following:
ffmpeg -ss 0.0 -t 198.94 -i "/music/Music/Blues Brothers/The Blues Brothers - Original Soundtrack Recording/11 Jailhouse Rock.flac" -v 0 -f mp3 -vn -acodec libmp3lame -ab 192k pipe:1
[2012/03/31 01:41:24] upnphttp.c:170: debug: Client found in cache. [type 100/entry 0]
[2012/03/31 01:41:24] upnphttp.c:944: debug: HTTP REQUEST: GET /MediaItems/TranscodeAudio/MP3/35.flac HTTP/1.1
Cache-Control: no-cache
Connection: Keep-Alive
Pragma: getIfoFileURI.dlna.org
Accept: */*
User-Agent: NSPlayer/12.00.7601.17514 WMFSDK/12.00.7601.17514
GetContentFeatures.DLNA.ORG: 1
TransferMode.DLNA.ORG: Streaming
Host: 192.168.18.23:8200
[2012/03/31 01:41:24] upnphttp.c:2289: info: NET RADIO : SELECT ARTIST=Blues Brothers, ALBUM=The Blues Brothers - Original Soundtrack Recording
[2012/03/31 01:41:24] upnphttp.c:2417: info: Serving DetailID: 35 [/music/Music/Blues Brothers/The Blues Brothers - Original Soundtrack Recording/11 Jailhouse Rock.flac]
[2012/03/31 01:41:24] upnphttp.c:2616: info: Following is the response
HTTP/1.1 200 OK
Content-Type: audio/mpeg
TimeSeekRange.dlna.org : npt=0.0-198.93/198.93
transferMode.dlna.org: Streaming
Accept-Ranges: none
Connection: close
Date: Fri, 30 Mar 2012 23:41:24 GMT
EXT:
realTimeInfo.dlna.org: DLNA.ORG_TLAG=*
contentFeatures.dlna.org:
Server: Debian/6.0.4 DLNADOC/1.50 UPnP/1.0 MiniDLNA/1.0.24
[2012/03/31 01:41:24] upnphttp.c:2629: info: last_file.mime=audio/x-flac
[2012/03/31 01:41:24] upnphttp.c:1658: info: start transcode and send data
[2012/03/31 01:41:24] upnphttp.c:1660: info: fork/exec MENCODER/FFMPEG, PPID=22679, PID=22692
[2012/03/31 01:41:24] upnphttp.c:1530: debug: streaming from: /music/Music/Blues Brothers/The Blues Brothers - Original Soundtrack Recording/11 Jailhouse Rock.flac
[2012/03/31 01:41:24] upnphttp.c:1581: info: exec ffmpeg as following:
ffmpeg -ss 0.0 -t 198.94 -i "/music/Music/Blues Brothers/The Blues Brothers - Original Soundtrack Recording/11 Jailhouse Rock.flac" -v 0 -f mp3 -vn -acodec libmp3lame -ab 192k pipe:1
[2012/03/31 01:41:24] upnphttp.c:1703: debug: sendfile error :: error no. 104 [Connection reset by peer]
[2012/03/31 01:41:24] upnphttp.c:1721: info: kill PID(22691) : No child processes
[2012/03/31 01:41:24] upnphttp.c:1730: info: total bytes : read=3271, send=2644
[2012/03/31 01:41:25] upnphttp.c:485: debug: TimeSeekRange Start-End: 0.0 - -1
[2012/03/31 01:41:25] upnphttp.c:170: debug: Client found in cache. [type 100/entry 0]
[2012/03/31 01:41:25] upnphttp.c:944: debug: HTTP REQUEST: GET /MediaItems/TranscodeAudio/MP3/35.flac HTTP/1.1
Cache-Control: no-cache
Connection: Keep-Alive
Pragma: getIfoFileURI.dlna.org
Accept: */*
User-Agent: NSPlayer/12.00.7601.17514 WMFSDK/12.00.7601.17514
TimeSeekRange.DLNA.ORG: npt=0-
GetContentFeatures.DLNA.ORG: 1
Host: 192.168.18.23:8200
[2012/03/31 01:41:25] upnphttp.c:2289: info: NET RADIO : SELECT ARTIST=Blues Brothers, ALBUM=The Blues Brothers - Original Soundtrack Recording
[2012/03/31 01:41:25] upnphttp.c:2417: info: Serving DetailID: 35 [/music/Music/Blues Brothers/The Blues Brothers - Original Soundtrack Recording/11 Jailhouse Rock.flac]
[2012/03/31 01:41:25] upnphttp.c:2616: info: Following is the response
HTTP/1.1 206 OK
Content-Type: audio/mpeg
TimeSeekRange.dlna.org : npt=0.0-198.92/198.93
transferMode.dlna.org: Streaming
Accept-Ranges: none
Connection: close
Date: Fri, 30 Mar 2012 23:41:25 GMT
EXT:
realTimeInfo.dlna.org: DLNA.ORG_TLAG=*
contentFeatures.dlna.org:
Server: Debian/6.0.4 DLNADOC/1.50 UPnP/1.0 MiniDLNA/1.0.24
[2012/03/31 01:41:25] upnphttp.c:2629: info: last_file.mime=audio/x-flac
[2012/03/31 01:41:25] upnphttp.c:1658: info: start transcode and send data
[2012/03/31 01:41:25] upnphttp.c:1660: info: fork/exec MENCODER/FFMPEG, PPID=22679, PID=22694
[2012/03/31 01:41:25] upnphttp.c:1530: debug: streaming from: /music/Music/Blues Brothers/The Blues Brothers - Original Soundtrack Recording/11 Jailhouse Rock.flac
[2012/03/31 01:41:25] upnphttp.c:1581: info: exec ffmpeg as following:
ffmpeg -ss 0.0 -t 198.93 -i "/music/Music/Blues Brothers/The Blues Brothers - Original Soundtrack Recording/11 Jailhouse Rock.flac" -v 0 -f mp3 -vn -acodec libmp3lame -ab 192k pipe:1
[2012/03/31 01:41:25] upnphttp.c:1703: debug: sendfile error :: error no. 104 [Connection reset by peer]
[2012/03/31 01:41:26] upnphttp.c:1721: info: kill PID(22693) : No child processes
[2012/03/31 01:41:26] upnphttp.c:1730: info: total bytes : read=10168, send=9541
[2012/03/31 01:41:26] upnphttp.c:1703: debug: sendfile error :: error no. 32 [Broken pipe]
[2012/03/31 01:41:26] upnphttp.c:1721: info: kill PID(22695) : No child processes
[2012/03/31 01:41:26] upnphttp.c:1730: info: total bytes : read=3898, send=3271
Hello normaal,
Try to use the same options as used for Mediatomb.
----------
transcode_video_transcoder_pal=ffmpeg
transcode_video_options_pal=-ss $STARTPOSITION -t $DURATION -i $SOURCE -vcodec copy -acodec copy
transcode_video_options_pal=-map 0:0 -map 0:1 -vbsfh264_mp4toannexb -f mpegts
transcode_video_options_pal=-v 0 -loglevel quiet pipe:1
----------
hiero
Hello widigmx,
The same issue occurred on my Windows Media Player.
I found a way to fix it.
I will upload fixed version.
Hiero
support transcode Video and Audio patch against 1.0.24 support Linux and Cygwin
patch against 1.0.24(minidlna_transcode_1.0.24-5.tar.gz) is uploaded.
Fixed the issue for Windows Media Player.
Hiero
Hello Hiero.
Generally i am using same options for mediatomb: same script is called with only diffrenet output settings. I think the problem is with the pipe:1, mimetype presented by minidlna main code, or something with buffering?
But to be precise I checked again started with Mediatomb:
1)
Transcoding script called at Sat Mar 31 13:01:13 EEST 2012. Mediaplayer is mediatomb.
0 video h264
1 audio ac3
TEXT/UTF not found
-map 0:0 -map 0:1
executing final command:.
ffmpeg -threads 2 -i "/media/maa/Movies/mkv_aac_ac3/Cube (1997)/Cube (1997).mkv" -vcodec copy -acodec copy -map 0:0 -map 0:1 -vbsf h264_mp4toannexb -f mpegts -y /tmp/mt_transcode_GYPRBW 2>/dev/null.
That causes a maybe 10s buffering, and move starts ( Cube (1997).mkv ).
2)
minidlna.conf
transcode_video_transcoder_pal=ffmpeg
transcode_video_options_pal=-ss $STARTPOSITION -t $DURATION -i $SOURCE -vcodec copy -acodec copy -map 0:0 -map 0:1 -vbsf h264_mp4toannexb -f mpegts pipe:1
minidlna debgug log:
[2012/03/31 13:17:22] upnphttp.c:2629: info: last_file.mime=video/x-matroska
[2012/03/31 13:17:22] upnphttp.c:1658: info: start transcode and send data
[2012/03/31 13:17:22] upnphttp.c:1660: info: fork/exec MENCODER/FFMPEG, PPID=22249, PID=22256
[2012/03/31 13:17:22] upnphttp.c:1530: debug: streaming from: /media/maa/Movies/mkv_aac_ac3/Cube (1997)/Cube (1997).mkv
[2012/03/31 13:17:22] upnphttp.c:1581: info: exec ffmpeg as following:
ffmpeg -ss 0.0 -t 5417.120 -i "/media/maa/Movies/mkv_aac_ac3/Cube (1997)/Cube (1997).mkv" -vcodec copy -acodec copy -map 0:0 -map 0:1 -vbsf h264_mp4toannexb -f mpegts pipe:1
Input #0, matroska,webm, from '/media/maa/Movies/mkv_aac_ac3/Cube (1997)/Cube (1997).mkv':
Duration: 01:30:17.12, start: 0.000000, bitrate: 5866 kb/s
Stream #0:0: Video: h264 (High), yuv420p, 1280x704, SAR 1:1 DAR 20:11, 24 fps, 24 tbr, 1k tbn, 48 tbc (default)
Stream #0:1(eng): Audio: ac3, 48000 Hz, 5.1(side), s16, 448 kb/s (default)
[mpegts @ 0x3aef0] muxrate VBR, pcr every 2 pkts, sdt every 200, pat/pmt every 40 pkts
Output #0, mpegts, to 'pipe:1':
Metadata:
encoder : Lavf53.32.100
Stream #0:0: Video: h264, yuv420p, 1280x704 [SAR 1:1 DAR 20:11], q=2-31, 24 fps, 90k tbn, 24 tbc (default)
Stream #0:1(eng): Audio: ac3, 48000 Hz, 5.1(side), 448 kb/s (default)
Stream mapping:
Stream #0:0 -> #0:0 (copy)
Stream #0:1 -> #0:1 (copy)
Press [q] to stop, [?] for help
frame= 1286 fps= 96 q=-1.0 size= 43021kB time=00:00:53.49 bitrate=6587.4kbits/s
but tv probably time out for waiting sthe stream ...
Hello normaal,
Would you try following?
It includes "-v 0 -loglevel quiet" options.
----------
transcode_video_transcoder_pal=ffmpeg
transcode_video_options_pal=-ss $STARTPOSITION -t $DURATION -i $SOURCE
-vcodec copy -acodec copy
transcode_video_options_pal=-map 0:0 -map 0:1 -vbsfh264_mp4toannexb -f
mpegts
transcode_video_options_pal=-v 0 -loglevel quiet pipe:1
----------
hiero
no help. I can see from ps -ef, that ffmpeg is actually running in backround, but nothing get to tv. So the streaming goes, but to where ..?
debugLog is shorter now offcource :)
[2012/03/31 18:04:27] upnphttp.c:2629: info: last_file.mime=video/x-matroska
[2012/03/31 18:04:27] upnphttp.c:1658: info: start transcode and send data
[2012/03/31 18:04:27] upnphttp.c:1660: info: fork/exec MENCODER/FFMPEG, PPID=22932, PID=22938
[2012/03/31 18:04:27] upnphttp.c:1530: debug: streaming from: /media/maa/Movies/mkv_aac_ac3/Cube (1997)/Cube (1997).mkv
[2012/03/31 18:04:27] upnphttp.c:1581: info: exec ffmpeg as following:
ffmpeg -ss 0.0 -t 5417.120 -i "/media/maa/Movies/mkv_aac_ac3/Cube (1997)/Cube (1997).mkv" -vcodec copy -acodec copy -map 0:0 -map 0:1 -vbsf h264_mp4toannexb -f mpegts -v 0 -loglevel quiet pipe:1
Hello Hiero,
your fix for Windows Media Player 12 is installed and is working!
But now I recognized that encoding to MP3 is somewhat too heavy for my small ARM system. Therefore I changed to LPCM and all works fine (CPU load: approx. 10%)
Thank you for your famous work!
Widi
I made tcpdump from what mediatomb and minidlna offers from same directory.
I can see some differentsis. Is it possible to make minidlna options to disable PAL and NTSC res, and offer additional, mediatomb like res?
Right now my Panasonic TV trys to call PAL section and my custom transcoder (i know that from logs), but it fails (bechause of resolution or FLNA_ORG_FLAGS or file extension or ... )
br'
Normaal
-----------
mediatomb
<DIDL-Lite xmlns="urn:schemas-upnp-org:metadata-1-0/DIDL-Lite/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:upnp="urn:schemas-upnp-org:metadata-1-0/upnp/">
<item id="2150" parentID="2145" restricted="1">
<dc:title>Cube (1997).mkv</dc:title>
<upnp:class>object.item.videoItem</upnp:class>
<res duration="01:30:17.1" sampleFrequency="48000" nrAudioChannels="1" protocolInfo="http-get:*:video/mpeg;rate=48000;channels=1:DLNA.ORG_OP=00;DLNA.ORG_CI=1;DLNA.ORG_FLAGS=012000000000000000000000000000000">http://192.168.5.251:50000/content/media/object_id/2150/res_id/none/pr_name/transcode-common/tr/1</res>
</item>
<item id="2149" parentID=" ;2145" restricted="1">
<dc:title>Cube (1997).srt</dc:title>
<upnp:class>object.item.videoItem</upnp:class>
<res protocolInfo="http-get:*:text/srt:DLNA.ORG_OP=01;DLNA.ORG_CI=0" size="63491">http://192.168.5.251:50000/content/media/object_id/2149/res_id/0/ext/file.srt</res>
</item>
<item id="2146" parentID="2145" restricted=&q uot;1">
<dc:title>about.jpg</dc:title>
<upnp:class>object.item.imageItem</upnp:class>
<res protocolInfo="http-get:*:image/jpeg:DLNA.ORG_PN=JPEG_LRG;DLNA.ORG_OP=01;DLNA.ORG_CI=0" size="479232" resolution="1280x720">http://192.168.5.251:50000/content/media/object_id/2146/res_id/0/ext/file.jpg</res>
</item>
</DIDL-Lite> 5 5 0
-----------
-----------
minidlna
<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/" xmlns:pv="http://www.pv.com/pvns/">
<item id="64$1$4$0" parentID="64$1$4" restricted="1">
<dc:title>Cube (1997)</dc:title>
<upnp:class>object.item.videoItem</upnp:class>
<dc:date>2011-07-05T16:23:42</dc:date>
<res protocolInfo="http-get:*:image/jpeg:DLNA.ORG_PN=JPEG_TN">http://192.168.5.251:8200/AlbumArt/7-35.jpg</res>
<res size="397 2493312" duration="1:30:17.120" resolution="1280x704" pv:subtitleFileType="SRT" pv:subtitleFileUri="http://192.168.5.251:8200/Captions/35.srt" protocolInfo="http-get:*:video/x-matroska:DLNA.ORG_OP=01;DLNA.ORG_CI=0;DLNA.ORG_FLAGS=01700000000000000000000000000000">http://192.168.5.251:8200/MediaItems/35.mkv</res>
<res duration="1:30:17.120" resolution="720x480" protocolInfo="http-get:*:video/mpeg:DLNA.ORG_PN=MPE G_PS_NTSC;DLNA.ORG_OP=10;DLNA.ORG_CI=1;DLNA.ORG_FLAGS=01500000000000000000000000000000">http://192.168.5.251:8200/MediaItems/TranscodeVideo/NTSC/35.mkv</res>
<res duration="1:30:17.120" resolution="720x576" protocolInfo="http-get:*:video/mpeg:DLNA.ORG_PN=MPEG_PS_PAL;DLNA.ORG_OP=10;DLNA.ORG_CI=1;DLNA.ORG_FLAGS=01500000000000000000000000000000">http://192.168.5.251:8200/MediaItems/TranscodeVideo/PAL/35.mkv</res>
</item>
</DIDL-Lite> 1 1 9
-----------