# Capturing Slingbox 350/500 video



## moyekj

There may be easier ways, but recently I discovered a nice way to capture Slingbox video stream directly (not using full screen capture techniques) thanks to "Slinguist" from this post:
http://placeshiftingenthusiasts.com...-in-high-definition-720-or-1080/page-2/#p7632

Since there are a few Slingbox users here I thought it may be useful to summarize how to get the above working, since it's not trivial to do:

1. Download this Perl script:
http://placeshiftingenthusiasts.com...-file-uploads/slinguist/2013/01/rec350b-1.zip

2. Requires Perl installation to run if you don't already have it installed:
http://www.activestate.com/activeperl/downloads

3. Perl script requires the Crypt::Tea_JS module. You can use the Perl Package Manaager to find and install that module:
Start Perl Package Manager
* View->All Packages
* Find and click on Crypt-Tea_JS
* Action->Install
* File->Run Marked Actions.

4. You then need to edit the rec350b.pl script to update $slingip, $pass and optionally $vs variables.

5. Sling IP & Port you can find as follows:
* Start the web based player the usual way (login if needed): http://newwatch.slingbox.com/#SettingsPageFacade/index
* Click on 'Settings' and then click on 'NETWORK DETAILS' where you can see HOME IP Address and Network Port
* Now in Perl script set $slingip accordingly.

6. While keeping the Slingbox stream active in your browser, the 15 digit admin password you then find by opening a new tab in your browser and visiting:
* https://newwatchsecure.slingbox.com/watch/slingAccounts/account_boxes_js
* Then look for 'adminPassword' setting in the .js file. (If you have more than 1 Slingbox make sure you grab the setting for the right one).
* Now in Perl script set $pass accordingly.

7. I also changed $vs=16 to get 1920x1080 resolution 4Kbps H.264 video for my Slingbox 350.

8. Now you're ready to run the script and capture video.
* Make sure you exit Slingbox viewing in your browser before running the Perl script.
* When you run the script it will create a .asf file in same directory as the script which you can play back using VideoLAN VLC and other players.
* After running script remember to rename the .asf file to something else before running again, or it will get overwritten.


----------



## Series3Sub

I plan on just getting one of the supported media streamers (like the WD Live) that have the Sling App already loaded. This means I can sling to my HDTV in the other room without having to use a PC or laptop. Just easier as I don't have the time anymore for much DYI.


----------



## moyekj

Not sure I follow your point. This thread is about a means to record Slingbox video directly. Useful for example for capturing a sequence of interaction with a TiVo to illustrate a bug or feature without having to use a video camera to record the TV picture.


----------



## jcthorne

moyekj said:


> There may be easier ways, but recently I discovered a nice way to capture Slingbox video stream directly (not using full screen capture techniques) thanks to "Slinguist" from this post:
> http://placeshiftingenthusiasts.com...-in-high-definition-720-or-1080/page-2/#p7632
> 
> Since there are a few Slingbox users here I thought it may be useful to summarize how to get the above working, since it's not trivial to do:
> 
> 1. Download this Perl script:
> http://placeshiftingenthusiasts.com...-file-uploads/slinguist/2013/01/rec350b-1.zip
> 
> 2. Requires Perl installation to run if you don't already have it installed:
> http://www.activestate.com/activeperl/downloads
> 
> 3. Perl script requires the Crypt::Tea_JS module. You can use the Perl Package Manaager to find and install that module:
> Start Perl Package Manager
> * View->All Packages
> * Find and click on Crypt-Tea_JS
> * Action->Install
> * File->Run Marked Actions.
> 
> 4. You then need to edit the rec350b.pl script to update $slingip, $pass and optionally $vs variables.
> 
> 5. Sling IP & Port you can find as follows:
> * Start the web based player the usual way (login if needed): http://newwatch.slingbox.com/#SettingsPageFacade/index
> * Click on 'Settings' and then click on 'NETWORK DETAILS' where you can see HOME IP Address and Network Port
> * Now in Perl script set $slingip accordingly.
> 
> 6. While keeping the Slingbox stream active in your browser, the 15 digit admin password you then find by opening a new tab in your browser and visiting:
> * https://newwatchsecure.slingbox.com/watch/slingAccounts/account_boxes_js
> * Then look for 'adminPassword' setting in the .js file. (If you have more than 1 Slingbox make sure you grab the setting for the right one).
> * Now in Perl script set $pass accordingly.
> 
> 7. I also changed $vs=5 to get 640x480 resolution video as the 'HD' resolution aspect ratio is a little strange.
> 
> 8. Now you're ready to run the script and capture video.
> * Make sure you exit Slingbox viewing in your browser before running the Perl script.
> * When you run the script it will create a .asf file in same directory as the script which you can play back using VideoLAN VLC and other players.
> * After running script remember to rename the .asf file to something else before running again, or it will get overwritten.


Thanks for the write up, I plan to give this a try. Any idea if this will work with an older slingbox pro? (mpeg2 stream).


----------



## Gaidin43

Series3Sub said:


> I plan on just getting one of the supported media streamers (like the WD Live) that have the Sling App already loaded. This means I can sling to my HDTV in the other room without having to use a PC or laptop. Just easier as I don't have the time anymore for much DYI.


If this is true this is an outstanding travel item or tivo mini/tivo stream replacement!


----------



## moyekj

jcthorne said:


> Thanks for the write up, I plan to give this a try. Any idea if this will work with an older slingbox pro? (mpeg2 stream).


 I think the Perl script for the older Slingbox units is a slightly different one, but it's the same idea and records to a .asf file:
http://placeshiftingenthusiasts.com...forum-file-uploads/slinguist/2013/01/rec2.zip


----------



## Dan203

So this captures the digital stream directly from the Slingbox? What format is the video? H.264?


----------



## moyekj

Dan203 said:


> So this captures the digital stream directly from the Slingbox? What format is the video? H.264?


 Yes it captures and decrypts the Slingbox encoded digital output. You have control over resolution, frame rate and some other basic parameters. For the newer Slingboxes the video is H.264. Here's mediainfo stats for a sample capture:


Code:


General
Complete name                    : H:\scratch\record_1080i.asf
Format                           : Windows Media
File size                        : 6.36 MiB
Maximum Overall bit rate         : 5 120 Kbps
Movie name                       : Slingbox
Performer                        : Sling Media
Comment                          : 1

Video
ID                               : 2
Format                           : AVC
Format/Info                      : Advanced Video Codec
Codec ID                         : h264
Width                            : 1 920 pixels
Height                           : 544 pixels
Display aspect ratio             : 3.529
Color space                      : YUV
Chroma subsampling               : 4:2:0
Bit depth                        : 8 bits

Audio
ID                               : 1
Format                           : 706D
Codec ID                         : 706D
Bit rate                         : 256 Kbps
Channel(s)                       : 2 channels
Sampling rate                    : 32.0 KHz
Bit depth                        : 16 bits

I don't like above aspect ratio so normally capture as VGA (640x480).


----------



## Dan203

That's weird, it's half the vertical resolution of standard 1920x1080. (1920x1080 is actually 1088 with a cropping rect removing the last 8 lines)

Can you send me that file?

http://www.videoredo.net/UploadFiles.htm

I want to see if I can get it to open in VideoReDo. (see if I can coax our FFmpeg reader into reading that format)


----------



## moyekj

Dan203 said:


> That's weird, it's half the vertical resolution of standard 1920x1080. (1920x1080 is actually 1088 with a cropping rect removing the last 8 lines)
> 
> Can you send me that file?
> 
> http://www.videoredo.net/UploadFiles.htm
> 
> I want to see if I can get it to open in VideoReDo. (see if I can coax our FFmpeg reader into reading that format)


 Since I'm at work I actually grabbed a clip from that thread I posted above. You can download it from here:
http://bit.ly/15d7xNt


----------



## moyekj

FYI, here's mediainfo from my own 640x480 capture. That clip I linked to above must have been a European user. The video in my capture is h.264 and audio is 2 chan AAC:


Code:


General
Complete name                    : C:\home\dvd\short_clip.asf
Format                           : Windows Media
File size                        : 5.28 MiB
Movie name                       : Slingbox
Performer                        : Sling Media
Comment                          : test

Video
ID                               : 1
Format                           : AVC
Format/Info                      : Advanced Video Codec
Codec ID                         : h264
Width                            : 640 pixels
Height                           : 480 pixels
Display aspect ratio             : 4:3
Color space                      : YUV
Chroma subsampling               : 4:2:0
Bit depth                        : 8 bits

Audio
ID                               : 2
Format                           : AAC
Format/Info                      : Advanced Audio Codec
Codec ID                         : FF
Bit rate                         : 64.0 Kbps
Channel(s)                       : 2 channels
Sampling rate                    : 32.0 KHz
Bit depth                        : 16 bits
Compression mode                 : Lossy


----------



## ShayL

moyekj, which model of the slingbox do you have?


----------



## moyekj

ShayL said:


> moyekj, which model of the slingbox do you have?


 350.
(I also have the original Slingbox Solo but retired it in favor of the 350 which works MUCH better under low bandwidth conditions).


----------



## aaronwt

moyekj said:


> 350.
> (I also have the original Slingbox Solo but retired it in favor of the 350 which works MUCH better under low bandwidth conditions).


I can even watch content from my SlingBox 350 at my GFs house with her crappy DSL 1.25Mb/s connection.


----------



## moyekj

aaronwt said:


> I can even watch content from my SlingBox 350 at my GFs house with her crappy DSL 1.25Mb/s connection.


 Yes, attempting to do that with an old Slingbox Solo would have been practically unwatchable. With the 350 the picture is quite watchable even at 900 Kbps or so.


----------



## moyekj

Dan203 said:


> That's weird, it's half the vertical resolution of standard 1920x1080. (1920x1080 is actually 1088 with a cropping rect removing the last 8 lines)
> 
> Can you send me that file?
> 
> http://www.videoredo.net/UploadFiles.htm
> 
> I want to see if I can get it to open in VideoReDo. (see if I can coax our FFmpeg reader into reading that format)


FYI I wasn't able to just remux into mp4 or ts container using ffmpeg using -acodec copy, but converting audio to ac3 worked fine:
FFMPEG -y -i INPUT -vcodec copy -acodec ac3 -f mp4 OUTPUT

Resulting mp4 then of course could be read into VRD without issue.


----------



## HarperVision

moyekj said:


> Yes, attempting to do that with an old Slingbox Solo would have been practically unwatchable. With the 350 the picture is quite watchable even at 900 Kbps or so.


I used to watch my Slingbox located in PA when I was in Afghanistan at 128kbps, talk about crappy, but it worked and I was able to watch all my sports at least. :up:

Why don't you guys just use the Jaksta software to do this? Much easier and not all these hoops to jump through.


----------



## jcthorne

moyekj said:


> Yes, attempting to do that with an old Slingbox Solo would have been practically unwatchable. With the 350 the picture is quite watchable even at 900 Kbps or so.


