Difference between revisions of "Talk:Netflix Video Stream Capture"
(Silverlight Diagnostics Menu and Bitrate Control) |
(Silverlight “adaptive playback” mode) |
||
Line 114: | Line 114: | ||
source: http://silentarchimedes.wordpress.com/2009/03/29/netflix-watch-instantly-silverlight-workaround-for-windows-xp/ | source: http://silentarchimedes.wordpress.com/2009/03/29/netflix-watch-instantly-silverlight-workaround-for-windows-xp/ | ||
+ | |||
+ | == Silverlight “adaptive playback” mode == | ||
+ | |||
+ | Silverlight has an “adaptive playback” mode which attempts to choose one of multiple bandwidths for your video and switch on the fly if needed. | ||
+ | |||
+ | CTRL-SHIFT-ALT-D gives diagnostic information on-screen. | ||
+ | |||
+ | CTRL-SHIFT-ALT-S allows you to manually force silverlight/netflix player to use a specific bandwidth for playback. | ||
+ | |||
+ | typical sizes are 500, 1000, and 1500 KBps | ||
+ | |||
+ | the key-combos above wont work in full-screen mode. Have the netflix player in a browser window for them to work. |
Latest revision as of 20:07, 6 February 2011
How to record ANY streaming video using VLC
Postby felinis on Wed Apr 15, 2009 12:04 am The following is intended for Windows users only. If you want to skip the history lession, scroll down to HOW TO DO IT WITH VLC:
It is well known that anyone can record TV programming to a PC by using a video capture card to create a digital video stream that can be captured on a PC. I have been doing this for years using such capture software as Snapstream Beyond TV, VideoDub and of course VLC. The last two are open source (free) software. My favorite DVD burning software is currently DVD Flick, since it can burn DVD-compatable MPEG-2 files directly to DVD without a lengthy encoding process.
But recently I have been downloading a lot of streaming video - YouTube, instant movies, streaming TV programs, etc. Occasionally I would like to record these too, so I started to do some research.
Capturing YouTube is simple - just extract the download URL from the current YouTube web-page and use it to download the video that you have selected. Everyone is doing it and there are dozens of software tools and techniques for doing this. Visit my own YouTube channel at:
http://www.youtube.com/user/MrAlaskaVideo
Just don't download my videos :-).
In 2007 there was a furior over someone having broken the DRM encoding on Netflix "Instant view" streaming movie downloads. With the Netflix viewing system of that time, it was possible to download the entire movie to a large WMV file using a free hacking tool called NetFlixBrowser. The hitch is that this file is encoded/protected with DRM and is unviewable without online authorization from Netflix. So the hackers would then apply a series of free tools such as UnDRM and FairUse4WM to remove the DRM, allowing the file to be copied, viewed or burnt to DVD.
The new Silverlight-based Netflix viewer now prevents the capture of the entire Netflix stream by repeatedly opening and closing the stream, putting an end to that exploit. Silverlight has its own DRM system too.
Stream capture of video sources can of course be accomplished with VLC, if you can detect the stream and determine its URL. The commercial product WM Recorder does this automatically.
One can also attempt to find the temporary hard disk location where the video stream is being buffered and copy it from there.
There are also a number of commercial "Screencasting" tools, originally intended to be used in education to capture on-screen lectures and tutorials. Since they all have an audio capture feature, these can be configured to capture full-motion video as well. The most popular ones are WM Capture, Camtassia and Daniusoft.
My research brought me to the following conclusions:
1. DRM hacking is illegal, too much work and is becoming less and less feasable.
2. Off-the-shelf products like WM Capture and Camtassia produce jerky full-motion video captures with funky colors.
So I set out to develop my own video stream capture techniques, with DVD Flick-compatible MPEG-2 format as the end target - techniques to record video un-hindered by DRM or copy-protection schemes.
Video Tuner
My first attempt was to fall back on my old stand-by USB video capture tuner. All good video tuner cards have on-board MPEG encoders, so you are streaming MPEG-encoded video/audio into your compuer from the get-go.
I plugged the S-video port of my HP laptop into the tuner to capture the laptop's screen video. I routed the headphone jack into the capture box's "Audio In" port to capture computer audio. This worked very well and I was able to capture any streaming video that I could display on my screen, using Beyond TV for timed recording or VLC for attended sessions. Any capture software that accepts DirectShow input devices works. Those with MPEG-2 output are preferred.
HOW TO DO IT WITH VLC
My second attempt allowed me to get rid of the video tuner hardware loop-back. I discovered the free DirectShow screen capture codec called UScreenCapture from Unreal Streaming Technologies. UScreenCapture allows me to capture all or part of the screen at up to 30 frames per second. This works great with VLC version 0.8.6.
All of my DirectShow-based capture tools accept this codec except for Beyond TV. Unfortunate, since VLC does not have a working timed recording feature (except for the un-fathomable VLM). It is very convienient to be able to set your capture software to record over-night and terminate when the source video is over.
Play your source video stream in a player - windowed, not full-screen. Your internet connection must be capable of streaming high-speed video. You must start out with decent source video that does not jerk or pause.
To get started at the VLC GUI, go "File\Open Capture Device..." and select mode =DirectShow and video device = UScreenCapture. Under "Advanced options" check off "Device" and close the dialog. Select "Stream/Save Settings". Select "File" and det your capture filename. Add a ".MPG" extension if you are captuing to MPEG format as recommended. Select "MPEG PS", "Video" and "Audio". Configure them as described below, close the dialog and start the capture.
You will be prompted for the codec setup. Configure it as described below. Bring up the VLC messages and statistics displays for debug purposes and open your capture folder to monitor the size of your capture file.
Codec Configuration
Set the screen capture boundries on the capture device to 720x480. This is a valid DVD format and will make the frames a lot easier to encode to DVD.
Your capture software can record using any video codec that you want, but MPEG-2 can be recorded to DVD without lengthy recoding.
MPEG Confiiguration
For select single-pass, constant bit-rate video compression. A bitrate of 4000 kbps should record two hours of video and just fill up one single density DVD. Use 2048 kbps to reduce the computational load on your PC.
I found that an I-frame setting of one per second, complex motion setting and a high bitrate help to prevent jerkiness in the streamed video.
Audio Configuration
Set your default "Playback" sound device to Speaker (not S/PDIF) and the default "Record" device to Audio Mixer. If no mixer device appears as a recording selection, right-click on the "Recording" dialog and enable the display of "Disabled Devices".
The type of audio codec doesn't matter much as long as your DVD burner has a matching decoder. Select a DVD-compliant constant-rate audio format - PCM, AC-3, or MP2, 48KHz, 192kbps, 16-bit stereo. If you do this then your DVD burner may not have recode the audio at all.
Frame Rate
24-to-30 FPS.
Here is the VLC command line:
dshow:// :dshow-vdev="UScreenCapture" :dshow-adev="WaveOut Mix (Conexant High Defi" :dshow-size=""
- dshow-caching=200 :dshow-chroma="" :dshow-fps=0.000000 :dshow-config :no-dshow-tuner :dshow-tuner-channel=0
- dshow-tuner-country=0 :dshow-tuner-input=0 :dshow-video-input=-1 :dshow-audio-input=-1 :dshow-video-output=-1
- dshow-audio-output=-1
- sout=#transcode{vcodec=mp2v,vb=2048:sout=#transcode{vcodec=mp2v,vb=2048,scale=1,acodec=a52,ab=192,channels=2}
,scale=1,acodec=a52,ab=192,channels=2}
How to do it with Windows Media Encoder
On my third attempt I tried using UScreenCapture with Windows Media Encoder. It wasn't a strong choice, since my target video format is MPEG-2. WME produces WMV, which takes DVD Flick fifteen times as long to encode. If you do not find this to your liking, use the VLC solution above, but do read the recording tips below also.
But guess what? WME has its OWN screen capture device! This codec is just as good as UScreenCapture. One can capture/record ANY video from the screen using WME, protected or not! And one is not limited to recording sound only when with the PC's internal speaker as the default sound playback device. WME will record audio from any of the audio devices, including S/PDIF. And it allows timed recording.
WME starts with a wizard page that has a screen catpure selection. This is a good place to start. Use the video/audio settings described above for the VLC player. Select the capture option that projects a flashing capture box on-screen.
Increase both the frame and bit rates from the wizard's default to make them more appropriate for full-motion video - 24 FPS and 2400 Kbps. 2400 Kbps may be way too fast, but I think in terms of MPEG-2, not WMV. 24 fps looks a little jerky to me, so kick it up to 29.97 if you can afford the extra resources.
Start your video streaming source (whatever!) windowed. Adjust it so that the picture is playing on-screen, within the flashing boundries. Verify your audio (read above). This may take several tries.
This work is not suitable for slow or single processor computers. Remember, you are performing two computationally and disk intensive operations - streaming the video download, captuing the screen and compressing it all at the same time. My Dell Inspiron 1.73 GHz single M processor laptop chokes trying to do things like this, but my set-top 1.73 GHz dual-processor HP Pavillion laptop does just fine. If your computer bogs down with the processing load, reduce the screen capture area to 360x240.
That is it boys and girls - capture your streaming video to MPEG-2 or WMV, then burn it to DVD.
Silverlight Diagnostics Menu and Bitrate Control
Silverlight comes with a hidden diagnostic menu. Use Shift-Alt with a left click of the mouse to reveal the Silverlight diagnostic menu.
Click on the A/V menu item.
Look at the PLAYING VIDEO BITRATE and the BUFFERING VIDEO BITRATE.
The buffer rate should never be lower than the playing rate, or you will have dropped frames.
You can change the settings by forcing an override with another hidden Silverlight option under the diagnostic menu.
Click on Stream Manager and check the Manual Selection box. Then check the 500 bitrate box
Silverlight “adaptive playback” mode
Silverlight has an “adaptive playback” mode which attempts to choose one of multiple bandwidths for your video and switch on the fly if needed.
CTRL-SHIFT-ALT-D gives diagnostic information on-screen.
CTRL-SHIFT-ALT-S allows you to manually force silverlight/netflix player to use a specific bandwidth for playback.
typical sizes are 500, 1000, and 1500 KBps
the key-combos above wont work in full-screen mode. Have the netflix player in a browser window for them to work.