Jump to content


Photo

API: Transferring Recordings to Local Computer


  • Please log in to reply
336 replies to this topic

#61 home123

home123

    Simple.TV Hacker

  • Members
  • PipPipPip
  • 33 posts

Posted 05 February 2014 - 08:17 AM

I get different results when using Linux vs Windows.  They both show a 54M connection and are in the same room as the router.

 

Linux transferred an hour show in about 30 minutes while it took the Win7 box about 3 times as long.  Ironically the win 7 laptop is quite a bit faster with more memory (i5 vs core duo, 4G vs 2G, 500G drive vs 80G).

 

This is not scientific, as I didn't perform this multiple times and reboot/reset each, but it's one data point.

 

The python script tries to transfer locally, but falls back to using the simple.tv proxy, which utilizes your wan connection. Can you check and see if it's being transferred over your wan (see if your modem is uploading / downloading, or if the transfer is local).



#62 MonkeyMan

MonkeyMan

    Newbie

  • Members
  • Pip
  • 5 posts

Posted 05 February 2014 - 08:19 AM

I get different results when using Linux vs Windows.  They both show a 54M connection and are in the same room as the router.

 

Linux transferred an hour show in about 30 minutes while it took the Win7 box about 3 times as long.  Ironically the win 7 laptop is quite a bit faster with more memory (i5 vs core duo, 4G vs 2G, 500G drive vs 80G).

 

This is not scientific, as I didn't perform this multiple times and reboot/reset each, but it's one data point.

Oops, I should have specified my units!  One minute fifteen seconds to xfer a 30 minute show.  Not too awful considering the relatively slow USB HDD connected to my simple.tv.

 

My network is wired gigabit ethernet



#63 MeeBee

MeeBee

    Advanced Member

  • Members
  • PipPipPip
  • 469 posts

Posted 05 February 2014 - 08:36 AM

The python script tries to transfer locally, but falls back to using the simple.tv proxy, which utilizes your wan connection. Can you check and see if it's being transferred over your wan (see if your modem is uploading / downloading, or if the transfer is local).

 

I'll see what I can do, but not sure it will be that straightforward, as the router is serving multiple devices so isolating to one may not be easy.  Time to break out my linux network tools...



#64 stbxxl

stbxxl

    Member

  • Members
  • PipPip
  • 19 posts

Posted 05 February 2014 - 10:27 AM

Oops, I should have specified my units!  One minute fifteen seconds to xfer a 30 minute show.  Not too awful considering the relatively slow USB HDD connected to my simple.tv.

 

My network is wired gigabit ethernet

 

My experience is about the same. takes about 90 seconds (give or take) to download a 30 minute show. I'm also using a wired gigabit Ethernet setup.



#65 MeeBee

MeeBee

    Advanced Member

  • Members
  • PipPipPip
  • 469 posts

Posted 05 February 2014 - 06:28 PM

I get different results when using Linux vs Windows.  They both show a 54M connection and are in the same room as the router.

 

Linux transferred an hour show in about 30 minutes while it took the Win7 box about 3 times as long.  Ironically the win 7 laptop is quite a bit faster with more memory (i5 vs core duo, 4G vs 2G, 500G drive vs 80G).

 

This is not scientific, as I didn't perform this multiple times and reboot/reset each, but it's one data point.

 