OK, you convinced me to spend some cash sitting in my paypal account and upgrade my ancient Slingbox Pro to a new 350 to get the h264 encoding and try this stream capture idea.

Any chance of adding this capability to kmttg or a separate utility?


----------



## moyekj

HarperVision said:


> Why don't you guys just use the Jaksta software to do this? Much easier and not all these hoops to jump through.


 Not familiar with it but it looks like non-free software?


----------



## moyekj

jcthorne said:


> Any chance of adding this capability to kmttg or a separate utility?


 Since it is Perl based and requiring a special Perl module it doesn't fit with kmttg. The Perl script here IS the utility, though I suppose you could probably have a wrapper script piping through ffmpeg to get a more standard mp4 or ts container.


----------



## qz3fwd

the crypt tea package likely implements std enc/dec algorithms. what are the c/c++ equivalent libraries to port this over to a compiled language?


----------



## Worf

It implements the TEA encryption (tiny encryption algorithm).

A tiny, but not very secure encryption algorithm that's used because of its small algorithm size. There are well known flaws in TEA that was used to break the original Xbox.


----------



## moyekj

Among other things the Perl script uses very powerful "pack" and "unpack" Perl functions which are not trivial to port to other languages. Probably the TEA part is more easily ported.


----------



## magnus

Series3Sub said:


> I plan on just getting one of the supported media streamers (like the WD Live) that have the Sling App already loaded. This means I can sling to my HDTV in the other room without having to use a PC or laptop. Just easier as I don't have the time anymore for much DYI.


That don't work no where near as good as a slingcatcher.


----------



## moyekj

FYI, I just found that using $vs=16 gives you full 1920x1080 resolution. I then remux to mp4 container & convert audio to ac3 and this is the resulting video specs:


Code:


General
Complete name                    : C:\home\video_samples\1920x1080_slingbox_sample.mp4
Format                           : MPEG-4
Format profile                   : Base Media
Codec ID                         : isom
File size                        : 6.97 MiB
Duration                         : 13s 920ms
Overall bit rate                 : 4 202 Kbps
Movie name                       : Slingbox
Performer                        : Sling Media
Writing application              : Lavf55.7.100
Comment                          : test

Video
ID                               : 1
Format                           : AVC
Format/Info                      : Advanced Video Codec
Format profile                   : [email protected]
Format settings, CABAC           : Yes
Format settings, ReFrames        : 2 frames
Codec ID                         : avc1
Codec ID/Info                    : Advanced Video Coding
Duration                         : 13s 881ms
Bit rate                         : 4 015 Kbps
Width                            : 1 920 pixels
Height                           : 1 080 pixels
Display aspect ratio             : 16:9
Frame rate mode                  : Variable
Frame rate                       : 29.970 fps
Minimum frame rate               : 29.412 fps
Maximum frame rate               : 30.303 fps
Color space                      : YUV
Chroma subsampling               : 4:2:0
Bit depth                        : 8 bits
Scan type                        : MBAFF
Bits/(Pixel*Frame)               : 0.065
Stream size                      : 6.64 MiB (95%)

Audio
ID                               : 2
Format                           : AC-3
Format/Info                      : Audio Coding 3
Mode extension                   : CM (complete main)
Codec ID                         : ac-3
Duration                         : 13s 920ms
Bit rate mode                    : Constant
Bit rate                         : 192 Kbps
Channel(s)                       : 2 channels
Channel positions                : Front: L R
Sampling rate                    : 32.0 KHz
Bit depth                        : 16 bits
Compression mode                 : Lossy
Stream size                      : 326 KiB (5%)

So this actually may be a decent method of making copies of CCI protected recordings from your TiVo.


----------



## Dan203

Why convert to AC3? The original audio is AAC so it should work without conversion.


----------



## moyekj

Dan203 said:


> Why convert to AC3? The original audio is AAC so it should work without conversion.


 Because ffmpeg craps out when just doing copy audio & video for some reason. i.e. Originally I tried using ffmpeg just for remux into mp4 and/or ts container and copying video & audio but that didn't work. However transcoding audio to ac3 allows remux to work so that's what I'm using. Probably with some more fiddling it may be possible to get working without transcoding audio but since it's only 2 channel audio it doesn't really matter one way or another to me.


----------



## Dan203

Yeah it's pretty low bitrate too, so since you're transcoding I'd suggest you bump the audio bitrate to at least 124. I'd probably go with 224 for AC3 since it's not as efficient as AAC and needs a few more bits to prevent further loss.


----------



## moyekj

Dan203 said:


> Yeah it's pretty low bitrate too, so since you're transcoding I'd suggest you bump the audio bitrate to at least 124. I'd probably go with 224 for AC3 since it's not as efficient as AAC and needs a few more bits to prevent further loss.


 Audio bitrate is already at 192 Kbps per the mediainfo dump. Probably bumping up the sampling rate to 48KHz would be better.


----------



## Dan203

Bumping the sample rate is like increasing the resolution of a picture. You're creating samples where they don't exist so the quality is at the mercy of the interpolation routine. I really don't recommend it unless you have a device that requires a higher sample rate.


----------



## moyekj

Since I really like this capability I have an initial implementation in place in kmttg planning to go out in next release. It's basically a GUI around the Perl script(s) posted here. I looked into porting the Perl scripts to Java but that turned out to be too daunting, so I left scripts as Perl called from kmttg.

Since I have Slingbox 350 I'm confident that it works well. I'm looking for volunteers with a Slingbox Pro or Slingbox Pro HD to test out the kmttg integration if there are any. I was not able to get my ancient Slingbox Solo working so that is unsupported.

If you want to volunteer to test this please post here or PM me.


----------



## jcthorne

You talked me into a 350, my Slingbox Pro went to the great recycling bin in the sky. Did not dawn on me to keep it for testing projects. I do look foreword to your kmttg upgrade with the sling support integrated.


----------



## jaredmwright

Moykj, let me know and I can test out. I have a Slingbox 350 and Solo and would love to have this capability. Let me know how to download and try it out.

Jared


----------



## moyekj

OK, for those that want to test it out, a full beta version of kmttg is available here:
http://kmttg.googlecode.com/files/kmttg_v1p0b_beta2.zip

Once installed, go to File-Config-Visual and enable "Show Slingbox capture tab".
Then you will see a "Slingbox" tab in kmttg main window. From there click on the "Help" button which will open a web browser pointing to the Wiki page with instructions on how to set things up.

If you have trouble or think the Wiki is not clear enough please post here so we can work through it.


----------



## moyekj

I was somewhat surprised to find today that this worked great from outside my home as well! Running kmttg at work I simply entered my WAN IP for Slingbox IP. I guess part of the Slingbox installation must automatically configure port forwarding in the router from WAN side to LAN side since I never did that manually.

So technically all you would need is the admin password and WAN IP to be able to capture other people's Slingbox outputs.


----------



## Dan203

moyekj said:


> I guess part of the Slingbox installation must automatically configure port forwarding in the router from WAN side to LAN side since I never did that manually.


I seem to remember there being a step about this in the PC software setup. IIRC it wasn't able to do it automatically for my particular router and I had to do it manually instead.


----------



## moyekj

FYI, for completeness I added optional ability to specify a channel to tune to via slingbox IR blaster before starting a capture. Not something I would use but since capability is there it may be useful for some.


----------



## moyekj

This capability is now officially released in kmttg v1p0b release. There were some changes and fixes implemented since the beta version so if using that you should update to the official version.


----------



## dearing

First off, thanks for adding this to KMTTG. I have a SB Pro and am really looking forward to trying out the Slingbox capture.

I'm a bit stuck at the second step, however. It appears Crypt-Tea_JS is now behind ActiveState's "Business Edition" section which requires a license. I'm not a Perl expert, so perhaps someone could direct me to how to install/build that package manually in WinXP (ActivePerl 5.10)?

Any help would be appreciated.


----------



## moyekj

