How to record ANY streaming video using VLC

About encoding, codec settings, muxers and filter usage
felinis
New Cone
New Cone
Posts: 9
Joined: 28 Mar 2009 21:41

How to record ANY streaming video using VLC

Postby felinis » 15 Apr 2009 00:04

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.

Threk
New Cone
New Cone
Posts: 3
Joined: 14 May 2009 23:02

Re: How to record ANY streaming video using VLC

Postby Threk » 15 May 2009 00:39

have you been able to get it to stream to a file? if so was it in version 0.9.x?

I can use uscreencapture to watch a part of the screen, but if I try to save it to a file... it crashes. Even with transcode settings that work on files.

gregoryjames915
New Cone
New Cone
Posts: 1
Joined: 27 Jan 2010 20:04

Re: How to record ANY streaming video using VLC

Postby gregoryjames915 » 27 Jan 2010 20:07

i followed the instructions for using vlc and everything worked except the video had a very blue tent. how can i fix that?

oscar_vlan
New Cone
New Cone
Posts: 6
Joined: 06 Feb 2010 00:04

Re: How to record ANY streaming video using VLC

Postby oscar_vlan » 06 Feb 2010 00:11

Thanks for your explanation. I am really interested in it. But I can not find what you explain in the following sentences:

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.

I can not see any "Stream/save" nor a file to add a name nor all other settings.

I have downloaded the most recent version 1.0.5. Goldeneye.

Many thanks

Oscar
Barcelona, Spain

brh986
New Cone
New Cone
Posts: 4
Joined: 25 Mar 2010 19:36

Re: How to record ANY streaming video using VLC

Postby brh986 » 26 Mar 2010 13:00

Can anyone tell me how the record button works on the VLC windows interface? I've found no documentation on it anywhere. I'm trying to just make smaller snipets of a longer video. Is this how it works? Where to the files get stored and in what format? Thanks.

rogerdpack
Big Cone-huna
Big Cone-huna
Posts: 574
Joined: 19 Jul 2008 23:48
Operating System: windows

Re: How to record ANY streaming video using VLC

Postby rogerdpack » 18 Jun 2010 02:06

It saves a nameless file to your "My Documents" (I believe) folder.
http://www.howtogeek.com/howto/2686/how ... th-vlc-1.0

Also note that I have an open source screen capture directshow filter available if anyone wants to use it:

https://github.com/rdp/screen-capture-r ... ndows-free

NadiaUSA
New Cone
New Cone
Posts: 1
Joined: 14 Feb 2012 20:23

Re: How to record ANY streaming video using VLC

Postby NadiaUSA » 14 Feb 2012 20:30

I like using this VLC approach but I have the streaming movies Filmon.com App player on my desktop and I can't record it well. Has anyone tried to get hulu to work. When I use real player all I get downloaded is the commercials. I was thinking of using fraps to screen record but it seems so CPU intensive.

Nadia

rogerdpack
Big Cone-huna
Big Cone-huna
Posts: 574
Joined: 19 Jul 2008 23:48
Operating System: windows

Re: How to record ANY streaming video using VLC

Postby rogerdpack » 14 Feb 2012 21:45

looks like fraps can record an aero desktop. https://sourceforge.net/projects/screencapturer might help (or camstudio)

SuicideBomberBarbie
New Cone
New Cone
Posts: 1
Joined: 05 Mar 2012 01:44

How to record ANY streaming video

Postby SuicideBomberBarbie » 05 Mar 2012 01:53

Can anyone tell me how to just create a clip to share? I don't really want to download entire videos and am not an expert.

Tambourineman
New Cone
New Cone
Posts: 2
Joined: 18 Jul 2013 17:32

Re: How to record ANY streaming video using VLC

Postby Tambourineman » 18 Jul 2013 17:51

I am trying to follow this method.

I am running Windows 7 ultimate

I have VideoLAN version VLC media player 2.0.7 Twoflower

I have Screen Capture DirectShow Source Filter. x64 Edition Version 2.0.15

when I go to "File\Open Capture Device..." I can select mode =DirectShow but video device = UScreenCapture does not show as an option. I copied the uscreencapture codec to VideoLAn's CODEC folder but no joy.

The only options that show are:

default
none
HAVA remote video device
HAVA video

How do I get the uscreencapture to show as a selectable option?

Tambourineman
New Cone
New Cone
Posts: 2
Joined: 18 Jul 2013 17:32

Re: How to record ANY streaming video using VLC

Postby Tambourineman » 21 Jul 2013 14:57

I got uscreencapture to show as an option by locating version 2.0.13 and installing that rather than 2.0.15.

however, I still can't get this method to work as the checkbox option for this later version of VLC (2.0.7) are different from the one those shown above for a much earlier version and I can not figure out the ones to select.

rogerdpack
Big Cone-huna
Big Cone-huna
Posts: 574
Joined: 19 Jul 2008 23:48
Operating System: windows

Re: How to record ANY streaming video using VLC

Postby rogerdpack » 29 Jul 2013 15:47



Return to “VLC stream-output (sout)”

Who is online

Users browsing this forum: No registered users and 4 guests