{"id":15163,"date":"2018-04-23T17:36:04","date_gmt":"2018-04-23T16:36:04","guid":{"rendered":"https:\/\/www.digitalking.it\/?p=15163"},"modified":"2019-10-03T16:31:58","modified_gmt":"2019-10-03T14:31:58","slug":"record-live-video-streams-with-vlc","status":"publish","type":"post","link":"https:\/\/www.digitalking.it\/en\/2018\/04\/23\/record-live-video-streams-with-vlc\/","title":{"rendered":"Record live video streams with VLC"},"content":{"rendered":"<span class=\"span-reading-time rt-reading-time\" style=\"display: block;\"><span class=\"rt-label rt-prefix\">Reading time:<\/span> <span class=\"rt-time\"> 3<\/span> <span class=\"rt-label rt-postfix\">minutes<\/span><\/span><p><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/i.imgur.com\/hd6vMJa.png\" width=\"350\" height=\"200\" alt=\"VLC\" class=\"aligncenter size-thumbnail\" \/><\/p>\n<p><a href=\"https:\/\/www.videolan.org\/vlc\/\" target=\"_blank\" rel=\"noopener\">VLC<\/a> isn&#8217;t only a popular and very good media player available for many platforms, but it can also record live video streams.<br \/>\nThe first step is to download and install the latest version of VLC, if you already didn&#8217;t.<\/p>\n<p>The followind guide is based on Windows, but it can be easily adapted to other OS.<\/p>\n<p>VLC allows to open live video streams, and it supports various protocols.<br \/>\nClick the <strong>Media<\/strong> tab and then click <strong>Open Network Stream&#8230;<\/strong> and insert a valid URL, then press Play.<br \/>\nThe live video stream will start playback.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/i.imgur.com\/Dfuc1hl.jpg\" width=\"668\" height=\"432\" alt=\"VLC\" class=\"aligncenter size-thumbnail\" \/><\/p>\n<p>Once the video stream connection has been established, you can record it.<\/p>\n<p>The record commands are displayed under the <strong>Playback<\/strong> tab. To record the video, click <strong>Record<\/strong>, click it again to stop recording.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/i.imgur.com\/lnozXIJ.jpg\" width=\"648\" height=\"432\" alt=\"VLC\" class=\"aligncenter size-thumbnail\" \/><\/p>\n<p>The recorded videos are automatically saved to Documents folder of your Windows profile, you will find a file named with <strong>.ts<\/strong> extension that you can open with VLC or convert it in another format with one of many video converter software available.<br \/>\nIF you want to change the folder where the recordings are saved select <strong>Tools -> Preferences<\/strong>, now select for <strong>Input &#038; Codecs<\/strong> then <strong>Files: Record Directory or Filename<\/strong> (put a valid path).<\/p>\n<p>Lets go further, VLC also allows to record live video stream using command line, so you can schedule a batch at certain time.<\/p>\n<p>Open a text editor and write the following string:<\/p>\n<pre class=\"nums:false lang:default decode:true \" title=\"RecordVLC.bat\" >\"C:\\Program Files (x86)\\VideoLAN\\VLC\\vlc.exe\" https:\/\/xxxxxx.net :sout=#duplicate{dst=file{dst=C:\\Users\\name\\Desktop\\record.ts},dst=display} :no-sout-rtp-sap :no-sout-standard-sap :ttl=1 :sout-keep --run-time=30 vlc:\/\/quit<\/pre>\n<p>Save the file where you want and give it a name, for example RecordVLC.bat.<\/p>\n<p>Explaination of the string:<\/p>\n<p><strong>https:\/\/xxxxxx.net<\/strong> &#8211; URL of the live video stream<br \/>\n<strong>{dst=file{dst=C:\\Users\\name\\Desktop\\record.ts}<\/strong> &#8211; destination path and filename (change the name with the name of your Windows profile)<br \/>\n<strong>dst=display<\/strong> &#8211; automatically display the live video stream when VLC opens<br \/>\n<strong>&#8211;run-time=30<\/strong> &#8211; recording time in seconds<br \/>\n<strong>vlc:\/\/quit<\/strong> &#8211; close VLC at end<\/p>\n<p>Now we have just to use Windows Task Scheduler (you can open it from Windows Control Panel or by running taskschd.msc) to create a new task and run the batch file at the desidered day\/time.<\/p>\n<div class\"note-blue\">\n<p class=\"note-blue\">Alternatively you can use <a href=\"https:\/\/www.ffmpeg.org\/download.html\" target=\"_blank\" rel=\"noopener\">FFmpeg<\/a> from command line, eg.: <i>ffmpeg -i http:\/\/[IP]:[PORT] -t 60 -c copy C:\\test.ts<\/i> (the live stream will be recorded in .ts format (Transport Stream) for 60 seconds).\n<\/p>\n<\/div>\n<p>If you want to have a more rich batch we can add email notification feature by sending an email before the record start and at the finish, there are various free utilities that allows to send emails using SMTP protocol from command line, one of the best is <a href=\"https:\/\/sourceforge.net\/projects\/swithmail\/files\/latest\/download\" target=\"_blank\" rel=\"noopener\">SwithMail<\/a>.<\/p>\n<p>You can configure the settings easily with the GUI and save as .XML format, then pass it using CLI, or generate directly the string for the command line.<\/p>\n<p>I modified the previous batch file adding the lines that allows to send emails using a Gmail account, you just have to replace the sender email address with your Gmail address, &#8220;Gmailpassword&#8221; with your own password and the recipient email address.<br \/>\nBe carefull, to allows the email sending using Gmail you have to enable <a href=\"https:\/\/myaccount.google.com\/lesssecureapps?pli=1\" target=\"_blank\" rel=\"noopener\">Less secure apps<\/a> on your Google account.<\/p>\n<pre class=\"nums:false lang:default decode:true \" title=\"RecordVLC.bat\" >SwithMail.exe \/s \/from yourownemailaddress@gmail.com \/pass Gmailpassword \/server smtp.gmail.com \/p 587 \/SSL \/to recipientemailaddress \/sub \"Start VLC recording\" \/b \"Start VLC recording\"\r\n\"C:\\Program Files (x86)\\VideoLAN\\VLC\\vlc.exe\" https:\/\/xxxxxx.net :sout=#duplicate{dst=file{dst=C:\\Users\\name\\Desktop\\record.ts},dst=display} :no-sout-rtp-sap :no-sout-standard-sap :ttl=1 :sout-keep --run-time=30 vlc:\/\/quit\r\nSwithMail.exe \/s \/from yourownemailaddress@gmail.com \/pass Gmailpassword \/server smtp.gmail.com \/p 587 \/SSL \/to recipientemailaddress \/sub \"End VLC recording\" \/b \"End VLC recording\"<\/pre>\n<p>If you want to power off computer at the end you just have to add the shutdown command:<\/p>\n<pre class=\"nums:false lang:default decode:true \" title=\"RecordVLC.bat\" >SwithMail.exe \/s \/from yourownemailaddress@gmail.com \/pass Gmailpassword \/server smtp.gmail.com \/p 587 \/SSL \/to recipientemailaddress \/sub \"Start VLC recording\" \/b \"Start VLC recording\"\r\n\"C:\\Program Files (x86)\\VideoLAN\\VLC\\vlc.exe\" https:\/\/xxxxxx.net :sout=#duplicate{dst=file{dst=C:\\Users\\name\\Desktop\\record.ts},dst=display} :no-sout-rtp-sap :no-sout-standard-sap :ttl=1 :sout-keep --run-time=30 vlc:\/\/quit\r\nSwithMail.exe \/s \/from yourownemailaddress@gmail.com \/pass Gmailpassword \/server smtp.gmail.com \/p 587 \/SSL \/to recipientemailaddress \/sub \"End VLC recording\" \/b \"End VLC recording\"\r\nshutdown -s -f -t 10 -m \\\\ComputerName<\/pre>\n<p>Just change ComputerName with the name of your computer, using the parameter -t 10, the PC will power off after 10 seconds.<\/p>\n","protected":false},"excerpt":{"rendered":"<p><span class=\"span-reading-time rt-reading-time\" style=\"display: block;\"><span class=\"rt-label rt-prefix\">Reading time:<\/span> <span class=\"rt-time\"> 3<\/span> <span class=\"rt-label rt-postfix\">minutes<\/span><\/span>VLC isn&#8217;t only a popular and very good media player available for many platforms, but it can also record live video streams. The first step<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"advgb_blocks_editor_width":"","advgb_blocks_columns_visual_guide":"","footnotes":""},"categories":[3485],"tags":[],"class_list":["post-15163","post","type-post","status-publish","format-standard","hentry","category-tutorials-en"],"author_meta":{"display_name":"Simone","author_link":"https:\/\/www.digitalking.it\/en\/author\/admin\/"},"featured_img":null,"coauthors":[],"tax_additional":{"categories":{"linked":["<a href=\"https:\/\/www.digitalking.it\/en\/category\/tutorials-en\/\" class=\"advgb-post-tax-term\">Tutorials<\/a>"],"unlinked":["<span class=\"advgb-post-tax-term\">Tutorials<\/span>"]}},"comment_count":"0","relative_dates":{"created":"Posted 8 years ago","modified":"Updated 7 years ago"},"absolute_dates":{"created":"Posted on April 23, 2018","modified":"Updated on October 3, 2019"},"absolute_dates_time":{"created":"Posted on April 23, 2018 5:36 pm","modified":"Updated on October 3, 2019 4:31 pm"},"featured_img_caption":"","series_order":"","_links":{"self":[{"href":"https:\/\/www.digitalking.it\/en\/wp-json\/wp\/v2\/posts\/15163","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.digitalking.it\/en\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.digitalking.it\/en\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.digitalking.it\/en\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.digitalking.it\/en\/wp-json\/wp\/v2\/comments?post=15163"}],"version-history":[{"count":0,"href":"https:\/\/www.digitalking.it\/en\/wp-json\/wp\/v2\/posts\/15163\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.digitalking.it\/en\/wp-json\/wp\/v2\/media?parent=15163"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.digitalking.it\/en\/wp-json\/wp\/v2\/categories?post=15163"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.digitalking.it\/en\/wp-json\/wp\/v2\/tags?post=15163"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}