[ANNOUNCE] iStreamdev-1.0.1 - stream vdr & media files to your Iphone

  • First, thank you to everybody involved for a great project. This thread was a great help during the installation of istreamdev.


    Here's what I can contribute:


    I am running istreamdev on an rusty P4 1,5GHz w/o graphic adapter. After default install, I experienced heavy performance issues, like mentioned of the first pages of this thread. However, there is a way to get to decent results on a cpu like this as well.


    My first mistake was, yasm was not installed, when I compiled libx264, thus the cpu optimizations (MMX, SSE, x64...) were not enabled. Simply install yasm BEFORE compiling libx264 (I know the posted howto tells you, anyhow i missed it). impact on cpus < 2 GHz is huge. Check in ffmpeg log for cpuextensions enabled.


    Second, I strongly recommend using ffmpeg with presets, instead of listing each parameter individualy.
    There exist two ipod constraints: ipod320 and ipod640, the latter one beeing for either tv-out or new iphone resolution. I use ipod320 for my ipodtouch 2g.


    Direct impact on the videoquality and therefore cpu usage is given by the quality prefix. you can choose from: ultrafast, superfast, veryfast, faster, fast, medium, slow, slower, veryslow, placebo


    ultrafast yielding the worst quality, yet the lowest cpu usage, while slow should be best choice for modern dualcore or better.


    On my 1,5 GHz cpu I get adequate results using -vpre veryfast -vpre ipod320 in combination with the 3G stream. CPU works at ~ 90%.


    for this i have to change istream.sh

    Code
    # Start ffmpeg #(trap "rm -f ./ffmpeg.pid; rm -f ./fifo" EXIT HUP INT TERM ABRT; \ # $FFMPEGPREFIX | $FFPATH -i "$STREAM" -deinterlace -f mpegts -acodec libmp3lame -ab $ARATE -ac 2 -s $XY -vcodec libx264 -b $VRATE -flags +loop \ # -cmp \+chroma -partitions +parti4x4+partp8x8+partb8x8 -subq 5 -trellis 1 -refs 1 -coder 0 -me_range 16  -keyint_min 25 \ # -sc_threshold 40 -i_qfactor 0.71 -bt $VRATE -maxrate $VRATE -bufsize $VRATE -rc_eq 'blurCplx^(1-qComp)' -qcomp 0.6 \ # -qmin 10 -qmax 51 -qdiff 4 -level 30  -g 30 -async 2 -threads 4 - 2>$FFMPEGLOG >./fifo) &


    to

    Code
    # Start ffmpeg with x264 and aac (trap "rm -f ./ffmpeg.pid; rm -f ./fifo" EXIT HUP INT TERM ABRT; \  $FFMPEGPREFIX | $FFPATH -i "$STREAM" -f mpegts -acodec libfaac -ab $ARATE -ac 2 -s $XY -vcodec libx264 -b $VRATE \  -bt $VRATE -vpre veryfast -vpre ipod320 -threads 0 - 2>$FFMPEGLOG >./fifo) &


    Conclusion is, if you're experiencing performance issues, glitches, audiosynchronity issues, etc, play with the different preset params, and check your cpu usage (top, or whatever tool you like) until you get a setting, your cpu can handle.


    Maybe codemaintainers can implement the presets in the config.php as a parameter for istream.sh in an future version.


    Additional notes:
    the change from libmp3lame to libfaac did not change anything considering cpu usage, i just kept this for maintaining format standards.


    thread parameter is set to 0, which should generally be the best option. ffmpeg selects the optimum number of threads this way. on a dual/quadcore you may test explicitly the threads 2 or threads 4 parameter. Another proposal for the config.


    Again thank you for your work,
    hope I could contribute :)

  • Firstly i would like to thank everybody invoved in this project! It runs fine on my shiny, new iPad. Nevertheless i've found a small issue in istream.sh and fixed it.


    In order to evaluate the PID of ffmeg and segmenter, i've found the following command sequence in istream.sh:


    SPID=`\ps ax --format pid,cmd,ppid | grep "$SEGPID$" | grep segmenter | awk {'print $1'}`;


    On my system the executables of ffmeg and segmenter are not in the default places, but in /usr/local/vdr/bin. Hence the 'ps --format ...' command, piped through 'grep segmenter' yields an empty result, because the column width of the command name is too small. Here the result:


    29790 /bin/bash ./istream.sh http 1
    29793 /usr/local/vdr/bin/ffmpeg - 29790
    29799 /bin/bash ./istream.sh http 1
    29801 /usr/local/vdr/bin/segmente 29799


    As you can see, 'segmente' does not match 'segmenter'. The fix is very simple. A modification of the format parameter to "%p %c %P" will make it work, even for long pathnames:


    SPID=`\ps ax --format "%p %c %P" | grep "$SEGPID$" | grep segmenter | awk {'print $1'}`;


    I've made the modification for ffmeg as well. Maybe you can fix the script accordingly in the repo.


    Thanks again for this nice piece of software
    Mattes

  • Hi


    First: Great module. its fun to watch TV on the iPod.


    Android does not support Apple's http streaming.


    But when piping the ffmpeg into vlc, one can expose the stream as "RTSP stream", which is understood by android and most other mobile phones. Of course, the use of the HTML5 video element is anther issue.


    Here the vlc pipe command line.
    ffmpeg <some params> - | vlc --intf=dummy --rc-fake-tty -vvv file/ts:///dev/stdin --sout '#rtp{mp4a-latm,sdp=rtsp://server.example.org:8080/test.sdp}'


    Thanks again,
    Blohm

  • Hi there, it's me again.


    Found some time to play around with this package. I still don't have ffmpeg acting the way i would have it to act, but already looked at the iphone interface.


    It looks like it makes use of JQTouch isn't it? Are you aware that the main developer of this package has been hired by the guys of Sencha (formerly extjs) to rebuild this framework from the ground up. Better, faster and more features.


    The guys of Sencha are sponsering the JQTouch project so development will not completely stall, but as the main developer is gone, you can imaging the progress of the development will not be as fast anymore. Hence when was the last update of JQTouch!


    Anyway, I dont know if you are aware of the Sencha Touch framework.
    http://www.sencha.com/products/touch/
    It might be worth looking into for the future.



    BTW, it is a HTML5 framework, so one page will work natively for iphone and android.

  • Hi an alle ;)
    Erst mal ein Komplement an istreamdev, super Arbeit.


    Hab leider ein kleines Problem.
    Wenn ich Audio drücke dann auf ein Album listet er auch alle Songs auf, nur Spielt er keinen ab wenn ich drauf Drücke :( er markiert ihn kurz dann sehe ich das er eine Anfrage sendet und passiert nicht mehr, habe dann immer noch die
    Songlist vor mir.


    System:
    Iphone 3GS, Server: Ubuntu 9.10.


    istreamdev.log



    Apache2-Error-Log

    Code
    mkdir: cannot create directory `../playlist': File exists
    mkdir: cannot create directory `../playlist': File exists
    mkdir: cannot create directory `../playlist': File exists
    mkdir: cannot create directory `../playlist': File exists
    mkdir: cannot create directory `../playlist': File exists
    mkdir: cannot create directory `../playlist': File exists
    mkdir: cannot create directory `../playlist': File exists
    mkdir: cannot create directory `../playlist': File exists
    mkdir: cannot create directory `../playlist': File exists
    mkdir: cannot create directory `../playlist': File exists


    Denn Ordner playlist legt er Korrekt an und verlinkt auch zu denn Dateien.
    "/playlist/ Song1.mp3 Song2.mp3 Song3.mp3 Song4.mp3"


    Wenn ich die Dateien einzeln über
    http://192.168.2.20/istreamdev/playlist/Song1.mp3
    wähle spielt er sie ab.


    Kann es auch an meinem Iphone liegen ?


    PS: Videos spielt er ohne Probleme.


    Vielen dank im voraus.

  • Hi,


    istreamdev does not create "session0". :(


    This ist the output of istreamdev.sh with "set -x":



    Apache Log:


    Any ideas?

  • Hi alib,


    first of all thanks for your good work. I am using istreamdev since the early versions and I like it very much. I am often in Hotels in other countries and always happy when I could watch some german tv in the evening :)


    Anyway, I use the git version and it is up to date. There seams to be a problem by forming the Symlinks in the playlist folder for streaming audio. After the subdirectory, before the audio file an "/" is added ...



    Also see the post of clownger ...


    Last but not least, I have a phat wish ... please add scrubbing for video ;) From all my investigations it looks like it would be very easy. In the beginning I thought the segmenter is the problem that it not works, but now I think it is just the player which is missing the <controls>. - I am confused and not really fit with Javascript, so I can't do much on my own.


    I played around with the project from ioncannon (http://www.ioncannon.net/progr…streaming-video-and-more/ there scrubbing works.


    I do not want to miss the life streaming and like you I prefer to have just one stream with good quality instead following the applerules for all the fallbacks. Using AirVideo as native app is an option to have scrubbing, but when it is about watching TV it just sucks - it works but takes some time ...



    alf

  • first of all: nice work!!!


    just for your information, i had to turn PHP warnings off in php.ini to get the latest istreamdev 1.0.1 to work.


    there's a problem after selecting the streaming mode (edge, 3g, wifi) when requesting backend.php?action=getStreamInfo&session=0.


    with php warnings turned off everything's fine.

  • some further steps i had to take to get everything working perfect:


    audio:


    files.php, line 225:
    replace

    Code
    list($newentry['trackname'], $newentry['length']) = mediagetmusicinfo($dir ."/" .$value);


    with

    Code
    list($newentry['trackname'], $newentry['length']) = mediagetmusicinfo($dir.$value);


    should do the trick.


    although everything was working basically i was sometimes getting an error while gathering the session status, especially after selecting WIFI mode for streaming.
    although the session was created, i got the the error: session could not start.
    after removing the following function from
    session.php, line 327-334:

    Code
    // Check session creation timeout
    if ($checkstart && ((time() - $time) >= 10))
    {
    	$status['status'] = "error";
    	$status['message'] = "Error: session could not start";
    	addlog("Returning status: " .$status['message']);
    	return $status;
    }


    it works perfect.



    off topic: has anyone tried to play the full TS stream from VDR on the iphone 4? i think i've read somewhere, that the iphone 3 was a little bit too slow too play it, but maybe the iphone 4 can do it....

  • sorry, dass ich hier auf deutsch schreibe.
    die sache muss doch irgendwie auf android portierbar sein.
    wenn ich mir die tags so ansehe, kann es daran eigentlich nicht liegen.
    ist es möglich, dass es einfach nur am container liegt?
    ffmpeg und segmenter packen alles in hübsch portionierte x264 encodierte ts-files nach ./ram/session*
    dort wird ja dann auch die playlist angelegt, die diese häppchen enthält und schließlich auch als src im video-tag dient.
    nun kann android ja leider nichts mit ts anfangen.
    ließe sich das ganze nicht irgendwie in mp4-häppchen containern?
    das versteht mein desire nämlich schon. diese seite hier http://broken-links.com/tests/video/
    wird bei mir so abgespielt
    [Blockierte Grafik: http://www1.xup.in/exec/ximg.php?fid=15915251]
    oder lieg ich einfach mal grundsätzlich falsch?
    bevor mir jemand vorschlägt, droidVDR zu nutzen, das ist mir sehr wohl bekannt, ich bin aber heiß auf istreamdev ;)

    VDR 2.2.0, PMS mit PlexVDR, XML-API+VDR Client
    Ubuntu 16.04 64bit
    alles 'headless' auf Intel(R) Core(TM) i5-4440 CPU @ 3.10GHz, 8GB RAM, 5 x 3TB im RAID5 (12TB)
    zzgl. diverse SH4 Sat-Boxen mit NeutrinoMP

  • weiß denn nun jemand, wo das problem liegt?
    ist es der container, die m3u8 playlist oder sogar beides?

    VDR 2.2.0, PMS mit PlexVDR, XML-API+VDR Client
    Ubuntu 16.04 64bit
    alles 'headless' auf Intel(R) Core(TM) i5-4440 CPU @ 3.10GHz, 8GB RAM, 5 x 3TB im RAID5 (12TB)
    zzgl. diverse SH4 Sat-Boxen mit NeutrinoMP

  • Hello


    i have still problems to compile "segmenter" yesterday night i spent several Hours to read many posts here regarding this problem - i think i have made everything right - but Compiling stops hiere:

    Code
    /src/ffmpeg/libavutil -lavutil -I/usr/local/src/ffmpeg/ -lm -lmp3lame -lxvidcore -lx264 -lbz2 -lpthread -lzavformat -L/usr/local/src/ffmpeg/libavcodec -lavcodec -L/
    segmenter.c: In function ‘main’:
    segmenter.c:242: warning: ‘guess_format’ is deprecated (declared at /usr/local/include/libavformat/avformat.h:892)
    /tmp/ccBn4mz9.o: In function `main':
    /var/www/istreamdev/segmenter/temp/segmenter.c:248: undefined reference to `avformat_alloc_context'
    /var/www/istreamdev/segmenter/temp/segmenter.c:316: undefined reference to `av_free_packet'
    /var/www/istreamdev/segmenter/temp/segmenter.c:366: undefined reference to `av_free_packet'
    /var/www/istreamdev/segmenter/temp/segmenter.c:370: undefined reference to `av_free_packet'
    collect2: ld returned 1 exit status


    I found a other Guy wich have the same Problem but no solution...


    Any ideas ?


    OS: Debian
    I have installed FFMEPG from SVN and some other libs also from Source (like discribed in this Thread)


    Im open for any ideas !


    Best Regards
    Axel

  • Hi


    thanks for Answer - but same Problem:

    Code
    /tmp/ccAUQ1dT.o: In function `main':
    /var/www/istreamdev/segmenter/segmenter.c:242: undefined reference to `av_guess_format'
    /var/www/istreamdev/segmenter/segmenter.c:248: undefined reference to `avformat_alloc_context'
    /var/www/istreamdev/segmenter/segmenter.c:316: undefined reference to `av_free_packet'
    /var/www/istreamdev/segmenter/segmenter.c:366: undefined reference to `av_free_packet'
    /var/www/istreamdev/segmenter/segmenter.c:370: undefined reference to `av_free_packet'
    collect2: ld returned 1 exit status
    make: *** [all] Fehler 1
    eros:/var/www/istreamdev/segmenter# mcedit segmenter.c
  • Hi again,


    ahh I see this just removes the depreceated for you .. so keep the change and edit the Makefile ...


    Assuming that it somehow looks like this :


    add the 2 new lines, so that it looks like this :


    where /usr/src/ffmpeg ... needs to be exchanged with your ffmpeg source location


    then just 'make new'


    you could also add -I/usr/src/ffmpeg/ for the includes .


    With this and the change before everything should be fine. Be sure to use the latest segmenter version from here http://svn.assembla.com/svn/legend/segmenter/ .


    If you still get errors, or new ones :) you need to check your ffmpeg compile options and might need to change the new: line , means adding or removing something after -lz ... try also to remove everything (-lmp3lame -lx264 -lfaad -lfaac) in new versions of segmenter it could work, in the past I needed these extras to make it compile on my linux distribution.


    Most important are the '-L/...' lib includes to the used ffmpeg source ...



    greetings ...

Jetzt mitmachen!

Sie haben noch kein Benutzerkonto auf unserer Seite? Registrieren Sie sich kostenlos und nehmen Sie an unserer Community teil!