You are not logged in.
i want to watch and listen to my media collection from my android phone.
the media resides on my kitchenserver, and the "streaming" to my desktop in the livingroom works perfectly via sshfs.
on my android phone things aren't so easy.
the hardware and the bandwidth are well capable of doing this (e.g. youtube videos or manually copied movies).
after some research i started using file managers that have sftp capabilities, but the amount of dropouts & hangups is too high.
i'm not exactly sure why this happens.
i'm using mobile broadband only for this.
i think using a dedicated media server on my debian server and a client for the phone, should help things go smoothly.
both should be FOSS (or at least close to it).
i haven't yet tried anything; the amount of different more or less specialised apps and servers is overwhealming.
what's the way to go?
Last edited by ohnonot (2015-12-22 18:51:55)
Offline
A.) Is there any way to get away from using mobile broadband? While there are plans that provide unlimited mobile broadband, they usually begin to throttle bandwidth after you use 6-10 gb of data. You then end up on the rough equivalent of dial-up til the plan resets.
B.) If you are stuck using mobile broadband, then it would be a good idea to think about a dlna server that offers on the fly transcoding to reduce bandwidth consumption. I have tried plex media server in the past and had reasonable success with it, though at that point in its development is was kind of a headache to set up and maintain. I think plex's phone apps are something you have to pay for, however. But it does have the advantage of being FOSS for at least the server portion. Keep in mind, if you decide to use on the fly transcoding that you will need some reasonably decent hardware to host the server on. My main issue with plex is the amount of meta data it collects. Over the years, I have simplified and use the same basic setup that you use over sshfs. I have not tried to integrate my phone or other mobile devices into that, however.
Offline
If @tknomanzr got you interested in Plex, I suppose you could also check out Emby. No personal experience though.
https://emby.media/
https://github.com/MediaBrowser
Offline
Is there any way to get away from using mobile broadband? While there are plans that provide unlimited mobile broadband, they usually begin to throttle bandwidth after you use 6-10 gb of data. You then end up on the rough equivalent of dial-up til the plan resets.
mobile broadband is very common hereabouts, and it's always flatrate.
i'm pretty sure the provider wouldn't get many customers if they did what you describe.
the flatrate is roofed by bandwidth, not data usage.
i think the bigger problem is that the industry is moving on to 4G and i'm using 3G, so while 3G is able to process plenty of bandwidth for my needs, i'm being treated a second class citizen = less bandwidth.
i also think i'm exeriencing more dropouts when i'm moving about; it stands to reason.
all these things are just suspicions, i have no way proving it one way or another.
the thing is, i think if my apps could deal with these things, i could have a pretty smooth experience on my phone.
that's why i thought a dedicated media server/client would be good.
both plex & emby are free, but their android clients are available only on the play store and offer some "in-app purchases". i guess one would have to try it out and see how far the limitations go.
emby seems to be "less commercial" than plex. both have good community support, it seems.
glitter, any particular reason why you suggested emby?
when one takes a closer look at the history of linux media servers, i think
it pretty much boils down to ampache & xbmc.
they're both capable of serving video as well as audio, and transcoding on the fly.
the bigger problem seems to be with the clients for android.
i've tried ampache meanwhile.
haven't tried in on the road yet, but at least with music streaming everything works on my phone (using this app currently, but others are available).
the cool thing is that ampache can understand other clients' protocols via plugins, so there's quite a few to choose from on f-droid, e.g. subsonic.
Offline
i think the bigger problem is that the industry is moving on to 4G and i'm using 3G, so while 3G is able to process plenty of bandwidth for my needs, i'm being treated a second class citizen = less bandwidth.
ISP/Telcos can't apply their predictive buffering algorithms and other voodoo to your own personal media streams like they can for web services like youtube, which might explain the dropouts you're facing, especially for a slower 3G connection. Just a wild guess on my part, so don't quote me or take me to court over it.
glitter, any particular reason why you suggested emby?
Well, Plex did get their asses hacked a few months ago. I didn't read far enough to find out how they handled it. How a company handles a breach is more important than the occurrence of the breach itself, in my view. If Plex handled the matter well enough (eg: more like Slack and less like Sony), then I suppose it should be alright. I'm not sure how much info you'll actually need to share with either of these companies when you sign up, though. Heck, I'm still not sure why one would need to sign-up for anything in the first place.
Edit:
Apparently, it was the Plex forum that got breached. There was an advisory stating users' plex.tv passwords were reset. Maybe you need to sign-up only for the TV services they provide, and not for server-to-device streaming?
xbmc
I think it's called Kodi now. Should be a potential solution as well. They seem to have a client for Android, though I didn't actually visit the Kodi or Google Play page to find out if it's a paid or free option. Sorry for not being much help. I've lost touch with many aspects of tech/computing over the last few years.
Last edited by glittersloth (2015-12-20 14:28:58)
Offline
'k, thanks anayway.
i'm well underway with ampache now.
in case someone wants to go there:
don't use the debian repos.
i think the easiest is to download this and install it manually like you would install a CMS, following these instructions.
dependencies for debian are here (but one of the devs warned me not to use the ampache-debian repo!).
the whole thing is called "Ampache reborn" and it really differs quite a lot from the ooold version in the debian repos.
i should now be able to access both music and video on my android phone, using a subsonic client.
whether all this actually improves my sistuation, we'll see. i'll report back.
Last edited by ohnonot (2015-12-22 18:33:53)
Offline
on my android phone things aren't so easy.
the hardware and the bandwidth are well capable of doing this (e.g. youtube videos or manually copied movies).
after some research i started using file managers that have sftp capabilities, but the amount of dropouts & hangups is too high, they simply aren't made for media streaming.
i'm using mobile broadband only for this.
i think using a dedicated media server on my debian server and a client for the phone, should help things go smoothly.
it is as i suspected; using a dedicated media server/client has smoothed things perfectly, i can watch movies and tv shows, even listen to .flac audio without transcoding it first!
i recap:
download and install ampache, git version (see previous post) to your server
on your android device: install DSub (supports both audio and video playback)
on your ampache install, activate the subsonic api (preferably by creating a dedicated user, plus some additional setup, see here
however, not all is rosy.
it seems that some media codecs aren't suitable for streaming, and i cannot stream all movies to my phone, even though they play nicely when i copy them to the sd card first.
there is a "transcode on the fly" option in ampache.
it works nicely with music, but not with video; i am still researching this, i think it's fixable.
maybe i'll need a stronger server...
Offline
I had similar issues at first with my NAS. What I found to help the most was running two ethernet connections in bridge mode. It might be useful to check your cpu useage while transcoding via top or htop over ssh if possible. However, my dell optiplex 740 was able to reliably transcode one movie. It would start to choke if a second was added. It was only a dual core 2.5 ghz or so with 2gb ram max so barring a lot of meta-data collection which can stress it, it should be able to transcode at least one movie at a time. That being said, I always store everything as .mp4 files, even if I have to run them through handbrake first to get them in the proper format.
Last edited by tknomanzr (2015-12-22 21:56:25)
Offline
It might be useful to check your cpu useage while transcoding via top or htop over ssh if possible.
it's definitely at 100%.
however, if i only transcode the audio and just copy the video stream, it does not take so much cpu.
and the ac3 audio does seem to be the culprit.
yet, it still doesn't result in something that android's mxplayer (android) is willing to play.
or my desktop browser (iceweasel).
That being said, I always store everything as .mp4 files, even if I have to run them through handbrake first to get them in the proper format.
interesting. why?
most of my video stuff is in mkv.
Last edited by ohnonot (2015-12-22 22:44:53)
Offline
I started enconding as .mp4 because I would stream videos to my smart tv and it would not recognize the .mkv file format. Even though .mp4 is proprietary and can include drm, it ends up being a more universal option than .mkv. That being said, I still have a few .mkv files around that I have not re-encoded.
What does your network topology look like from your router to the server itself? Are you running 100BaseT, 1000BaseT, etc. Reviewing what we know, we know that you were experiencing buffering problems both with and without transcoding (sshfs), so I would really begin to suspect the network.
My NAS came with two ethernet connections and they kind of expect me to use them both. I have them bridged in round-robin fashion. While I am no network engineer, I suspect that that second connection gives some failover in case the first is too busy to accept more packets. Plus, of all your options for hardware, that would likely be the cheapest, assuming you don't need a high-speed switch as well.
Offline
I'd probably search for a solution that can "cache transcode" at hour to hour.
Offline
tknomanzr, (and brontosaurus), are you assuming that my problem is either bandwidth- or performance related?
i'm still more in favor of finding the right transcoding command.
trying them locally and manually on the server, the results are weird:
i am now experimenting to "transcode" videos that i know to be working without transcoding, by simply copying them over to a new file (format).
it doesn't work.
the transcoding command:
avconv -i "Legs.mp4" -c copy -f avi pipe:1 | cat > test.aviends with:
video:87315kB audio:24628kB other streams:0kB global headers:0kB muxing overhead: 792.555847%and a 100MB mp4 file grows to a 900MB avi file.
i can play the file locally with mpv, but the length is "756453:32" or something.
both my browser and my phone refuse to play the resulting file, so it's not surprising that transcoding on the fly doesn't work, either?
trying the same with target mp4:
avconv -i "Legs.mp4" -c copy -f mp4 pipe:1 | cat > test.mp4returns:
avconv -i "04.03 - Legs.mp4" -c copy -f mp4 pipe:1 | cat > test.mp4
avconv version 11.4-6:11.4-1~deb8u1, Copyright (c) 2000-2014 the Libav developers
built on Jun 4 2015 19:43:21 with gcc 4.9.2 (Debian 4.9.2-10)
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from '04.03 - Legs.mp4':
Metadata:
major_brand : mp42
minor_version : 0
compatible_brands: mp42isomavc1
creation_time : 2013-10-02 00:25:22
encoder : HandBrake 0.9.9 2013052900
title : Archer - 04.03 - Legs
Duration: 00:21:01.13, start: 0.000000, bitrate: 732 kb/s
Stream #0.0(und): Video: h264 (High), yuv420p, 1280x720, 567 kb/s, 21.42 fps, 90k tbn, 180k tbc (default)
Metadata:
creation_time : 2013-10-02 00:25:22
encoder : JVT/AVC Coding
Stream #0.1(eng): Audio: aac, 48000 Hz, stereo, fltp, 159 kb/s (default)
Metadata:
creation_time : 2013-10-02 00:25:22
[mp4 @ 0x8210240] Codec for stream 0 does not use global headers but container format requires global headers
[mp4 @ 0x8210240] Codec for stream 1 does not use global headers but container format requires global headers
[mp4 @ 0x8210240] muxer does not support non seekable output
Output #0, mp4, to 'pipe:1':
Metadata:
major_brand : mp42
minor_version : 0
compatible_brands: mp42isomavc1
creation_time : 2013-10-02 00:25:22
title : Archer - 04.03 - Legs
encoder : Lavf56.1.0
Stream #0.0(und): Video: libx264, yuv420p, 1280x720, q=2-31, 567 kb/s, 90k tbn, 90k tbc (default)
Metadata:
creation_time : 2013-10-02 00:25:22
encoder : JVT/AVC Coding
Stream #0.1(eng): Audio: libvo_aacenc, 48000 Hz, stereo, 159 kb/s (default)
Metadata:
creation_time : 2013-10-02 00:25:22
Stream mapping:
Stream #0:0 -> #0:0 (copy)
Stream #0:1 -> #0:1 (copy)
Could not write header for output file #0 (incorrect codec parameters ?): Invalid argumentand trying to copy into an mkv gives:
"Requested output format 'mkv' is not a suitable output format"
i guess i'm going to have to research this transcoding business more.
Offline
If you have to manually figure out transcoding commands for specific platforms..., then what is "media server" actually for?
Offline
If you have to manually figure out transcoding commands for specific platforms..., then what is "media server" actually for?
this:
on my android phone things aren't so easy.
the hardware and the bandwidth are well capable of doing this (e.g. youtube videos or manually copied movies).
after some research i started using file managers that have sftp capabilities, but the amount of dropouts & hangups is too high, they simply aren't made for media streaming.
i'm using mobile broadband only for this.
i think using a dedicated media server on my debian server and a client for the phone, should help things go smoothly.
but hey, if you have suggestions, i'm listening!
i just happened to stumble upon ampache.
Offline
Well I have large quantities of ffmpeg droplets (packed for osx, but they are bash scripts around ffmpeg and friends) I could share, but I never actually tested any of those with android, I'll do some reading on what ampache (and plex perhaps) actually offers first.
On first look it appears that playlists and search are something that would be useful (compared to classical web server with file listing enabled).
---
Anyway I'd probably
a. use some web server with some pretty file-listing (like https://larsjung.de/h5ai/demo/) < need testing, how would playlists fit into this and so on ...
b. Figure out automagic (not on the fly) transcoding (script out something using ffmpeg and bash) < Actually this one should be enough to go back to sftp streaming and forget about "pretty" web interfaces.
b2. Consider phone resolution and max average bitrate that should work fine in your case (x264 can use crf mode with bitrate and buffer limiter or just use 1 or 2pass vbr mode). Also I'd probably use all the switches that have "fast" in them (like -tune fastdecode -preset fast or veryfast).
b3. Use latest ffmpeg, static compiles for loonix can be found at http://johnvansickle.com/ffmpeg/
b4. Guessing the speed: Let's say max 3G speed is around 5Mbits/s, so something reliable to stream should be about 5x less, I'd start encoding to 1Mbit/s and see what happens there. (Also test if perhaps ssh is maxing out your phones cpu)
test file (just under 1Mbit/s)
https://dl.dropboxusercontent.com/u/79532365/bbb.mp4
Last edited by brontosaurusrex (2015-12-23 11:17:04)
Offline
i've had some partial success with encoding on the fly - the key seems to be indeed to find the right avconv command.
the results (i always check both phone and desktop) have been extremely confusing.
i strongely suspect it's some evil limitation specific to android media drivers...
i am, however, in no way giving up on ampache and/or the whole foss media server approach.
if you have suggestions or ffmpeg/avconv command lines i can try for conversion that is suitable for android (subsonic) clients, i'm all ears (not sure what you mean by "droplets").
Offline
Actually this one should be enough to go back to sftp streaming and forget about "pretty" web interfaces.
i already said it several times in this thread, bandwidth is not the issue here.
i have bandwidth enough to watch even 1080 hdtv from my media server - it's just without sound, which seems to be a limitation on android, if the audio is in ac3, and comes over the network. that's the only reason i really need transcoding.
and the reason i set this whole thing up is not the "pretty" android client, but the fact that they handle things differently internally which enables me to watch and listen without stalling and dropouts.
Last edited by ohnonot (2015-12-23 21:45:57)
Offline
Ok, so mx player can have manually installed ac3 decoder from here http://forum.xda-developers.com/apps/mx … t-t2156254 (Just tested an avi file with ac3 and it is working), so that should kill any need for transcoding.
(tested on Samsung Galaxy Note 2014 Edition with Android 4.4.2)
Offline
unfortunately not.
all the videos in question play nicely when i copy them to my phone first, and play without sound when played over network. (*)
with or without the custom codec pack for mxplayer.
anyhow, this has long grown beyond what this thread was originally about.
i really hope i will get to the bottom of this eventually; the whole situation just reminds me why i like gnu/linux so much (the software is on your side)!
brontosaurusrex, before i delve deeper into transcoding, can you throw me a few command lines that help me to transcode to mp4 (audio should not be ac3) with minimum cpu stress?
it seems mp4 is the format that works best streaming to android phones.
(*)
could you test this by copying a video with ac3 audio to your server, then try to open it from your phones browser?
Last edited by ohnonot (2021-07-04 08:10:54)
Offline
A few command lines
https://github.com/brontosaurusrex/post … xamples.md
(You probably want some of the 1pass vbr variants)
The examples assume that you are using latest ffmpeg which is supposed to have excellent native CBR AAC encoder.
Stress on the cpu is mostly about input and ouput resolution of video and preset used (ultrafast = minimum stress).
could you test this by copying a video with ac3 audio to your server, then try to open it from your phones browser?
I did test just that using ssh connection to the server (But that was local lan connection).
Last edited by brontosaurusrex (2015-12-24 20:50:41)
Offline