SurLaTablo.py - Python program to query and convert Tablo recordings

Thanks for your quick answer. How do I redirect the output of the command to a file?

@PhilH That’s what the “>filename.txt” does. Add that to the end of your command. You can change the filename if you want.

I just got a blank file.


If I use the first version of the script I get this error.

W:\Tablo Convert>surlatablo-0.1.py --noupdate --query “Merry Madagascar” --conve
rt
Working on:                             [./TV/Merry Madagascar/Season 0/Merry Ma
dagascar - s00e00 - Episode 0.mp4]
 Retrieving Tablo Data (62632):         [####################] 100%
hello
Traceback (most recent call last):
  File “W:\Tablo Convert\surlatablo-0.1.py”, line 1449, in
    doConvert(db_recs[rec_id], options, basedirs, filename_pats)
  File “W:\Tablo Convert\surlatablo-0.1.py”, line 769, in doConvert
    ffmpegproc = subprocess.Popen(ffmpeg_optsa,stderr=subprocess.PIPE,stdout=dev
null)
  File “C:\Python27\lib\subprocess.py”, line 710, in init
    errread, errwrite)
  File “C:\Python27\lib\subprocess.py”, line 958, in _execute_child
    startupinfo)
WindowsError: [Error 2] The system cannot find the file specified

Maybe this will help to track down my problem…

Thanks again…

@PhilH, what is the path to you ffmpeg file?  Make sure it’s correct.  You can also try adding the -d option and seeing the output no need for redirecting… it won’t do anything but will show  you the commands it’s going to try to do…

(btw, my Windows tests were using Windows 7 64bit)

I placed the ffmpeg file in bin… w:\tablo convert\bin.


In the script for the location of ffmpeg I put FFMPEG = 'bin’

The script is in w:\tablo convert

Hope this helps…

FFMPEG need to be the full path to the ffmpeg.exe (including ffmpeg.exe)


FFMPEG = 'w:\\tablo convert\\bin\\ffmpeg.exe’

or just because I hate back slashes…

FFMPEG = 'w:/tablo convert/bin/ffmpeg.exe’

Sorry… maybe location was a poor choice of words.  It’s not the folder, it’s the fully qualified path to the executable.

That makes sense. I was only pointing to the folder ffmpeg was in. Let me try that & get back to you.


Thanks for hanging with me…

That did the trick… Thanks a bunch. I did install the 32 bit version of ffmpeg and the transcode line showed up properly & counted up from 0 just like the data line did.


Here is the printout from the cmd prompt…

W:\Tablo Convert>surlatablo.py --noupdate --query “Merry Madagascar” --convert
Working on:                             [./TV/Merry Madagascar/Season 0/Merry Ma
dagascar - s00e00 - Episode 0.mp4]
 Retrieving Tablo Data (62632):         [####################] 100%
 Transcoding:                           [####################] 100%


W:\Tablo Convert>

When this transcodes is it just putting the segments together? Is it the same quality as what is on the Tablo?

Many thanks for your help

Phil

@PhilH, yes, the settings unless you do -wcrop is merely copying the streams and stitching things together… so same quality.

When I redo the command handling, there will be more transcoding options and a more sensible way of adding your own…

Nice to see the progress things working… the one on ffmpeg is very probablistic (the only way to program!!)

But I thought my solution was clever… and cheap… there might be a better way…

I even got the closed captions to work once you told me that the exe file had to be in the path.


Hopefully this will help someone else…

W:\Tablo Convert>surlatablo.py --noupdate --query “Merry Madagascar” --convert -
-ccaption
Working on:                             [./TV/Merry Madagascar/Season 0/Merry Ma
dagascar - s00e00 - Episode 0.mp4]
 Retrieving Tablo Data (62632):         [####################] 100%
 Extracting CC as Subtitle:             [####################] 100%
 Transcoding:                           [####################] 100%


W:\Tablo Convert>

I’m happy as a pig in warm mud… :slight_smile:

@PhilH, well, at least you didn’t post a pic (the pig thing)…

More good stuff to come…

And remember there are short options (-n -q -c -C in your case).

Goodnight my friend… You were a great help.


Phil

@cjcox I can see you do html/php and so on by your relative path use in the python script! you don’t start with the drive and give the full path, you start from your current location apparently and give a path relative to the path of the script - is that correct?

Your examples never include a full path. 

BTW - fully qualified makes you sound like a WINDOWS networking person - like the fully qualified domain name of a device or server or user/person or group in Active Directory.
I just say “full path”   :wink:  which includes drive, folders and file name like C:\apps\tablo\myfile.exe would be a full path. 
But a fully qualified name in the case of Windows would be more like 
vr003xx.dvrs.gov.state.ia.us
That’s a fully qualified machine name.

The UNC name would be 
\\vr003xx\c$\apps\tablo\myfile.exe

Since you are running from the same machine that the exe, scripts and so on reside on, no need for the whole unc so just a “full path” including drive unless your script DOES work with relative paths in which case no drive letter is needed.
So is python or your script using physical paths or relative paths or…  ?

Anyway, it got late for me last night,. I got totally confused in the script - did change the locations of the files and the IP of the Tablo device but when I looked through the script it totally baffled me as I saw stuff that wasn’t commented and wasn’t a command either. I am too used to VBS and ASP I guess!
With your script, is it that the ONLY changes we need are the location of the ffmpeg.exe, the Tablo IP address, those things in the VERY top area of your script or must one do something else there, too?

I did a search and found the ffmpeg files - got the “static” which is says are self-contained executable. I assume all one needs to do is extract them as there’s no install routine. I figured the static option 64bit was best but I didn’t know for sure. 
Never really got a chance to test it, was falling asleep!
@PhilH, what is the path to you ffmpeg file?  Make sure it's correct.  You can also try adding the -d option and seeing the output no need for redirecting... it won't do anything but will show  you the commands it's going to try to do....

(btw, my Windows tests were using Windows 7 64bit)

Wonderful! That’s all I have, W7 64 bit. I’ve got more than enough processing power and RAM.

This means that unless I’m totally stupid, I should be able to make this work. 
(ok, I expect at least 50 comments related to that line above)

Script uses paths. Nuff said… The issue was the word path. In the case of the executables it needs to be the full path of the executable file.

Version 0.3 released.

See CHANGELOG and get file from:

SurLaTablo

What’s to come in 0.4?  Well, I’m reworking the opts to make it easy to do multiple transcodes per entry.  Thus you could create the Default .mp4, but also maybe things like an animated gif preview (for example):


MP4 is fine… I wonder if there are other resolution options for the MP4 output. Been a while since I looked at your script (ok, 3 days is a VERY long time for someone like me!)

Got Python and the options and stuff installed…and seemingly working.

@ShadowsPapa, when 0.4 comes out, it will make it “easy” (relatively speaking) to create custom profiles with whatever options you want.  Just realize that a “resize” is an expensive full transcode.  It will work, just takes a lot longer.

I’m kinda hoping that folks see where this is all going and that eventually you’ll be able to have a Plex-like browseable, playable interface in addition to a browser based extraction mechanism.  No promises of what version that will come in though :slight_smile:

Thanks for your hard work cjcox. It is appreciated…