DLNA/UPNP to stream of RECORDED TV TRANSCODED and streamed to android tablet...anyone have a solution they got working?
Added by jack jack almost 12 years ago
BASIC QUESTION: describe your setup if you have something like this working
GOAL: I'd like to take RECORDED TV shows (not live) and stream then (over wifi, from linux) to an an android tablet (tablet, not laptop, not raspberry pi, android tablet) so I can take it into the kitchen, velcro it to the cabinet while I cook.
SO FAR:- I have tvheadend installed and it can record and playback fine with XBMC frontend. File is saved as matroska container (mpeg2, AC3 audio)
- When I try and play files directly over tablet (smb, no nfs broswer that I know) they are pretty choppy, but then again it is 1080p video. (Does anyone out there have 1080p streaming to their tablets/phones? (I can do wifi to a raspberry pi, but not the tablets --too choppy).
- To counteract the high bandwidth of these 6gig+ files I'd like to transcode these files on the fly and send the downsample the videos to send off to the tablet
I'VE TRIED:
- mediatomb -- almost seemed to work but getting transcoding working right is a royal pain because the documentation is horrible
- seriivo -- again bad docs, couldn't even get any of the files to play with transcoding on or off
- universalmediaserver -- as far as I can tell this is not a dlna server proper as windows doesn't recognize it the same way it does the otehr servers
- minidlna -- no transcoding, there is a transcoding branch but the docs are nonexistent
- windows native dlna browsing
- foobar w/ plugin -- such a pain to get working so gave up
- xbmc -- could never see files on seriivo even though windows could
- android apps: Mediahouse, diceplayer,
Any suggestions you can provide would be very helpful
Thanks!
Replies (11)
RE: DLNA/UPNP to stream of RECORDED TV TRANSCODED and streamed to android tablet...anyone have a solution they got working? - Added by Eric Valette almost 12 years ago
Buy an android tablet able to decode 1080i. Any based on tegra3 will do... My wife use it on a daily basis :-)
RE: DLNA/UPNP to stream of RECORDED TV TRANSCODED and streamed to android tablet...anyone have a solution they got working? - Added by Markus Bonet almost 12 years ago
I am using VLC on Linux to transcode Live TV for this purpose. Daroon Player is able to play back this VLC stream.
I am pretty sure it's no difference if VLC is transcoding a live stream or a recorded file.
RE: DLNA/UPNP to stream of RECORDED TV TRANSCODED and streamed to android tablet...anyone have a solution they got working? - Added by jack jack almost 12 years ago
Thank you for your reply Eric and Marcus.
@Eric: I have a nexus 7 but it doesn't keep up. I don't think it's the CPU I think it might be the network (over wifi).
@Marcus: Do you use any dlna server, or is just some VLC command? or....?
RE: DLNA/UPNP to stream of RECORDED TV TRANSCODED and streamed to android tablet...anyone have a solution they got working? - Added by Eric Valette almost 12 years ago
I had to struggle to find a player that was able to use hardware acceleration. Try BSPlayer (free version).
RE: DLNA/UPNP to stream of RECORDED TV TRANSCODED and streamed to android tablet...anyone have a solution they got working? - Added by jack jack almost 12 years ago
Yes I've tried BSPlayer and several others. When hardware acceleration is enabled it plays for about 1 second.
a few more questions:
Are you doing this over wifi?
What transport method are you using? dlna? nfs? samba?
If dlna, what server are you using?
thanks
RE: DLNA/UPNP to stream of RECORDED TV TRANSCODED and streamed to android tablet...anyone have a solution they got working? - Added by Eric Valette almost 12 years ago
On a tablet, what can I use other than WiFi? I use minidlna as a server or http from tvhguide, or now directly xbmc on the tablet and HTSP. Everythings works..
RE: DLNA/UPNP to stream of RECORDED TV TRANSCODED and streamed to android tablet...anyone have a solution they got working? - Added by jack jack almost 12 years ago
You can copy them over to your tablet and play it off of internal memory ;). Are you playing shows recorded from tvheadend? If so, do you use .ts or matroska? Also I take it that you don't do any transcoding with minidlna? Do you have a good router? Do you know the make/model? Is it running in 'n-mode'?
Sorry for all the questions.
RE: DLNA/UPNP to stream of RECORDED TV TRANSCODED and streamed to android tablet...anyone have a solution they got working? - Added by Markus Bonet almost 12 years ago
Hi,
I use this:
cvlc --sout "#transcode{vcodec=h264,vb=2400,width=960,height=540,fps=25,acodec=mp3,ab=128,channels=2,samplerate=44100}:http{mux=ffmpeg{mux=
flv},dst=:<some_port>/<something>/}" --no-sout-rtp-sap --no-sout-standard-sap --ttl=1 --sout-keep --sout-transcode-threads 4 --sout-transcode-deinterlace <file_you_want_to_stream>
In the Daroon Player, I open this URL: http://<my_adress>:<some_port>/<something>/
As I said, I use this to stream live TV from tvheadend (for that I set "--sout-transcode-deinterlace"), so I can watch football on my phone or Nexus 7.
With this way, the playback starts immediately when the "cvlc" command is send. So you can't control the playback on your Nexus, which for live TV is not critical.
Markus
RE: DLNA/UPNP to stream of RECORDED TV TRANSCODED and streamed to android tablet...anyone have a solution they got working? - Added by Eric Valette almost 12 years ago
jack jack wrote:
You can copy them over to your tablet and play it off of internal memory ;). Are you playing shows recorded from tvheadend? If so, do you use .ts or matroska? Also I take it that you don't do any transcoding with minidlna? Do you have a good router? Do you know the make/model? Is it running in 'n-mode'?
Sorry for all the questions.
No I use WiFi and yes I do not any transcoding from minidlna. I want to watch live tv so copying would not be a solution. As for the router I'm using a Livebox from orange ;-)
RE: DLNA/UPNP to stream of RECORDED TV TRANSCODED and streamed to android tablet...anyone have a solution they got working? - Added by jack jack almost 12 years ago
Thanks Markus.
I just got something working, I think, so I didn't have a chance to use your solution. What I did was use a program called MediaInfo for windows to see what the saved streams contained. They are:
Matroska container
1 video stream: 13.Mbps 1920*1080 (16:9) at 29.970 fps. MPEG Video (Version 2)
1 audio stream: English 384, 48 KHz 16 bits, 6 channels, AC-3
1 audio stream: Spanish 192 Kbps, 48.0KHz 16 bits, 2 channels AC-3
With this info and a video clip I had that worked well I modfied an avconv command to properly stripout and downsample the stream.
For this to work with mediatomb:
1) Enable trancoding (change the proper section to "yes") in /etc/mediatomb/config.xml
2) Add the following profile:
<profile name="transcode-video" enabled="yes" type="external"> <mimetype>video/x-matroska</mimetype> <accept-url>yes</accept-url> <first-resource>yes</first-resource> <hide-original-resource>yes</hide-original-resource> <accept-ogg-theora>yes</accept-ogg-theora> <agent command="/opt/transcode-video" arguments="%in %out"/> <buffer size="1048576" chunk-size="26214" fill-size="52428"/> </profile>
Also add the following to your 'mimetype-profile-mappings' section:
<transcode mimetype="video/x-matroska" using="transcode-video"/> <transcode mimetype="video/x-flv" using="transcode-video"/> <transcode mimetype="video/x-quicktime" using="transcode-video"/> <transcode mimetype="video/realmedia" using="transcode-video"/>
Then create a bash script (/opt/transcode-video) with the following:
#!/bin/bash exec "/usr/bin/avconv" -threads 4 -i "$1" -c:v libx264 -profile:v high -level:v 41 -s 1280x720 -b 2953k -r 23.976 -map 0:v -map 0:a:0 -acodec ac3 -ar 48000 -ac 2 -ab 384000 -f matroska - > "$2"
This
- uses multiple cores (-threads 4, if you have the power, i think it's a bit much, and I'm going to try and drop this to 1)
- uses h264 codec with a [email protected] profile (I couldn't get the high profile to work) (-c:v libx264 -profile:v high -level:v 41
- downsamples the feed from 1080p (-s 1280x720)
- lowers the bandwidth from the (relatively) massive 13Mps (-b 4096k)
- drops the framerate to 25fps (-r 25)
- keep the video stream (-map 0:v)
- drops the second audio stream (spanish audio) (-map 0:a:0)
- passes the ac3 audio through with some minimal downsampling (-acodec ac3 -ar 48000 -ac 2 -ab 448000)
- wraps it all in a matroska container (-f matroska)
- the default for avconv is to encode with h.264 (for this command)
Tips for others doing something similar:
- Run your avconv command form the command line on a small file and check the output to see what it is saving it as
- I got some of this info from here: http://forevercached.syphzero.net/2012/03/ps3-mediatomb-debian-configuration-cont.html
I'm using an android app called 'MX Player' but I also tried several others (BSPlayer). I like MX Player in that it allows you to swap from h/w to s/w (to 'h/w+' encoding) right from the ui with a single tap. H/W+ encoding seems to work on some streams not not on everything. I think part of it might that my tvheadend setup was in progress when these were recorded or that they are PBS streams and they are different in some way (not sure).
Thanks everyone for the help.
RE: DLNA/UPNP to stream of RECORDED TV TRANSCODED and streamed to android tablet...anyone have a solution they got working? - Added by John Törnblom almost 12 years ago
There is a branch of tvheadend that does transcoding without setting up dlna.
Together with the android app TVHGuide, you can launch transcoded streams with an external player (BS Player for example) or play back using an internal one with some overlay eye candy.
Server branch: https://github.com/john-tornblom/tvheadend
Android app: http://john-tornblom.github.com/TVHGuide/
mplayer wrapper script: https://github.com/john-tornblom/playground/raw/master/tv
Sadly though, development is slow since I'm busy with my thesis, but if other developers wanna contribute, let me know.