Just did another couple of hour long shows and I got 13:04 and 9:54 for a 2.1G file. I wish I had a giga network. ;(

 

In either case, I'm pretty happy with the results.

 

Home123:  I sent you a private message.  Please check.



#66 air1

air1

    Newbie

  • Members
  • Pip
  • 3 posts

Posted 08 February 2014 - 09:48 AM

I'm not sure if this was mentioned or not, but I also needed CherryPy.  Great job, on the API.

 

I transferred a 1/2 hr show, 518mb, wireless n 2.4 Ghz, in 54 seconds, 4 seconds of that was getting the url.  Asus router rocks.



#67 lowemissions

lowemissions

    Newbie

  • Members
  • Pip
  • 7 posts

Posted 10 February 2014 - 10:13 PM

I was able to download the file in windows 8 and ubuntu 13.04 and they both play nicely. By default the setting quality is set to two so 1 hours of video take about 1.8 to 2 gigabytes. My other issue is that the video and the video title did not match. Anyway, I still happy that we are able to download the video content from the harddrive.



#68 Colorado Cliff

Colorado Cliff

    Newbie

  • Members
  • Pip
  • 8 posts

Posted 10 February 2014 - 10:34 PM

Thanks so very much for creating this. Now, does anyone know how to mark/skip the commercials in the resulting MP4 file? Is this relatively easy to do (preferably using an automated tool), or do I need to do it manually using something like iMovie?



#69 MeeBee

MeeBee

    Advanced Member

  • Members
  • PipPipPip
  • 469 posts

Posted 11 February 2014 - 05:51 AM

If you are comfortable with command line utilities, you can probably make use of comskip and comclean if you want something automated.



#70 namesbond

namesbond

    Newbie

  • Members
  • Pip
  • 2 posts

Posted 12 February 2014 - 09:15 PM

Does anyone know how to designate which tuner you are browsing with download.py?



#71 wizwor

wizwor

    Advanced Member

  • Members
  • PipPipPip
  • 646 posts

Posted 13 February 2014 - 03:29 AM

Does anyone know how to designate which tuner you are browsing with download.py?

The 'selected' tuner.  Select your tuner using the web page before using download.py.



#72 B Anderson

B Anderson

    Advanced Member

  • Members
  • PipPipPip
  • 53 posts

Posted 13 February 2014 - 01:00 PM

Thank you to home123 for working on getting the Simple TV figured out.  I, too, am tired of the apps crashing and the frustration that goes along with trying to watch a recording.

 

I saw this thread and checked out the python code.  I never actually executed the code so I have no idea how it works.  But, I have taken some of the ideas from the python code and converted it over to the world of Groovy and Griffon (Groovy is a JVM language and Griffon is a framework for building Swing applications).  I'm new to Griffon, so the quality of the code may be (is??!) lacking, but I have been able to use this application to download mp4 files from my Simple TV.

 

If you would like to try it out, I make no promises on if it will work for you.  I don't have tons of time for support, but would be willing to fix things as they come up (and as I have time).  Some things to keep in mind when using this:

-Works only on the network local to your Simple TV (can't download videos from work, for instance)

-When you click a button or list item, have patience.  Wait at least 30 seconds.  If you don't get anything at that point, there was probably an error.

-There's no error reporting in the app, though there should be exception traces in the console output (if you started it that way).

-I have no idea if it works with multiple Simple TVs (I only have one Gen1).

 

Here's the code and along with it there are some compiled binary executables.  I have tried them in Windows, OSX, and Linux.

 

==== EDIT ====

Download the zip from the releases tab

https://github.com/b...wnload/releases

=============

 

Use the "download as zip" functionality if you don't care about git.  I make no promises that you can get the code to run by itself as I don't know if I've checked everything necessary into github.  The binaries work though.

 

Make sure you have a fairly modern version of Java installed (6+)

Make sure you have a JAVA_HOME variable set

Run the .bat or shell script "simpletv" in the dist/windows directory (bat for windows, the one without an extension for OSX and Linux)

You might need to set the shell script to chmod 755 (or something similar)

 

The Windows executable probably doesn't require Java to be installed or the JAVA_HOME variable set, but I don't know.. I haven't tried it without them!


  • wizwor likes this

#73 dtn25

dtn25

    Newbie

  • Members
  • Pip
  • 1 posts

Posted 13 February 2014 - 01:40 PM

So since simple.tv has been saying since at least october that they are working on chromecast support, and when google finally released the SDK they immediately did a 180 and said they are not, I've been trying to get simple.tv to work with my chromecast. My workaround involves downloading the file using your python script, massaging the file into a chromecast friendly format, renaming it into a plex friendly format, then pushing the file to plex.  Here is a simple batch file I'm doing this with in windows. I'm a pretty lazy and crummy scripter, but it works for me.

REM download the file from the simple.tv
download.py 

REM Convert from mpeg stream to mp4, move the moov atom, and change the audio to something chromecast likes
for %%i in (*.mp4) do (
move "%%i" tempfile.m4v
ffmpeg -i tempfile.m4v -vcodec copy -bsf:a aac_adtstoasc -acodec copy -movflags faststart "%%i")
del tempfile.m4v

REM rename the file to a plex friendly format
"c:\Program Files\FileBot\filebot.exe" -rename *.mp4 --format "TV/{n}/{\"Season ${s.pad(2)}\"}/{n} - {s00e00}" --db thetvdb -non-strict


REM ftp the file to my plex server, edit as necessary
ncftpput -R -v -u "username" -p "password" SERVERIP /Plex/TV/ TV/*

So I run that, and in about 4 minutes (because my laptop has a physically damaged nic and will only do 100 megs) the file is available in plex for use with my chromecast. In order for this script to work I've installed ffmpeg, ncftp and also filebot. Please note filebot has a very shady installer that really tries to get you to install other garbage with it.



#74 wizwor

wizwor

    Advanced Member

  • Members
  • PipPipPip
  • 646 posts

Posted 13 February 2014 - 02:15 PM

Another great utility.  Thanks Mr. Anderson.  I can confirm that the windows version works fine doing nothing more than unzipping the file to a directory and running simpletv.exe.

 

Any chance username, password can be stored, quality set globally, and files downloaded in bulk?

 

Just being greedy.



#75 SolutionDog

SolutionDog

    Advanced Member

  • Members
  • PipPipPip
  • 56 posts

Posted 13 February 2014 - 04:01 PM

B Anderson - I have a little problem. If I change the path for the files to be saved it does not take. This is on an older XP computer. I need to be able to save the files to a different drive and directory.

 

Also the file produced does not play on my Roku but that issue happens with the Python script as well.After I run the file through Freemake it plays fine.

 

Thanks for this.


"If knowledge can create problems, it is not through ignorance that we can solve them." Isaac Asimov

Duct tape is like the Force. It has a light side and a dark side, and it holds the universe together.

 


#76 B Anderson

B Anderson

    Advanced Member

  • Members
  • PipPipPip
  • 53 posts

Posted 13 February 2014 - 05:06 PM

 

Any chance username, password can be stored, quality set globally, and files downloaded in bulk?

 

 

 

If I change the path for the files to be saved it does not take.

 

I will look into these features / bugs when I get a chance.



#77 home123

home123

    Simple.TV Hacker

  • Members
  • PipPipPip
  • 33 posts

Posted 13 February 2014 - 05:48 PM

B Anderson - Really glad to see other people working on this too, especially since I haven't had a lot of time to do so.

 

The chromecast support looks great! Some quick thoughts from my research into that. You may know some of it already, but I figured it would be helpful to you and others in your research:

 

1) Simple.tv basically supports 2 output formats, mp4 (h264 codec), and a segmented hls stream. Both formats support 3 different qualities.

 

2) Chromecast natively supports both formats (hls and h264 in mp4). Unfortunately though, both formats don't meet the standard, so they can't be played directly on the chromecast without some modification first (believe me, I tried...).

 

-----------------------------------------------

 

Here are the issues I found with each format:

 

1) mp4 - Mp4 requires a moov atom header, either at the beginning or end of the file. Unfortunately simple.tv chose to place this at the end of the file, which isn't supported by the chromecast. This means you have to download the entire file before re-encoding it to be able to use it. Interestingly though, you can feed it through ffmpeg using the following command, and nothing is actually re-encoded, the headers are just recreated, so it's really quick:

ffmpeg -i filename.mp4 -acodec copy -vcodec copy output.mp4

Therefore, you should be able to write a script that copies the file to your local computer, quickly 'transcodes' (in a few seconds), and then instructs the chromecast to play the file.

 

2) hls stream - The video is split into lots of ~10s video files that the device downloads individually. This allows the device to switch bitrate dynamically during playback. A small offset value is typically included at the beginning of each chunk (can't remember the name of this unfortunately), that indicates the offset from the beginning of the video. This is set to 0 for each chunk, and causes the chromecast to fail playback when it downloads the second chunk.

 

Unfortunately I gave up on chromecast support after fighting with ffmpeg to get this to work. If simple.tv fixed either of these, I am pretty confident I could get either a web app, or an android app that could playback recordings on a chromecast... Doesn't seem very likely unfortunately.



#78 alphawave7

alphawave7

    Advanced Member

  • Members
  • PipPipPip
  • 54 posts

Posted 13 February 2014 - 10:09 PM

Just tried B Anderson's 'GUI' and I succeed all the way to the Download button...I click it, and it immediately results in a 'Success!', but the end result is a 0 byte file in the destination folder. So close, but no joy! :) Any help appreciated.

 

Edit: Also attempted to use home123's python script, and it too seems to do everything up to actual download (named file with 0 bytes).

 

Both above attempts on Win7...just tried on Ubuntu Saucy (HP Chromebook 14) and home123's script dumps a 24.7kb file with mp4 extension, but never downloads. 



#79 B Anderson

B Anderson

    Advanced Member

  • Members
  • PipPipPip
  • 53 posts

Posted 14 February 2014 - 10:41 AM

I uploaded some changes to github.  You will have to redownload and extract the zip to get the changes.

 

-Local / Remote network selector.  I would really only ever do this locally since remote is very slow, but the option is there.

-Username and password are now stored in a file.  In clear text.

-The download location text field should now work.

-I attempted a bug fix for @alphawave7, but I have no idea if it will work and I have no idea what the bug is!  If you can get it to run from the commandline using one of the batch script or shell options, I think it should display output to the console.  This output would be helpful in finding bugs.

 

 

 

======EDIT======

I have changed things up a little.  Github has a notion of a release.  Download the zip file from the releases tab.  Should be a smaller download.

 

https://github.com/b...wnload/releases


  • wizwor likes this

#80 wizwor

wizwor

    Advanced Member

  • Members
  • PipPipPip
  • 646 posts

Posted 14 February 2014 - 12:16 PM

very nice, mr anderson.  thank you!






0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users