You should update your installation of Perl to 5.16 or 5.18 and then you will be able to find that module without any problem. (I also had an older Perl installation before needing that module and couldn't get package manager to find the module).


----------



## dearing

Thanks. That did the trick. I am now able to record streams from my Pro-HD, but only on the "Slingbox Pro" setting in the "Slingbox model" drop-down box. 

Also, I can view the stream in VLC just fine, but can not open it for editing in VideoReDo TVSuite (I got a trial license to try it out. I had VideoReDo Plus already). However, when I open the .ts file in VRD TVSuite, I get the error message "H264 stream, missing info in the sequence parameter set." Is there a difference in the stream recording between the Pro-HD, Pro, and 300/500 models? HAve you or someone else been able to edit a stream recording from a Pro-HD?

I'm happy to help test out the app if you're still looking for testers.
Thanks.


----------



## moyekj

Yes I'm able to use VideoRedo TVSuite to edit the captures. Make sure you are using latest version which you can download here:
http://www.videoredo.net/beta/VRDTVSH264-4-21-2-666a.exe
Also for a trial VRD version I think you have to register with your trial key in order to get full functionality.


----------



## dearing

I just downloaded the trial (and registered the trial for 8 days of full features - I will buy only if I can get it to work with these streams). That's what I tried to open it with and got the above error. The version I got was 4.21.3.667, one release newer than the version you mentioned.
If I PM you a link to the .ts file, could you try to open it? I've put in a support question at the VRD forum also.

Edit: I've got too few posts to PM you. If you'd like to try the file, maybe PM me an email address or some other method. Or maybe the VRD folks will have a solution.


----------



## moyekj

dearing said:


> If I PM you a link to the .ts file, could you try to open it?


 OK. Note that I'm capturing from Slingbox 350 which I know puts out H.264 for video. It's possible your Pro is not H.264 for video which could be the problem.


----------



## dearing

I can't PM you yet due to forum rules (too pew posts), but VLC shows the Codec is

*H264 - MPEG-4 AVC (part 10) (h264) *for video and 
*A52 Audio (aka AC3) (a52)* for Audio

It also shows a SlingBox stream as Program1

Here's a Google Drive link. The file is 11MB: 
https://docs.google.com/file/d/0B_bRT-L-5Z3HaGRWU19RT0dhQWc/edit?usp=sharing


----------



## moyekj

It certainly seems like VRD should be able to open it but I had same trouble you posted trying to open it. Comparing it to another file I have the only real difference that stands out is AC3 audio sampling rate is 32KHz in your capture. I'll try and re-encode audio of your capture with 48KHz sampling rate using ffmpeg to see if that makes any difference...
I'd be curious to see what VRD folks say about it...


----------



## moyekj

Re-encoding audio to 48KHz sampling rate made no difference. I tried re-encoding video to H.264 and copying audio using ffmpeg and resulting sample could then be edited by VRD. So looks like VRD doesn't like something with the original H.264 video of the capture. Seems to me like possibly a VRD bug?


----------



## Dan203

I explained this over on our forums, but here is is again for posterity...

VideoReDo requires a frame rate to open a video. TS files do not have anywhere to store the frame rate at the container level which means we require it to be in the SPS NAL of the H.264 stream. It appears that these files are missing the frame rate in the SPS. With MP4/MKV files there is a place to store the frame rate at the container level, so in that case if we notice the frame rate missing from the SPS we just pick it up from the container instead. With TS that's not an option.

Most player programs don't care about the frame rate because they simply look at the time stamps for the individual frames and use those for playback. In VRD we need a frame rate for our syncing and recoding routines to work so we reject files that don't have one. This is the same reason we don't currently support variable frame rate video.

If you could make KMTTG remux to MP4/MKV and set the frame rate at the container level then those files would open. Although if you then save to TS the resulting file would lose the frame rate and you'd never be able to open it in VRD again.


----------



## moyekj

OK, based on Dan's post I took the sample and simply remuxed to mkv container using ffmpeg and the resulting file opens fine in VRD. You can use following encoding profile in kmttg to do it:

ff_mkv_remux.enc


Code:


<description>
Remux to matroska container for Slingbox captures for VideoRedo

<command>
FFMPEG -y -i INPUT -vcodec copy -acodec copy -f matroska OUTPUT

<extension>
mkv

Note that kmttg is already transcoding audio to AC3 during the capture using ffmpeg, so it would be trivial to write out to mkv instead of ts container. I'll have to think about perhaps using an encoding profile instead of hard coding so that user has option to adjust if desired.


----------



## dearing

Yes, I posted similar results at the VRD forum:

_"I used the tool "MKVToolNix", which is just a GUI wrapper for mkvmerge, among other things, and told it to force the framerate to 29.97 (well, 30000/1001p) and the .mkv file it created was openable/editable in VRD."_

I'm fine with using ffmpeg instead of mkvmerge to do the mkv container conversion. I'll try the encoding profile and let you know.
Thanks again!


----------



## Dan203

I looking at a possible way to fix this in VRD without having to remux. I'll report back if it works.


----------



## moyekj

For next release kmttg release I've added "Video container to use" option to Slingbox GUI with choice of mpegts or matroska. This was easier than giving full control over how to transcode.


----------



## dearing

That makes sense. However, I should still be able to encode Sling recordings after the recording is finished using the same encoding profile(s) I use for my TiVo recordings, right? Just using the "Files" tab and my encoding profile of choice?


----------



## Dan203

I got it working. I added some code that can calculate a frame rate based on the time stamps of the individual frames if neither an SPS or container frame rate exists. I'll try to sneak it into the next beta.


----------



## dearing

Good to know. I look forward to trying it out.


----------



## moyekj

dearing said:


> That makes sense. However, I should still be able to encode Sling recordings after the recording is finished using the same encoding profile(s) I use for my TiVo recordings, right? Just using the "Files" tab and my encoding profile of choice?


 Yes. Note that most of the encoding profiles assume your starting point is mpeg2 however. Depending on your target device it's possible you can leave the H.264 video alone though instead of re-encoding to H.264 which would save a lot of time and preserve better video quality. So it may be worthwhile making a custom profile that perhaps uses "-vcodec copy" and just re-encodes audio and uses a different container.


----------



## dearing

The devices I'd want them to play on (for now) would be Android (MX Player), PS3 and StreamBaby back to the TiVo. I will try the H264 in MKV Container not re-encoded on all 3 and see if I have any problems.


----------



## dearing

I noticed today the "Tune to channel" option at the bottom of the Slingbox tab. Would it be possible to issue a different command to the Slingbox's source device (TiVo, DVR, etc). For example, I might cue up the video I want to capture and pause it, and then would want the Slingbox capture to send the play/pause button command when it starts capturing. Otherwise I can use my regular remote control, but it would be nice to not have to.
Thanks again for the great tool and new features!


----------



## moyekj

dearing said:


> I noticed today the "Tune to channel" option at the bottom of the Slingbox tab. Would it be possible to issue a different command to the Slingbox's source device (TiVo, DVR, etc). For example, I might cue up the video I want to capture and pause it, and then would want the Slingbox capture to send the play/pause button command when it starts capturing. Otherwise I can use my regular remote control, but it would be nice to not have to.
> Thanks again for the great tool and new features!


 If you have a series 3 or later TiVo you are capturing from you can always use the kmttg Remote to do it. I know it's not automated like you were looking for but perhaps a little more convenient.


----------



## dearing

That is a good idea, and certainly use that to control my Premiere. Unfortunately that's not the only device attached to the Slingbox that I want to record from. How does the "Tune to channel" message work using the Perl script? Is it limited to channel commands?


----------



## moyekj

dearing said:


> That is a good idea, and certainly use that to control my Premiere. Unfortunately that's not the only device attached to the Slingbox that I want to record from. How does the "Tune to channel" message work using the Perl script? Is it limited to channel commands?


 No you can mimic any remote button press. You can look at the Perl script yourself: slingbox\rec2.pl for the Pro models. Lines 65-72 have the channel change related code:


Code:


if ($chan) {         # want to tune to a channel
    $ircmds = '';
#   $ircmds = pack("v4", 0x21, 500, 0x24, 500); # send Menu, Exit (in case power off)
    for $chdigit (split(//, sprintf("%04d", $chan))) {
        $ircmds .= pack("v2", $chdigit ? $chdigit + 8 : 18, 500);
    }
    sling_cmd(0x87, $ircmds . pack("x456 v4", 3, 0, 0, 0));
}

You'd have to figure out what the hex values are for each button press though. The 500 above I believe is #millisecs between button presses to use. Don't know how the original author figured out the hex values for each so that would be something you'd have to play with.


----------



## morac

I tried out kmttg with my Slingbox Pro HD and it captures video without a problem. The only issue I'm seeing is that the default resolution/aspect ratio is way off. I captured to a matroska formatted file and the default resolution is 1920x544 (aspect ratio 3.53:1). If I manually change the aspect ratio to 16:9 it looks fine, but it seems like it should pick a better default.

On a side note there's a few things you can tweak in your instructions:

1. You can get the Slingbox ip address and port at http://support.slingbox.com/
2. You can play the files in WMP if you install the Haali Media Splitter and ffdshow tryout codecs.


----------



## moyekj

I'll add a note about IP + port.
I don't have a Slingbox Pro to experiment with. But you may want to try hardcoding different values of $vs in slingbox\rec2.pl script and perhaps set $hd=1 (after the GetOptions call) to see if you can get a better default resolution and aspect ratio. On the 350/500 $vs=16 gives 1920x1080 and 16:9 aspect ratio and bit rate can be up to 7Mbps which results in really nice captures.


----------



## moyekj

FYI, if you read this post it looks like for Pro HD models if input is 720p then output will be 720p (16:9 aspect ratio):
http://placeshiftingenthusiasts.com...-in-high-definition-720-or-1080/page-4/#p8006
Apparently those models can't output 1080i video.


----------



## morac

moyekj said:


> FYI, if you read this post it looks like for Pro HD models if input is 720p then output will be 720p (16:9 aspect ratio): http://placeshiftingenthusiasts.com/forum/general-sling-box-discussions/how-to-record-slingbox-pro-hd-stream-in-high-definition-720-or-1080/page-4/#p8006 Apparently those models can't output 1080i video.


Odd. I wonder how the SlingPlayer iPad app works then. It outputs 720p from 1080i sources and looks fine. Unless it's doing some kind of hardware scaling.


----------



## moyekj

morac said:


> Odd. I wonder how the SlingPlayer iPad app works then. It outputs 720p from 1080i sources and looks fine. Unless it's doing some kind of hardware scaling.


 Using VLC player if you set 16:9 aspect ratio it looks OK right? So perhaps the iPad player is doing just that?


----------



## benicehavefun

moyekj said:


> Since I really like this capability I have an initial implementation in place in kmttg planning to go out in next release. It's basically a GUI around the Perl script(s) posted here. I looked into porting the Perl scripts to Java but that turned out to be too daunting, so I left scripts as Perl called from kmttg.
> 
> Since I have Slingbox 350 I'm confident that it works well. I'm looking for volunteers with a Slingbox Pro or Slingbox Pro HD to test out the kmttg integration if there are any. I was not able to get my ancient Slingbox Solo working so that is unsupported.
> 
> If you want to volunteer to test this please post here or PM me.


Thanks moyekj for including this nifty Perl script in kmttg. I have both a Solo and a Pro HD, with the Solo connected to a D*TV HD DVR so it's the one I'd like to use. So far, Slinguist's updated script "rec2a.pl" from page 9 of the Place Shifting Enthsiasts "How to record slingbox pro HD stream..." thread, is working fine with the Solo. I'd love to be able to run it through kmttg, though a quick jEdit compare of "rec2.pl" in your package and Slinguist's "rec2a.pl" leads me to believe a straight swap isn't going to work. Hard to tell what you changed vs Slinguist's changes from 2 to 2a. Is there an easy way to get 2a up and running with kmttg?


----------



## moyekj

benicehavefun said:


> Thanks moyekj for including this nifty Perl script in kmttg. I have both a Solo and a Pro HD, with the Solo connected to a D*TV HD DVR so it's the one I'd like to use. So far, Slinguist's updated script "rec2a.pl" from page 9 of the Place Shifting Enthsiasts "How to record slingbox pro HD stream..." thread, is working fine with the Solo. I'd love to be able to run it through kmttg, though a quick jEdit compare of "rec2.pl" in your package and Slinguist's "rec2a.pl" leads me to believe a straight swap isn't going to work. Hard to tell what you changed vs Slinguist's changes from 2 to 2a. Is there an easy way to get 2a up and running with kmttg?


 I have a Solo (the original Slingbox Solo) and couldn't get it to work with that modified version. I would say if you can try it out using straight Perl (i.e. not through kmttg) and manage to get it working with your Solo, then I can put in the effort to support it through kmttg. i.e. Basically just download the rec2a.pl script and modify IP and password as necessary and then run it directly using Perl to see if you can get it to work. It didn't quite work for me - I managed to connect to my Solo but it didn't like 1 or more commands sent from the script and was not able to capture anything.


----------



## benicehavefun

moyekj said:


> I have a Solo (the original Slingbox Solo) and couldn't get it to work with that modified version. I would say if you can try it out using straight Perl (i.e. not through kmttg) and manage to get it working with your Solo, then I can put in the effort to support it through kmttg. i.e. Basically just download the rec2a.pl script and modify IP and password as necessary and then run it directly using Perl to see if you can get it to work. It didn't quite work for me - I managed to connect to my Solo but it didn't like 1 or more commands sent from the script and was not able to capture anything.


I did another test this afternoon, this time with an hour long episode recorded in 1080i as a source and I'm able to capture a 640x480 recording using the Solo. So, a successful 60 minute capture today plus a couple of shorter prior tests, a half-hour and about 10 minutes. I haven't had any recording or playback issues. My Solo is about 5 years old, but has up-to-date firmware. Also, I've replaced the capacitors (which were bulging) causing lots of network disconnects. Since the capacitor replacement in June it's been working as new.

Anyway, if you're willing to implement the rec2a.pl script in kmttg, that would be fantastic! I'll definitely make use of it. This is one of the more convenient ways (for me) to get recordings off of my "locked-down" DVR.

BTW, I also experimented with Slinguist's suggested script change in Post 96 of the Place Shifting Enthusiasts thread, to get Play/Pause implemented as a command line option. In kmttg, perhaps in the channel change field? That would be sweet too, as one could start playback using a Sling client, pause it, and let the Slinguist script resume the playback upon execution. Unfortunately, I couldn't get it to work, the script would throw an error message immediately and never start capturing. Perhaps there was an issue using "p" as a command line argument rather than a channel number?

Thanks for taking a look at this!


----------



## moyekj

Can you attach here or provide a link to rec2a.pl script. I can't seem to find it or any attachments in that thread anymore (perhaps it requires login to see them).


----------



## benicehavefun

moyekj said:


> Can you attach here or provide a link to rec2a.pl script. I can't seem to find it or any attachments in that thread anymore (perhaps it requires login to see them).


Downloads are a little odd there, as you have to be logged in and you need to be sure you're not looking at a page cached in your browser if you went to the page before logging in! Login, then refresh page 9 and look at post #90. I don't have enough posts in this forum to attach a link but the download is at "placeshiftingenthusiasts.com/wp-content/sp-resources/forum-file-uploads/slinguist/2013/07/rec2a.zip"

If you end up back at the Place Shifting forum, and have a moment, see if the change Slinguist is talking about in post #96 has any obvious flaws. It didn't work for me, but it would be slick if we could send a "Play" IR command rather than a channel change for capturing existing DVR recordings...


----------



## moyekj

benicehavefun said:


> Downloads are a little odd there, as you have to be logged in and you need to be sure you're not looking at a page cached in your browser if you went to the page before logging in! Login, then refresh page 9 and look at post #90. I don't have enough posts in this forum to attach a link but the download is at "placeshiftingenthusiasts.com/wp-content/sp-resources/forum-file-uploads/slinguist/2013/07/rec2a.zip"
> 
> If you end up back at the Place Shifting forum, and have a moment, see if the change Slinguist is talking about in post #96 has any obvious flaws. It didn't work for me, but it would be slick if we could send a "Play" IR command rather than a channel change for capturing existing DVR recordings...


OK, I took that rec2a.pl script and added the kmttg related changes to it. So you can try now in your kmttg installation rename the existing rec2.pl under slingbox folder to something else, and then rename the rec2a.pl in attached zip file to rec2.pl and put it under kmttg slingbox folder. Then choose Slingbox Pro in kmttg and see if the captures work.

NOTE: I didn't test the script at all after making changes.


----------



## benicehavefun

moyekj said:


> OK, I took that rec2a.pl script and added the kmttg related changes to it. So you can try now in your kmttg installation rename the existing rec2.pl under slingbox folder to something else, and then rename the rec2a.pl in attached zip file to rec2.pl and put it under kmttg slingbox folder. Then choose Slingbox Pro in kmttg and see if the captures work.
> 
> NOTE: I didn't test the script at all after making changes.


Thanks moyekj! I just downloaded the zip, so I'll give it a try and let you know how it works...


----------



## benicehavefun

moyekj said:


> OK, I took that rec2a.pl script and added the kmttg related changes to it. So you can try now in your kmttg installation rename the existing rec2.pl under slingbox folder to something else, and then rename the rec2a.pl in attached zip file to rec2.pl and put it under kmttg slingbox folder. Then choose Slingbox Pro in kmttg and see if the captures work.
> 
> NOTE: I didn't test the script at all after making changes.


I've done a couple of quick 5 minute captures in .ts and .mkv and they look great. Thanks again. I'd like to be able to do a QSF and output to a WTV container, followed by Comskip processing (my standard work flow). I tried loading both clips into VideoRedo, without success. The .ts file gave me an error about header info, the .mkv loaded but the video looks terrible. Are there any options you can think of in kmttg that would produce a video file that could be opened in VideoRedo? Are the QSF, Ad Detect and Encode options in kmttg available for Slingbox captures too?


----------



## moyekj

Not sure what the Solo spits out for video but I don't think it's H.264 like the Pro and later do. Perhaps you can make a capture available so I can download and take a closer look?


----------



## benicehavefun

moyekj said:


> Not sure what the Solo spits out for video but I don't think it's H.264 like the Pro and later do. Perhaps you can make a capture available so I can download and take a closer look?


I'm attaching a link to a zip file containing two 5 minute sample captures for you to take a look at. Let me know when you've downloaded the file so I can delete it from Mega. Thanks again for the help!

EDIT: Link deleted by benicehavefun


----------



## benicehavefun

moyekj said:


> Not sure what the Solo spits out for video but I don't think it's H.264 like the Pro and later do. Perhaps you can make a capture available so I can download and take a closer look?


I'll be interested to hear what you think about the quality of the video coming off the Solo. It looks pretty good to me. When I Sling to my iPad I'm able to get "High Quality" off both my Solo and my Pro HD -- and they look identical.


----------



## moyekj

OK, I got it. The video is in H.264 format and yes it looks pretty nice. I also had trouble playing your mkv capture with VRD TVS4. However, when I started VRD a new version was available which I installed. The latest version is able to play the mkv capture properly. However, running qsfix or making cuts in the video and saving it results in garbled mess. I would suggest you post in VRD forums and upload the mkv to their ftp site for them to look at.

Time permitting I'll try and compare an mkv capture from my 350 to see what could be different. I also have actually never tried a qsfix or edits on a 350 mkv capture, so I'll try that out to see if that works OK.


----------



## morac

I'm not sure why, but when I tried to edit a 640x480 mkv file captured from my Slingbox Pro-HD in VideoRedo TV Suite and save it back to either a mkv or mp4, VideoRedo removed all the audio resync so basically the audio was lost.

The audio appears to be AC3. That's not an output option for VideoRedo. I tried re-encoding the audio, but that didn't help. It doesn't look like VideoRedo can process the audio on the files. It can play it, but can't do anything with the file.

Here's what the output showed:

Video output frames: 3640 
Audio output frames: 76 
Processing time (secs): 15 
Processed frames/sec: 241.89 
Actual Video Bitrate: 133.70 Mbps 
Audio resync frames removed: 2323

Edit:

Doing a quickstream fix results in the same issue.

I tried re-encoding, but that generated an error. Basically I can't edit the file in VideoRedo TV Suite.

Edit 2:

I think part of the problem might be that the reported frame rate is 1000 fps which is obviously wrong. The video plays back fine in every program I've tried so far. Editing is problematic though. I used ffmpeg to convert to a mp4 file and the resulting file played the audio at a normal speed, but the video was in extreme slow motion (less than 1 fps).

Edit 3:

I tried to use VideoRedo's elementary muxing capability to split the mp4 file and grab the m4a audio and then split the mpv and grab the H.264 video. VideoRedo complains the H.264 video file is not recognized as video, despite it having just created it.


----------



## moyekj

I think for these Slingbox Pro and earlier models the problem goes back to what Dan explained earlier in this thread:
http://www.tivocommunity.com/tivo-vb/showthread.php?p=9838027#post9838027

For benicehavefun sample above when I examine the mkv file with mediainfo, frame rate information is not available. In contrast for an mkv capture from my Slingbox 350 when I examine it using mediainfo, frame rate information is present under Video section. I'm able to edit mkv captures from my 350 with VRD without problems. So the 350 is putting extra information in container including frame rate.

It appears that VRD needs to have the frame rate information when editing the mkv file in any way, else it doesn't work properly.
It would be good to get some samples to VRD folks to get their perspective. If there's a way to improve the combination of capture + ffmpeg to make a VRD friendly version then I'd like to know about it.


----------



## morac

I found a work around. I installed mkvtoolnix and then opened the mkvmerge GUI and opened the file and in the video, changed the FPS to 30 fps and then "merged" it to a new file. After that VRD TV Suite could open and save it without issue. I didn't try re-encoding, but I didn't need to as the audio wasn't messed up when doing smart re-encoding.

mkvtoolnix is a bunch of command line tools with some GUI wrappers, so it could be run from kmttg if need be.


----------



## benicehavefun

moyekj said:


> I think for these Slingbox Pro and earlier models the problem goes back to what Dan explained earlier in this thread:
> http://www.tivocommunity.com/tivo-vb/showthread.php?p=9838027#post9838027
> 
> For benicehavefun sample above when I examine the mkv file with mediainfo, frame rate information is not available. In contrast for an mkv capture from my Slingbox 350 when I examine it using mediainfo, frame rate information is present under Video section. I'm able to edit mkv captures from my 350 with VRD without problems. So the 350 is putting extra information in container including frame rate.
> 
> It appears that VRD needs to have the frame rate information when editing the mkv file in any way, else it doesn't work properly.
> It would be good to get some samples to VRD folks to get their perspective. If there's a way to improve the combination of capture + ffmpeg to make a VRD friendly version then I'd like to know about it.


moyekj - Like morac, I've found a workaround for getting the kmttg Slingbox output into VideoRedo. His fix doesn't work on my files, however, if I take a .ts capture created by kmttg and run it through Handbrake with a constant framerate of 30, I'm able to work with the resulting .mp4. That file will load in VideoRedo and will then remux to a .wtv. That .wtv will play in WMC7 complete with commercial skipping via Comskip created skip files. The only thing that's a little funky is that WMC7 starts playing the audio right away and the video takes 5 seconds or so to get rolling, after that all is per usual.

So, hopefully this intermediate step will be eliminated in a future release of VideoRedo. I was wondering though, if it would be possible to force the framerate to 30 using ffmpeg's -r argument. I couldn't quite figure out the correct syntax myself to test it. I guess the question would be whether a forced frame rate of 30 would result in the header info VideoRedo is looking for. I'm guessing that my Handbrake step is fixing more issues than just that. It takes about 5 minutes to process a 60 minute episode.


----------



## moyekj

benicehavefun, can you confirm that the same rec2a.pl script posted above works for both your Pro and your Solo? To be safe I was going to designate the above script only for Solo models, but if it works OK with Pro models as well I may reconsider.


----------



## morac

moyekj said:


> benicehavefun, can you confirm that the same rec2a.pl script posted above works for both your Pro and your Solo? To be safe I was going to designate the above script only for Solo models, but if it works OK with Pro models as well I may reconsider.


I tested it with a Pro-HD. It seems to work fine, besides the 1000 fps issue.


----------



## moyekj

morac said:


> I tested it with a Pro-HD. It seems to work fine, besides the 1000 fps issue.


 OK thanks, I'll probably keep 1 script for both then.


----------



## morac

moyekj said:


> OK thanks, I'll probably keep 1 script for both then.


Actually I did see one issue that slipped my mind, but I don't know if it's the script or something else since I could capture successfully, just not every time. Sometimes the video capture would freeze and stutter at start up causing skips in the video (the time counter in KMTTG would actually pause or even jump back and forth between 0 and the current time). I just took that to be an issue with my machine though since it seemed to happen randomly at the start of captures. Once the capture started working it was good to go.

I also didn't try a HD capture since the source video I wanted was SD and the aspect of HD videos was all screwed up in my earlier captures. As such I don't know if HD videos work better or worse than before.


----------



## benicehavefun

moyekj said:


> benicehavefun, can you confirm that the same rec2a.pl script posted above works for both your Pro and your Solo? To be safe I was going to designate the above script only for Solo models, but if it works OK with Pro models as well I may reconsider.


moyekj - I don't have my HD dish setup right now, which means the receiver connected to my Pro HD isn't giving any meaningful video for me to capture. However, I'll get it setup later today and get back to you to confirm functionality on your version of rec2a.pl with the Pro HD. Thanks!


----------



## benicehavefun

moyekj - it sounds like you're working on rolling rec2a.pl into a future kmttg release -- if so I have a couple of feature requests:

The first is, would you be willing to add an option to your "Slingbox" tab for us to use our own output filename? If so, I'd be able fully automate the process from Slingbox capture through to having the episode show up on my HTPC, without a manual rename step required after the capture is completed.

The second (and less important), what are the chances that the kmttg "tune to channel" field could also be used to send either a Slingbox "Select/OK" or "Play" IR command instead of the channel change digits? There was some work done on this in Place Shifting Enthusiasts thread. This way kmttg could start DVR playback of an already queued-up episode at the same time a capture is initiated.


----------



## moyekj

I'll plan to add optional file naming to the GUI. For the 2nd request since I don't have an older Slingbox so I can't test the rec2a.pl script for Select, Play IR commands. You can experiment with a copy of the script and try and get that going based on the PSE thread and if you do get something working I can try and incorporate into kmttg.


----------



## benicehavefun

moyekj said:


> I'll plan to add optional file naming to the GUI. For the 2nd request since I don't have an older Slingbox so I can't test the rec2a.pl script for Select, Play IR commands. You can experiment with a copy of the script and try and get that going based on the PSE thread and if you do get something working I can try and incorporate into kmttg.


Ok great! Thanks for adding a custom output file name option. I'll see what I can do about getting those IR commands figured out...


----------



## benicehavefun

moyekj said:


> benicehavefun, can you confirm that the same rec2a.pl script posted above works for both your Pro and your Solo? To be safe I was going to designate the above script only for Solo models, but if it works OK with Pro models as well I may reconsider.


moyekj - Ok, I set up my HD dish and I can confirm that your version of the rec2a.pl script (through kmttg) works great with the Pro HD. No issues. Thanks again!


----------



## moyekj

FYI, I just released new version of kmttg (v1p0j) that has a few Slingbox related enhancements:
* Support for Solo models
* Optional file name specification
* Option to capture raw file from Slingbox (in asf container) without remuxing to new container and re-encoding audio to ac3.


----------



## benicehavefun

moyekj said:


> FYI, I just released new version of kmttg (v1p0j) that has a few Slingbox related enhancements:
> * Support for Solo models
> * Optional file name specification
> * Option to capture raw file from Slingbox (in asf container) without remuxing to new container and re-encoding audio to ac3.


Excellent! Thanks for the continued development of kmttg. I'll confirm with you after I've tested my Solo with this latest release.


----------



## benicehavefun

moyekj said:


> FYI, I just released new version of kmttg (v1p0j) that has a few Slingbox related enhancements:
> * Support for Solo models
> * Optional file name specification
> * Option to capture raw file from Slingbox (in asf container) without remuxing to new container and re-encoding audio to ac3.


The new release is working great with the Solo. The ability to capture the raw file is nice too! FYI - The output directory and filename in raw output mode aren't enclosed in quotes when the command line is generated -- so spaces aren't tolerated. Easy to work around but would be great if you could fix that next time around. Is this an OK place to report issues, or do have an official tracker system?


----------



## moyekj

benicehavefun said:


> FYI - The output directory and filename in raw output mode aren't enclosed in quotes when the command line is generated -- so spaces aren't tolerated.


 Good catch. Fixed in source code for next release.


----------



## bayern_fan

Getting "invalid perl executable" with kmttg on Mac OSX

Right now I'm having it point at /usr/local/ActivePerl-5.16/bin which I thought was correct. Any advice?

UPDATE: Changed Perl directory to /usr/local/ActivePerl-5.16/bin/perl-dynamic but now getting the following error

_Capture to file failed: /Users/../Desktop/kmttg_v1p0j/slingbox_2013_11_19_19_29_11.ts
Exit code: 1
FFmpeg version SVN-r19732, Copyright (c) 2000-2009 Fabrice Bellard, et al.
configuration: [email protected]_path --arch=i386 --cpu=i686 --disable-static --enable-shared --enable-pthreads --enable-gpl --enable-libmp3lame --enable-libfaac --enable-nonfree --enable-libfaad --enable-libx264 --extra-cflags='-I/Users/yoav/src/lame/include -I/Users/yoav/src/faad2-2.7/include -I/Users/yoav/src/faac-1.28/include -I/Users/yoav/src/x264' --extra-ldflags='-L/Users/yoav/src/lame/libmp3lame/.libs -L/Users/yoav/src/faad2-2.7/libfaad/.libs -L/Users/yoav/src/faac-1.28/libfaac/.libs -L/Users/yoav/src/x264/'
libavutil 50. 3. 0 / 50. 3. 0
libavcodec 52.34. 0 / 52.34. 0
libavformat 52.38. 0 / 52.38. 0
libavdevice 52. 2. 0 / 52. 2. 0
libswscale 0. 7. 1 / 0. 7. 1
built on Aug 27 2009 10:32:06, gcc: 4.0.1 (Apple Inc. build 5484)
box in use at /Users/.../Desktop/kmttg_v1p0j/slingbox/rec350.pl line 61.
pipe:: Unknown format_


----------



## moyekj

I think the key error message you are getting is "box in use" (I bolded below), which would imply maybe you have something else using the Slingbox while you are attempting to use kmttg to capture the video. You cannot have anything else using your Slingbox while you try the capture. The 350/500 have a light that comes on indicating when it is in use, so make sure that is off before attempting a capture.



bayern_fan said:


> Getting "invalid perl executable" with kmttg on Mac OSX
> 
> Right now I'm having it point at /usr/local/ActivePerl-5.16/bin which I thought was correct. Any advice?
> 
> UPDATE: Changed Perl directory to /usr/local/ActivePerl-5.16/bin/perl-dynamic but now getting the following error
> 
> _Capture to file failed: /Users/../Desktop/kmttg_v1p0j/slingbox_2013_11_19_19_29_11.ts
> Exit code: 1
> FFmpeg version SVN-r19732, Copyright (c) 2000-2009 Fabrice Bellard, et al.
> configuration: [email protected]_path --arch=i386 --cpu=i686 --disable-static --enable-shared --enable-pthreads --enable-gpl --enable-libmp3lame --enable-libfaac --enable-nonfree --enable-libfaad --enable-libx264 --extra-cflags='-I/Users/yoav/src/lame/include -I/Users/yoav/src/faad2-2.7/include -I/Users/yoav/src/faac-1.28/include -I/Users/yoav/src/x264' --extra-ldflags='-L/Users/yoav/src/lame/libmp3lame/.libs -L/Users/yoav/src/faad2-2.7/libfaad/.libs -L/Users/yoav/src/faac-1.28/libfaac/.libs -L/Users/yoav/src/x264/'
> libavutil 50. 3. 0 / 50. 3. 0
> libavcodec 52.34. 0 / 52.34. 0
> libavformat 52.38. 0 / 52.38. 0
> libavdevice 52. 2. 0 / 52. 2. 0
> libswscale 0. 7. 1 / 0. 7. 1
> built on Aug 27 2009 10:32:06, gcc: 4.0.1 (Apple Inc. build 5484)
> *box in use* at /Users/.../Desktop/kmttg_v1p0j/slingbox/rec350.pl line 61.
> pipe:: Unknown format_


----------



## benicehavefun

moyekj said:


> I'll plan to add optional file naming to the GUI. For the 2nd request since I don't have an older Slingbox so I can't test the rec2a.pl script for Select, Play IR commands. You can experiment with a copy of the script and try and get that going based on the PSE thread and if you do get something working I can try and incorporate into kmttg.


moyekj - I've been playing around with getting "p" for "PLAY" and "o" for "OK/Select" working as an option in lieu of sending a channel change command in the rec2a.pl script.

I have it working for both the Solo and the Pro HD with the following code:

$ircmds .= pack("v2", $chdigit eq 'p' ? 24 : $chdigit eq 'o' ? 42 : $chdigit ? $chdigit + 8 : 18, 500);

which replaces:

$ircmds .= pack("v2", $chdigit ? $chdigit + 8 : 18, 500);

The kicker is that on the Solo $irparm needs to be set to 2 and on the Pro HD it needs to be set to 3. It's a nice little extra to be able to start the capture right at the beginning of playback on a recorded show, so if you can work it in to kmttg, that would be great!

Thanks.


----------



## hollowfield

benicehavefun said:


> moyekj - I've been playing around with getting "p" for "PLAY" and "o" for "OK/Select" working as an option in lieu of sending a channel change command in the rec2a.pl script.
> 
> I have it working for both the Solo and the Pro HD with the following code:
> 
> $ircmds .= pack("v2", $chdigit eq 'p' ? 24 : $chdigit eq 'o' ? 42 : $chdigit ? $chdigit + 8 : 18, 500);
> 
> which replaces:
> 
> $ircmds .= pack("v2", $chdigit ? $chdigit + 8 : 18, 500);
> 
> The kicker is that on the Solo $irparm needs to be set to 2 and on the Pro HD it needs to be set to 3. It's a nice little extra to be able to start the capture right at the beginning of playback on a recorded show, so if you can work it in to kmttg, that would be great!
> 
> Thanks.


Hi, I am playing with the rec2a.pl script, I'm more interested in remote control than recording. I added my Slingbox IP and Password to the script and ran it. This was giving me a 135 error, so I changed the irparm from 3 to 2 as per the instructions in the script. The script works for recording, but the channel doesn't change.

rec2a.pl -chan 101

I am using a slingbox solo and a sky+hd box.

Any help would greatly be appreciated.


----------



## benicehavefun

hollowfield said:


> Hi, I am playing with the rec2a.pl script, I'm more interested in remote control than recording. I added my Slingbox IP and Password to the script and ran it. This was giving me a 135 error, so I changed the irparm from 3 to 2 as per the instructions in the script. The script works for recording, but the channel doesn't change.
> 
> rec2a.pl -chan 101
> 
> I am using a slingbox solo and a sky+hd box.
> 
> Any help would greatly be appreciated.


So, am I correct that you're running the kmttg modified version of the script from the command line? Also, is this a UK version of the Solo?

If you don't need or want a GUI, you may want to get the original version of rec2a.pl from:

http://placeshiftingenthusiasts.com...stream-in-high-definition-720-or-1080/page-9/

(You'll need to register to see the script attached to one of the posts on page 9)

Then, the usage would be in the form:

perl.exe -w rec2a.pl <x> <y> <z>

Where <x> is the delay in seconds before beginning capture, <y> is the number of seconds to capture and <z> is the channel number to change to. Don't use the < >!

If you look through the above above referenced forum, you'll see that another user with a UK Slingbox (a Pro HD) had to set $irparm = 0. So 2 and 3 aren't the only options...


----------



## dbtom

Thanks for this awesome program! It works so well I just bought a 350 to replace my Solo.

Does anyone have a recommendation for a good way to split the video files? I'd like to queue up a bunch of videos on my Tivo. I'd then have one big video file that I'd like to split into 30 minute or 1 hour chunks. Any suggestions would be greatly appreciated. 

I've been processing the .ts files using handbrake to put on my iPad after downloading. I have VideoRedo but not the newest version.


----------



## Kamakzie

Hey guys, just discovered kmttg with my Sling 350. Works great. However under video resolutions I have 1920x1080 or 640x480. Is there anyway to add 1280x720? Thanks!


----------



## mikez104

Hi. I'm trying to use this but am getting a error when trying to run the script. Can someone point me in the right direction? Thanks
C:\>perl -w rec350b.pl
cmd: 103 err: 2 8 at rec350b.pl line 43.


----------



## dearing

Moyekj,
I'm trying out the new slingbox mkv capture feature(v1p0l), and it appears to be building the mkv stream with a listed framerate of 1000. This is causing errors in VideoReDo(TVSuite x264 v 4.21.6.674) even when I have VRD's x264 config set to read the frame rate from the stream rather than container/auto. The current fix is to run the mkv through mkvMerge and manually set the framerate just like it's necessary to do when using the MPEGTS container option on the slingbox tab. Is there a reason the mkv container is setting the framerate so high? 

I don't think it saves any steps over the mpegts option at this point without a valid frame rate value, unless I'm missing something. Is there even a constant frame rate possible from the SlingBox (I have a Pro-HD)?

Other than that, I can capture video just fine, run it through MkvMerge, and edit/encode in VRD. This is fantastic, and I feel guilty asking for even more. However, do you think it's possible to add an automatic encode step after Slingbox capture using an existing kmttg encoding profile? I can't decide if it would add value to the tool or not, as there may be cropping/trimming necessary before encode. Just wondering if it's something you'd considered.


----------



## dearing

A weird problem started happening tonight, although it's been a few days since I've used the slingbox capture. I'm now getting the following error. Is it maybe something I've screwed up in config somewhere? The error line in the perl script is the unpack of the data header. Thanks for any help!



Code:


>> CAPTURING SLINGBOX TO f:\temp\sling\slingbox_2014_01_27_22_39_26.mkv ...
"c:\Perl\bin\perl.exe" "C:\Documents and Settings\Compaq_Administrator\My Documents\Downloads\kmttg\slingbox\rec2.pl" -stdout -ip 192.168.15.254 -port 5001 -pass <removed> -vbw 4000 -vs 5 -dur 60.0 | "C:\Documents and Settings\Compaq_Administrator\My Documents\Downloads\kmttg\ffmpeg\ffmpeg.exe" -fflags +genpts -i - -vcodec copy -acodec ac3 -ab 224k -y -f matroska "f:\temp\sling\slingbox_2014_01_27_22_39_26.mkv"
Capture to file failed: f:\temp\sling\slingbox_2014_01_27_22_39_26.mkv
Exit code: 1
ffmpeg version N-53033-g56ba331 Copyright (c) 2000-2013 the FFmpeg developers
  built on May 13 2013 22:18:29 with gcc 4.7.3 (GCC)
  configuration: --enable-gpl --enable-version3 --disable-w32threads --enable-avisynth --enable-bzlib --enable-fontconfig --enable-frei0r --enable-gnutls --enable-iconv --enable-libass --enable-libbluray --enable-libcaca --enable-libfreetype --enable-libgsm --enable-libilbc --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-libopus --enable-librtmp --enable-libschroedinger --enable-libsoxr --enable-libspeex --enable-libtheora --enable-libtwolame --enable-libvo-aacenc --enable-libvo-amrwbenc --enable-libvorbis --enable-libvpx --enable-libx264 --enable-libxavs --enable-libxvid --enable-zlib
  libavutil      52. 31.100 / 52. 31.100
  libavcodec     55.  9.100 / 55.  9.100
  libavformat    55.  7.100 / 55.  7.100
  libavdevice    55.  0.100 / 55.  0.100
  libavfilter     3. 65.100 /  3. 65.100
  libswscale      2.  3.100 /  2.  3.100
  libswresample   0. 17.102 /  0. 17.102
  libpostproc    52.  3.100 / 52.  3.100
Died at C:\Documents and Settings\Compaq_Administrator\My Documents\Downloads\kmttg\slingbox\rec2.pl line 80.
pipe:: Invalid data found when processing input


----------



## moyekj

Power cycle the Slingbox?


----------



## dearing

Yeah. I tried that. I'm getting the same error when I run the perl script from DOS, so I'm sure it has nothing to do with kmttg. I'll need to look into wherever you got that script from for more details I think.


Update: On a whim, I tried using Solo instead of the Pro-HD in the "Slingbox Model" option and it captures now, even though I'm connecting to a Pro-HD. It only captures at 640x480 even when I choose the 1920x1080 resolution option, but it's a start.

Maybe something changed in the slingbox recently. It's running Firmware 2.1.420, released 10/29/1013, so not sure what might have done.


----------



## moyekj

The resolution and bit rate selectors are only relevant for 350/500 models as indicated in tooltips.

NOTE: In your kmttg installation if you rename rec2.pl to rec2.orig.pl and rec2a.pl to rec2.pl and then pick Slingbox Pro as model I suspect it will work as it was before. Let me know if that works. In recent kmttg releases I use rec2.pl for Pro models and rec2a.pl for Solo models. Perhaps what really needs to happen is to use rec2a.pl for both.


----------



## dearing

moyekj said:


> In your kmttg installation if you rename rec2.pl to rec2.orig.pl and rec2a.pl to rec2.pl and then pick Slingbox Pro as model I suspect it will work as it was before. Let me know if that works. In recent kmttg releases I use rec2.pl for Pro models and rec2a.pl for Solo models. Perhaps what really needs to happen is to use rec2a.pl for both.


Works great, Thanks.

Framerate of the mkv is still 1000, but I'm going to try to change the ffmpeg command built in slingbox.java to specify the framerate of 29.97 later and see if that doesn't break anything. I'll let you know how that goes.


----------



## dearing

dearing said:


> I'm going to try to change the ffmpeg command built in slingbox.java to specify the framerate of 29.97 later and see if that doesn't break anything. I'll let you know how that goes.


Adding "-r 29.97" before the -f on line 159 of slingbox.java (ffmpeg command) did the trick. I can now open the .mkv file in VRD and save it directly without having to rebuild the stream in MKVTool first.

I can't see that it had any effect on the MPEGTS output option, as the recorded .ts file still plays in VLC and I don't see the framerate set in it at all.


----------



## moyekj

OK, latest changes to slingbox.java are all checked in including adding -r 29.97 to ffmpeg for non 350/500 models, so if you build kmttg.jar from source (and put rec2.pl and rec2a.pl back to how they were since now kmttg uses rec2a.pl for all models except 350/500) it should function properly for you now.


----------



## dearing

moyekj said:


> OK, latest changes to slingbox.java are all checked in including adding -r 29.97 to ffmpeg for non 350/500 models.


What is the framerate for mkv video coming out of the 300/500 models, out of curiosity?


----------



## moyekj

dearing said:


> What is the framerate for mkv video coming out of the 300/500 models, out of curiosity?


 Mediainfo shows 29.97 as framerate and VRD is able to edit my .mkv captures without needing to add -r 29.97 to ffmpeg command. Both VLC and VRD show 30.33 for some odd reason but otherwise seem to play it back fine. But given that discrepancy I decided it's best to add the -r 29.97 for 350/500 captures as well.


----------



## ciarpame

Thank you for this thread! I decided to buy a refurbished slingbox solo and now I'm able to record the slingbox streaming using kmttg.
Now I have a few questions for you. 

Even if the kmttg tooltip and in this forum it's stated otherwise, the bitrate control is working for Solo, file size changes when the bitrate is changed. I also tried to use bitrate lower that 4000 (by forcing a different birate directly in rec2a.pl) and it seems to me that a lower bitrate than can be used without visibile quality losses.
I would like to know about you bitrate experiences, which value do you suggests for recording with Solo (it's limited to 640x480). It seems to me that 4000 or higher for a h264 codec at such resolution could be overkill but maybe I'm wrong.
Also, anyone tried to change the smoothness in rec2a.pl to a value different from the default one?
Is it possibile to have a different audio sampling rate and bitrate different from the default one (32000Hz at 224kbps)? 

I must confess I'm not a tivo user but an european mysky hd user even if it seems to me it does not matter to much to be a tivo user to post in this specific thread.

Thank you again to moyekj and to script contributors.


----------



## moyekj

ciarpame said:


> Is it possibile to have a different audio sampling rate and bitrate different from the default one (32000Hz at 224kbps)?


 You can capture the raw Slingbox feed and then use ffmpeg or similar to remux and/or transcode audio of that capture to your liking. The current remux + audio conversion to ac3 built into kmttg is hard coded with no user options other than mpegts or matroska container.


----------



## hshsrva

when i am recording from slingbox 350 it suddenly stops. i may set it for 60 mins and it will stop. no error.


>> CAPTURING SLINGBOX TO C:\Users\Brandin\videos\slingbox_2014_03_03_17_43_54.ts ...
"C:\Perl64\bin\perl.exe" "C:\Users\Brandin\Downloads\kmttg_v1p0p\slingbox\rec350.pl" -stdout -ip 192.168.1.4 -port 5212 -pass Vp2Et85O7KuPTXR -vbw 4000 -vs 16 -dur 3900.0 | "C:\Users\Brandin\Downloads\kmttg_v1p0p\ffmpeg\ffmpeg.exe" -fflags +genpts -i - -vcodec copy -acodec ac3 -ab 224k -r 29.97 -y -f mpegts "C:\Users\Brandin\videos\slingbox_2014_03_03_17_43_54.ts"
C:\Users\Brandin\videos\slingbox_2014_03_03_17_43_54.ts: size=4.88 MB elapsed=0:00:21
---DONE--- job=slingbox output=C:\Users\Brandin\videos\slingbox_2014_03_03_17_43_54.ts


----------



## moyekj

hshsrva said:


> when i am recording from slingbox 350 it suddenly stops. i may set it for 60 mins and it will stop. no error.
> 
> >> CAPTURING SLINGBOX TO C:\Users\Brandin\videos\slingbox_2014_03_03_17_43_54.ts ...
> "C:\Perl64\bin\perl.exe" "C:\Users\Brandin\Downloads\kmttg_v1p0p\slingbox\rec350.pl" -stdout -ip 192.168.1.4 -port 5212 -pass Vp2Et85O7KuPTXR -vbw 4000 -vs 16 -dur 3900.0 | "C:\Users\Brandin\Downloads\kmttg_v1p0p\ffmpeg\ffmpeg.exe" -fflags +genpts -i - -vcodec copy -acodec ac3 -ab 224k -r 29.97 -y -f mpegts "C:\Users\Brandin\videos\slingbox_2014_03_03_17_43_54.ts"
> C:\Users\Brandin\videos\slingbox_2014_03_03_17_43_54.ts: size=4.88 MB elapsed=0:00:21
> ---DONE--- job=slingbox output=C:\Users\Brandin\videos\slingbox_2014_03_03_17_43_54.ts


 Next time you run via kmttg, double-click on the job in the job monitor table to see stdout/stderr messages and see if anything suspicious shows up there.


----------



## hshsrva

frame= 1852 fps= 33 q=-1.0 size= 17900kB time=00:01:01.86 bitrate=2370.3kbits/s 
frame= 1870 fps= 33 q=-1.0 size= 18231kB time=00:01:02.48 bitrate=2390.1kbits/s 
frame= 1888 fps= 33 q=-1.0 size= 18566kB time=00:01:03.06 bitrate=2411.7kbits/s 
frame= 1908 fps= 33 q=-1.0 size= 18944kB time=00:01:03.73 bitrate=2434.9kbits/s 
frame= 1920 fps= 33 q=-1.0 size= 19169kB time=00:01:04.12 bitrate=2449.0kbits/s 
frame= 1938 fps= 33 q=-1.0 size= 19497kB time=00:01:04.74 bitrate=2466.9kbits/s 
frame= 1953 fps= 33 q=-1.0 size= 19784kB time=00:01:05.22 bitrate=2484.9kbits/s 
frame= 1970 fps= 33 q=-1.0 size= 20098kB time=00:01:05.80 bitrate=2502.1kbits/s 
frame= 1984 fps= 33 q=-1.0 size= 20368kB time=00:01:06.28 bitrate=2517.5kbits/s 
frame= 2002 fps= 33 q=-1.0 size= 20695kB time=00:01:06.85 bitrate=2535.7kbits/s

00:01:06 pkts:6000frame= 2020 fps= 33 q=-1.0 size= 21028kB time=00:01:07.48 bitrate=2552.7kbits/s 
frame= 2035 fps= 33 q=-1.0 size= 21303kB time=00:01:07.96 bitrate=2567.9kbits/s 
frame= 2049 fps= 33 q=-1.0 size= 21574kB time=00:01:08.44 bitrate=2582.3kbits/s 
frame= 2067 fps= 33 q=-1.0 size= 21894kB time=00:01:09.01 bitrate=2598.8kbits/s 
frame= 2085 fps= 33 q=-1.0 size= 22243kB time=00:01:09.64 bitrate=2616.6kbits/s 
frame= 2102 fps= 33 q=-1.0 size= 22569kB time=00:01:10.21 bitrate=2633.0kbits/s 
frame= 2116 fps= 33 q=-1.0 size= 22813kB time=00:01:10.64 bitrate=2645.3kbits/s 
frame= 2131 fps= 33 q=-1.0 size= 23106kB time=00:01:11.17 bitrate=2659.4kbits/s 
frame= 2148 fps= 33 q=-1.0 size= 23427kB time=00:01:11.75 bitrate=2674.7kbits/s 
frame= 2163 fps= 33 q=-1.0 size= 23713kB time=00:01:12.23 bitrate=2689.4kbits/s 
ff asf bad header 30 at:21265131
[asf @ 025a2860] invalid padsize 36469 at:21265133
[asf @ 025a2860] ff asf bad header 0 at:21265141
[asf @ 025a2860] packet_obj_size invalid
[asf @ 025a2860] invalid packet_length 1138798642 at:21267751
frame= 2167 fps= 32 q=-1.0 size= 23781kB time=00:01:12.37 bitrate=2691.7kbits/s 
frame= 2168 fps= 32 q=-1.0 Lsize= 23804kB time=00:01:12.38 bitrate=2694.1kbits/s

video:19814kB audio:1979kB subtitle:0 global headers:0kB muxing overhead 9.224176%


----------



## moyekj

Try the "Capture raw file" option in kmttg which will bypass use of ffmpeg to see if it is the Sling capture that is causing capture to stop, or ffmpeg.


----------



## HarperVision

I keep getting this error when I try to capture from my remotely located (in PA) Pro-HD:


Capture to file failed: D:\Recorded TV\slingbox_2014_03_17_09_20_07.ts
Exit code: 1
ffmpeg version N-53033-g56ba331 Copyright (c) 2000-2013 the FFmpeg developers
built on May 13 2013 22:18:29 with gcc 4.7.3 (GCC)
configuration: --enable-gpl --enable-version3 --disable-w32threads --enable-avisynth --enable-bzlib --enable-fontconfig --enable-frei0r --enable-gnutls --enable-iconv --enable-libass --enable-libbluray --enable-libcaca --enable-libfreetype --enable-libgsm --enable-libilbc --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-libopus --enable-librtmp --enable-libschroedinger --enable-libsoxr --enable-libspeex --enable-libtheora --enable-libtwolame --enable-libvo-aacenc --enable-libvo-amrwbenc --enable-libvorbis --enable-libvpx --enable-libx264 --enable-libxavs --enable-libxvid --enable-zlib
libavutil 52. 31.100 / 52. 31.100
libavcodec 55. 9.100 / 55. 9.100
libavformat 55. 7.100 / 55. 7.100
libavdevice 55. 0.100 / 55. 0.100
libavfilter 3. 65.100 / 3. 65.100
libswscale 2. 3.100 / 2. 3.100
libswresample 0. 17.102 / 0. 17.102
libpostproc 52. 3.100 / 52. 3.100
missing or bad response header at C:\Users\Dave\Desktop\slingbox\rec2a.pl line 168.
pipe:: Invalid data found when processing input


----------



## moyekj

Do you have Slingbox IP set in kmttg as your PA WAN IP? Also enable "Capture raw file" option to eliminate ffmpeg from the picture (though I doubt that's the problem).


----------



## HarperVision

Yes it is set to the PA WAN IP and I tried to raw capture to no avail. I was thinking maybe I'm using an incorrect version of perl? Mine is from March 2013 I think.


----------



## moyekj

Check that you can use regular Sling client to communicate with that Slingbox. Also double-check you have the correct port number in kmttg setup per the instructions of the Help button. (I don't believe that's the issue here but it can't hurt to double-check all your settings anyway).

Ideally you would want to check if things work in your PA LAN 1st before trying out of home, perhaps using Remote Desktop, VNC or similar if you don't have physical access.


----------



## HarperVision

I've checked and rechecked and all the IPs and ports are correct. I am watching that slingbox as we speak so I know it works that way. I don't think I'm going to be able to do remote access. It's at my parents house and it was hard enough to get them to even use a TiVo HD I gave them. Plus I'm no expert on setting up something like that myself.


----------



## HarperVision

I do have a 350 here at this location that I'll probably test it with as well, but would like to be able to record from the PA Pro-HD if possible.


----------



## moyekj

Without being able to check on LAN it makes things difficult. Only other thing I can think of is make sure you are not actually using the Sling client when attempting a capture - there can only be 1 connection at a time to the Slingbox, so attempting to capture when still connected will result in an error.


----------



## HarperVision

Yeah I know about the one client deal. Been with sling since it's inception with the classic. I actually got one before they were even released from my distributor at the time. 

It makes me think it's a perl issue based on this last line, agreed?:

missing or bad response header at C:\Users\Dave\Desktop\slingbox\rec2a.pl line 168.
pipe:: Invalid data found when processing input


----------



## moyekj

HarperVision said:


> Yeah I know about the one client deal. Been with sling since it's inception with the classic. I actually got one before they were even released from my distributor at the time.
> 
> It makes me think it's a perl issue based on this last line, agreed?:
> 
> missing or bad response header at C:\Users\Dave\Desktop\slingbox\rec2a.pl line 168.
> pipe:: Invalid data found when processing input


It's not a Perl issue really, but some error that is occurring. That line is:


Code:


sysread($s_ctrl, $hbuf, 32) == 32 or die "missing or bad response header";

i.e. It's trying to read back 32 bytes of response header from Slingbox and not getting 32 bytes back and hence throwing an error and exiting. So the problem really is unexpected Slingbox response.


----------



## HarperVision

Any way to edit it to make it work in some way? Maybe get rid of the "die" part or adjust it down from 32 bytes to something lower?

Do we know that we are both looking at the same version of perl? Mine is from March 2013, a year ago. Is there a newer one with changes?


----------



## moyekj

HarperVision said:


> Any way to edit it to make it work in some way? Maybe get rid of the "die" part or adjust it down from 32 bytes to something lower?
> 
> Do we know that we are both looking at the same version of perl? Mine is from March 2013, a year ago. Is there a newer one with changes?


 If you're running via kmttg then just use Help->Update kmttg and you should get the latest. It's not a Perl issue. If you want to try and debug you could change the line to something like:


Code:


sysread($s_ctrl, $hbuf, 32) == 32 or die "missing or bad response header: $hbuf";

This will print the contents of $hbuf (if any) which may give some clue as to what is happening. But it could well be there is no response from Slingbox in which case $hbuf would be empty.


----------



## HarperVision

Wow thanks for all the help. I'll try that when I get back home tonight. If you happen to think of anything else please let me know!


----------



## HarperVision

Ok I tried it with my local sling 350 and I'm getting a similar error, except now it says it's on line 140. Strange. I'd REALLY love it if someone could loan me access via their guest login for their 350 or 500 for a day or so in order to test a few things. Any takers?  Dave


----------



## HarperVision

Success!!! I forgot I had to find out the Admin PW for the 350/500. Once I did that I
Can now record from my local 350. Now I just need to see if I can get it working remotely using my Pro-HD.


----------



## christheman

Sounds great. How's the performance/transfer rate looking with the Slingbox? Is it comparable to TS file downloads through the built-in network adapter on the Tivo?


----------



## moyekj

christheman said:


> Sounds great. How's the performance/transfer rate looking with the Slingbox? Is it comparable to TS file downloads through the built-in network adapter on the Tivo?


It will never be as good as original recording since Slingbox is re-encoding from analog output. That being said, the Slingbox 350/500 models can capture at 1920x1080i resolution and a pretty high bit rate, so captures look pretty good. The following is a sample Slingbox 350 capture from a TiVo Mini output:
Sample Slingbox 1080i capture

(And of course Slingbox captures are not affected by CCI byte since they are capturing analog output, so you can capture any channel for any provider).


----------



## morac

moyekj said:


> And of course Slingbox captures are not affected by CCI byte since they are capturing analog output, so you can capture any channel for any provider).


I'm fairly certain TiVo applies Macrovision protection on analog outputs when the CCI byte is detected.


----------



## moyekj

morac said:


> I'm fairly certain TiVo applies Macrovision protection on analog outputs when the CCI byte is detected.


 Doesn't affect the Slingbox if it does.


----------



## christheman

moyekj said:


> It will never be as good as original recording since Slingbox is re-encoding from analog output. That being said, the Slingbox 350/500 models can capture at 1920x1080i resolution and a pretty high bit rate, so captures look pretty good. The following is a sample Slingbox 350 capture from a TiVo Mini output:
> Sample Slingbox 1080i capture
> 
> (And of course Slingbox captures are not affected by CCI byte since they are capturing analog output, so you can capture any channel for any provider).


Thanks for uploading the sample. That looks fantastic. I guess I will add that to my list of options. Since I already have a Tivo, this will probably be the most convenient. All the other options involve ditching the Tivo - at least for my HD transfers. All over the ridiculous CCI byte... A part of me doesn't want to give them the power to break something else and disable me in some other way.


----------



## cosmogoblue

moyekj said:


> It will never be as good as original recording since Slingbox is re-encoding from analog output. That being said, the Slingbox 350/500 models can capture at 1920x1080i resolution and a pretty high bit rate, so captures look pretty good. The following is a sample Slingbox 350 capture from a TiVo Mini output
> 
> (And of course Slingbox captures are not affected by CCI byte since they are capturing analog output, so you can capture any channel for any provider).


I have read through this entire series and have the kmttg working well in windows. However, my quality is not near the sample provided. Can you summarize the configurations made in order to obtain this?

I am using a Slingbox 350 with DirecTV H20 receiver. Again, everything seems to work fine but in comparing quality, there is more to be desired.


----------



## moyekj

Sample capture was from a TiVo Mini component output: 1920x1080i @6000 Kbps in mpegts container from NBC HD recording.


----------



## Dan203

FYI I added the ability to open these files directly, without the MKV conversion, to VideoReDo v5. We plan to start a beta of v5 on Monday and if all goes well we should start selling it in about a month.

It's got a LOT of new stuff that's been in development for about a year and half so I'm excited to finally get it into the hands of users. If any of you are registered v4 users and want to try it out send me a PM and I'll see about getting you into the beta.


----------



## cosmogoblue

I think I may have an older version. How do I ensure I have the most up-to-date? Could that be the reason that the quality I am experiencing is well below the sample provided?


----------



## moyekj

cosmogoblue said:


> I think I may have an older version. How do I ensure I have the most up-to-date? Could that be the reason that the quality I am experiencing is well below the sample provided?


 Help->Update kmttg. Don't think that has anything to do with it though.


----------



## cosmogoblue

Is there a certain encoding profile to use?


----------



## moyekj

There is no encoding profile being used. The capture is being remuxed to new container and audio converted to AC3, but original video stream is preserved. To check video quality you should just view your Slingbox 350 output directly using web browser client. Quality you see aside from Slingbox encoding depends on how well your H20 receiver outputs analog component output.


----------



## cosmogoblue

would hdmi provide better video quality? Also, how good is AC3 audio compared to the original?


----------



## moyekj

HDMI captures will only work for unencrypted channels, so probably won't work at all for capturing from satellite. Plus Slingbox 350 doesn't have HDMI input anyway.

You can capture original stream with no changes at all by kmttg by turning on "Capture raw file" option in order to compare quality.


----------



## cosmogoblue

thanks! where is that setting located?


----------



## moyekj

It's part of the Slingbox tab.


----------



## PowerCC

Will this method work for Slingbox M1? I just received mine and I would love to participate.
So far I needed to install Slingplayer for Desktop (no longer web streaming) however I did notice it's using the same web plugin by right clicking on the stream.

UPDATE: I got the Slingbox M1 stream capture working; make sure to use port 5301 instead of the default 5201.


----------



## moyekj

No idea if it works for M1. Guess you'll have to try.


----------



## HarperVision

PowerCC said:


> Will this method work for Slingbox M1? I just received mine and I would love to participate. So far I needed to install Slingplayer for Desktop (no longer web streaming) however I did notice it's using the same web plugin by right clicking on the stream.


I just read about this product last night over at placeshiftingenthusiasts.com and it sounds promising:

http://www.spesoft.com/slingftont-htpc-10-foot-slingbox-front-end.aspx


----------



## Dan203

FYI we just opened up the beta for VideoReDo v5 to the public, which includes the fix to be able to edit these files directly without the extra remuxing step.

http://www.videoredo.net/msgBoard/forumdisplay.php?44-VideoReDo-TVSuite-V5-Beta


----------



## grimmace92

Hi Moyekj,


I don't have tivo but i do have a slingbox and setup kmttg to record the slingbox stream. To my delight it worked following the great instructions. My question is if there is a script that can be scheduled in windows task scheduler to tell the slingbox what time/channel/show to record by calling kmttg. I have no experience using perl at all and was hoping you could point me in the right direction of what to do. Maybe a batch file or something? Thanks for your time.


----------



## moyekj

You can see what a sample perl script call looks like when starting from kmttg in the message window. So then take that and confirm you can run it manually from command line, and that will be what you setup windows scheduler to run.


----------



## dirtsy

Ok, I'm driving myself out of my mind here with a couple of minor annoyances. I have successfully gotten captures up and running, no problems there, the issues have been:

(for the record, I did do a clean install of MacOS 10.13 over the weekend, and have everything up and running again with kmttg, including captures, and all other kmttg functions are running fine...autoskip, etc. And am using a Slingbox 350 for my captures)

1) For some reason now, the Slingbox capture tab does not stay active after Exit of kmttg. For it to reappear, I have to Open the Config Settings, click OK, then it shows back up.

2) When I first played around with the Slingbox Capture, I found a way to change the rec350.pl file to manually adjust the video bitrate down lower than 4000...I confirmed the lower bitrates via MediaInfo, so I know I figured out how to do it somehow! (The change I believe I made was line 39
from: "$vbw=s" => sub {$vbw = $_[1];},
to: "vbw=s" => sub {$vbw = 2500},

However, for some reason, I cannot get this to work again! Am I losing my mind and just dreamed the previous lower bitrate successes?


----------



## moyekj

I fixed the issue of "Slingbox" tab not showing up when starting kmttg for the next release. Hadn't used Slingbox tab in a long time myself. I don't remember the details exactly, but the lower limit of 4000 that is in the GUI I think was intentional as I don't believe it used to work below that.


----------



## TK978

Trying to set up a Slingbox 500 for use with Kmttg this is the error message I am getting? Anyone have any ideas?

>> CAPTURING SLINGBOX TO E:\Videos\Slingbox\slingbox_2018_05_24_18_36_34.ts ...
"C:\Perl64\bin\perl.exe" "E:\Documents\KMTTG\slingbox\rec350.pl" -stdout -ip (deleted for post) -port 5201 -pass (deleted for post) -vbw 4000 -vs 16 -dur 600.0 -chan 807 | "E:\Documents\KMTTG\ffmpeg\ffmpeg.exe" -fflags +genpts -i - -vcodec copy -acodec ac3 -ab 224k -r 29.97 -y -f mpegts "E:\Videos\Slingbox\slingbox_2018_05_24_18_36_34.ts"
Capture to file failed: E:\Videos\Slingbox\slingbox_2018_05_24_18_36_34.ts
Exit code: 1
ffmpeg version N-79000-g66edd86 Copyright (c) 2000-2016 the FFmpeg developers
built with gcc 5.3.0 (GCC)
configuration: --enable-gpl --enable-version3 --disable-w32threads --enable-avisynth --enable-bzlib --enable-fontconfig --enable-frei0r --enable-gnutls --enable-iconv --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libdcadec --enable-libfreetype --enable-libgme --enable-libgsm --enable-libilbc --enable-libmodplug --enable-libmfx --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-libopus --enable-librtmp --enable-libschroedinger --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libtheora --enable-libtwolame --enable-libvidstab --enable-libvo-amrwbenc --enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxavs --enable-libxvid --enable-libzimg --enable-lzma --enable-decklink --enable-zlib
libavutil 55. 19.100 / 55. 19.100
libavcodec 57. 28.100 / 57. 28.100
libavformat 57. 28.100 / 57. 28.100
libavdevice 57. 0.101 / 57. 0.101
libavfilter 6. 39.102 / 6. 39.102
libswscale 4. 0.100 / 4. 0.100
libswresample 2. 0.101 / 2. 0.101
libpostproc 54. 0.100 / 54. 0.100
cmd: 103 err: 2 8 at E:\Documents\KMTTG\slingbox\rec350.pl line 140.
pipe:: Invalid data found when processing input


----------



## dirtsy

> cmd: 103 err: 2 8 at E:\Documents\KMTTG\slingbox\rec350.pl line 140.


For some reason I recall this error as an incorrect Slingbox admin password.


----------



## TK978

dirtsy said:


> For some reason I recall this error as an incorrect Slingbox admin password.


Thanks that worked had one of my previous Slingbox Admin Passwords entered. Changed to the Slingbox 500 Admin Password now it works perfect....Should have figured that out on my own...sometimes need a fresh set of eyes ...thanks again


----------



## ahwman

Hello,

After installing ActivePerl v5.26, I can't find the Crypt-Tea_JS package needed to support SlingBox capture. I tried to download an older version of ActivePerl, but couldn’t find any...

Any ideas?


----------



## SugarBowl

Did you run the Perl Package Manager that gets installed with active state perl ? Run it, and enter 'crypt-tea' in the search box.


----------



## ahwman

SugarBowl said:


> Did you run the Perl Package Manager that gets installed with active state perl ? Run it, and enter 'crypt-tea' in the search box.


I did that, however there were two versions of crypt-tea, neither of which are crypt-tea_js. I had to import it from an older installation of ActivePerl...


----------



## SugarBowl

I am running 5.24.3


----------



## ahwman

SugarBowl said:


> I am running 5.24.3


Yep, that version has it. Unfortunately the newest version is 5.26 does not have it and I could not find the older versions anywhere.


----------



## SugarBowl

I just installed 5.28 and it doesn't come with the package manager.


----------



## ahwman

SugarBowl said:


> I just installed 5.28 and it doesn't come with the package manager.


Yep. I had to install 5.26 which still comes with the PPM and then move over the tea_js module from my 5.24 installation...


----------

