{"id":2228,"date":"2019-07-06T19:43:48","date_gmt":"2019-07-06T17:43:48","guid":{"rendered":"https:\/\/pythonprogramming.altervista.org\/?p=2228"},"modified":"2020-03-15T09:24:27","modified_gmt":"2020-03-15T08:24:27","slug":"record-the-screen-with-ffmpeg-and-python","status":"publish","type":"post","link":"https:\/\/pythonprogramming.altervista.org\/record-the-screen-with-ffmpeg-and-python\/","title":{"rendered":"Record the screen with ffmpeg and Python"},"content":{"rendered":"<p>Almost all the videos that I upload to youtube uses this method that I am going to explain here. This is the <strong>fastest<\/strong> way to record your screen. If you don&#8217;t do much of reworking on the videos, like me, this could be the right instruments for you if you want somethin raw but <strong>immediate<\/strong>. The video output is very <strong>light<\/strong> as it does not occupy much <strong>memory<\/strong>.<\/p>\n<h2>Install ffmpeg<\/h2>\n<p>FFmpeg is the leading multimedia framework to decode, encode, transcode, mux, demux, stream, filter and play. All builds require at least Windows 7 or Mac OS X 10.10.<\/p>\n<p>First of all you need to install ffmpeg: its a great free tool with a tons of features. Go here to see how: <a href=\"https:\/\/www.ffmpeg.org\/\">click on this link to see how to install ffmpeg<\/a><\/p>\n<p>Here is the <a href=\"https:\/\/ffmpeg.zeranoe.com\/builds\/\">version for windows<\/a><\/p>\n<h2>How to avoid recording over the previous recordings<\/h2>\n<p>If you want to <strong>record the screen<\/strong> you could simply use the ffmpeg command, but if you want to make something a little more sofisticated you can combine the use of ffmpeg with python to get incredible results. Today we want to make a simple script that allows you to record the screen with your voice from the mic avoding to overwrite what you eventually recorded in a previous time.<\/p>\n<h2>Other advantages<\/h2>\n<p>You can take advantage of this script to record your videos in more step and then join the videos together with <a href=\"https:\/\/pythonprogramming.altervista.org\/join-all-mp4-with-python-and-ffmpeg\/\">join mp4 together<\/a>. You can even trim some parts of the video that you don&#8217;t like. Take a look at <a href=\"https:\/\/pythonprogramming.altervista.org\/automate-video-trimming-with-ffmpeg-and-python\/\">this post her<\/a>e to see how you can do it with ffmpeg.<\/p>\n<h2>Avoiding overwriting, we said<\/h2>\n<p>As I said before this code start looking to a file called output0.mp4 if there is not a file like that in the folder it saves the video with that name, otherwise it will save it with the first free numer that he will find, because it will recall the record function until it finds a name with a number that is not already used by another file in the folder. This is a good feature that allows to avoid overwriting a previous recording and allows also to record in more step so that you can join the files together at the end (<a href=\"https:\/\/pythonprogramming.altervista.org\/join-all-mp4-with-python-and-ffmpeg\/\">go here to get the code<\/a> to do it).<\/p>\n<h2>What do I need to record the screen and my voice on the mic<\/h2>\n<p>To record the screen recording also your voice, like I do in the video below, you can use this script made with Python that uses ffmpeg to do the job.<\/p>\n<h2>The size of the screen<\/h2>\n<p>You need to put the size of the screen that you are using. In my case it was <strong>-video_size 1366&#215;768<\/strong>.<\/p>\n<h2>The frame rate<\/h2>\n<p>Experiment also with the frame rate to see what is the right one. To me it worked the <strong>-r 10<\/strong> frame rate.<\/p>\n<h2>The audio<\/h2>\n<p>Another thing you will have to change is the audio, because your system could have (probably)a different name for its audio device. Mine was: <strong>-i audio=&#8221;Microfono (8- Logitech USB Headset)&#8221;<\/strong>. You see that is even in italian, because my system is set in this language.<\/p>\n<h2>How to get the name of my audio devices?<\/h2>\n<p>If you want to see what are the names of your <strong>devices<\/strong> you can use this script.<\/p>\n<pre class=\"lang:default decode:true \">ffmpeg -list_devices true -f dshow -i dummy\r\n\r\npause<\/pre>\n<p>Copy this code in an editor and save it as list_of_devices.bat. Then run the file with a double click and you will see something like this:<\/p>\n<p><a href=\"https:\/\/pythonprogramming.altervista.org\/wp-content\/uploads\/2019\/07\/list_of_devices.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-3416\" src=\"https:\/\/pythonprogramming.altervista.org\/wp-content\/uploads\/2019\/07\/list_of_devices.jpg\" alt=\"\" width=\"1088\" height=\"557\" srcset=\"https:\/\/pythonprogramming.altervista.org\/wp-content\/uploads\/2019\/07\/list_of_devices.jpg 1088w, https:\/\/pythonprogramming.altervista.org\/wp-content\/uploads\/2019\/07\/list_of_devices-320x164.jpg 320w, https:\/\/pythonprogramming.altervista.org\/wp-content\/uploads\/2019\/07\/list_of_devices-768x393.jpg 768w, https:\/\/pythonprogramming.altervista.org\/wp-content\/uploads\/2019\/07\/list_of_devices-960x491.jpg 960w\" sizes=\"auto, (max-width: 1088px) 100vw, 1088px\" \/><\/a><\/p>\n<p>You can see where I took the name &#8220;Microfono (8- Logitech USB Headset). Just copy exactly what you see in your computer and substitute it in your script.<\/p>\n<h2>The python script to record the screen<\/h2>\n<p>There we are, this is the script. Do the change that you gotta do and &#8230; start recording.<\/p>\n<pre class=\"lang:default decode:true\">import os\r\nimport glob\r\n\r\nx = 0\r\ndef record():\r\n\tglobal x\r\n\tif not \"H:\\\\ffmpeg\\\\output\" + str(x) + \".mp4\" in glob.glob(\"H:\\\\ffmpeg\\\\*.mp4\"):\r\n\t\tfilename = \"H:\\\\ffmpeg\\\\output\" + str(x) + \".mp4\"\r\n\telse:\r\n\t\tx += 1\r\n\t\trecord()\r\n\r\n\r\n\tos.system(f\"\"\"ffmpeg -y -rtbufsize 200M -f gdigrab -thread_queue_size 1024 -probesize 10M -r 10 -draw_mouse 1 -video_size 1366x768 -i desktop -f dshow -channel_layout stereo -thread_queue_size 1024 -i audio=\"Microfono (8- Logitech USB Headset)\" -c:v libx264 -r 10 -preset ultrafast -tune zerolatency -crf 25 -pix_fmt yuv420p -c:a aac -strict -2 -ac 2 -b:a 128k -vf \"pad=ceil(iw\/2)*2:ceil(ih\/2)*2\" \"{filename}\" \"\"\")\r\n\r\nrecord()<\/pre>\n<h2>The second script to record the screen<\/h2>\n<p>I want to make a little update to the code. This is the one that I am actually using. I suggest you to put this in the main folder from where the OS starts, so that you can just press the windows button + R and then write rec.py to make it start. This is what I do to record the videos and this is the code:<\/p>\n<pre class=\"lang:default decode:true\">import os\r\nimport glob\r\n\r\nx = 0\r\ndef record():\r\n\tglobal x\r\n\tfld = \"H:\\\\ffmpeg\\\\output\\\\output\"\r\n\tif not fld + str(x) + \".mp4\" in glob.glob(fld + \"*.mp4\"):\r\n\t\tfilename = fld + str(x) + \".mp4\"\r\n\telse:\r\n\t\tx += 1\r\n\t\trecord()\r\n\r\n\taudio = \"Microfono (8- Logitech USB Headset)\"\r\n\tvideo_size = \"1366x768\"\r\n\r\n\tos.system(f\"\"\"ffmpeg -y -rtbufsize 200M -f gdigrab -thread_queue_size 1024 -probesize 10M -r 10 -draw_mouse 1 -video_size {video_size} -i desktop -f dshow -channel_layout stereo -thread_queue_size 1024 -i audio=\"{audio}\" -c:v libx264 -r 10 -preset ultrafast -tune zerolatency -crf 25 -pix_fmt yuv420p -c:a aac -strict -2 -ac 2 -b:a 128k -vf \"pad=ceil(iw\/2)*2:ceil(ih\/2)*2\" \"{filename}\" \"\"\")\r\n\r\n\r\nrecord()<\/pre>\n<p>It is not very different from the other, but it is easier to change the name of the devices or the size of the screen.<\/p>\n<h2>Video explaining the code to record the screen<\/h2>\n<p><iframe loading=\"lazy\" title=\"Screen record with FFmpeg and Python\" width=\"747\" height=\"420\" src=\"https:\/\/www.youtube.com\/embed\/LooWa6-_eWE?feature=oembed&amp;enablejsapi=1\" frameborder=\"0\" allow=\"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share\" referrerpolicy=\"strict-origin-when-cross-origin\" allowfullscreen><\/iframe><\/p>\n<h2>Record just a window with a name<\/h2>\n<p>If you want you can record only one window and not the entire screen with this code<\/p>\n<pre class=\"lang:default decode:true \">ffmpeg -rtbufsize 1500M -f dshow -i audio=\"Microfono (8- Logitech USB Headset)\" -f gdigrab -framerate 30 -draw_mouse 1 -i title=Trace -pix_fmt yuv420p -profile:v baseline -y Huangbaohua.mp4\r\n\r\npause<\/pre>\n<p>Save this file as a .bat file. Remember to make the change to the devices like we&#8217;ve seen above for the recording of the entire screen. The name of the window must be exact.<\/p>\n<h2>How to compress audio for better quality<\/h2>\n<p>I made this code to improve quality of the audio recording during streaming recording or the computer screen and audio, it is a bit longer and asks you in which folder you want to record it and what name you want to give to it:<\/p>\n<pre class=\"lang:default decode:true \">import os\r\nimport glob\r\n\r\nx = 0\r\n\r\ndef ask():\r\n    fld = \"H:\\\\ffmpeg\\\\output\\\\\"\r\n    new_fld = input(\"Nuova cartella (opzionale, invio=stessa cartella)?: \")\r\n    # aggiunge la cartella al percorso\r\n    if new_fld != \"\":\r\n        fld = fld + new_fld + \"\\\\\"\r\n        # crea la cartella, se non c'\u00e8 gi\u00e0\r\n        if new_fld not in os.listdir(\"H:\\\\ffmpeg\\\\output\\\\\"):\r\n            os.mkdir(fld)\r\n    filename = input(\"Nome del file: \")\r\n    filename = fld + filename + \".mp4\"\r\n    return filename\r\n\r\ndef automatic_name():\r\n    \"Crea il nome da solo \/ ora chiedo il nome del file prima\"\r\n    global x\r\n\r\n    fld = \"H:\\\\ffmpeg\\\\output\\\\output\"\r\n    if not fld + str(x) + \".mp4\" in glob.glob(fld + \"*.mp4\"):\r\n        filename = fld + str(x) + \".mp4\"\r\n    else:\r\n        x += 1\r\n        record()\r\n    filename = fld + filename + \".mp4\"\r\n    return filename\r\n\r\n\r\ndef record(filename):\r\n    # Microfono (HUAWEI USB-C HEADSET)\r\n    audio = \"Microfono (8- Logitech USB Headset)\"\r\n    # audio = \"Microfono (HUAWEI USB-C HEADSET)\"\r\n    video_size = \"1366x768\"\r\n    # added a compressor 15\/03\/2020\r\n    compressor = \"-af acompressor=threshold=0.089:ratio=9:attack=200:release=1000\"\r\n\r\n    os.system(f\"\"\"ffmpeg -y -rtbufsize 200M -f gdigrab -thread_queue_size 1024 -probesize 10M -r 10 -draw_mouse 1 -video_size {video_size} -i desktop -f dshow -channel_layout stereo -thread_queue_size 1024 -i audio=\"{audio}\" {compressor} -c:v libx264 -r 10 -preset ultrafast -tune zerolatency -crf 25 -pix_fmt yuv420p -c:a aac -strict -2 -ac 2 -b:a 128k -vf \"pad=ceil(iw\/2)*2:ceil(ih\/2)*2\" \"{filename}\" \"\"\")\r\n\r\n\r\n# filename = \"rtmp:\/\/youtube_stream_url\/03r8-71q2-yrvm-bbe7\"\r\nfilename = ask()\r\nrecord(filename)\r\n<\/pre>\n<p>Change your pc features for audio mic and screen, using this script to check for your devices (create a .bat file with this commands and run it):<\/p>\n<pre class=\"lang:default decode:true\">ffmpeg -list_devices true -f dshow -i dummy\r\n\r\npause<\/pre>\n<!-- se vuoi mettere un testo scorrevole\r\n[hoops name=\"typeWriterGen\"]\r\n\r\npoi metti un id diverso per ogni testo nella stessa pagina\r\n\r\n<div id=\"div01\">\r\n<script>\r\n\r\ntypeWriterGen(\"div01\",\"Esempio di testo scorrevole\");\r\n<\/script>\r\n\r\n-->\r\n<style>\r\n.avatar {\r\n  vertical-align: middle;\r\n  width: 100px;\r\n  height: 100px;\r\n  border-radius: 50%;\r\n}\r\n<\/style>\r\n\r\n<hr>\r\n\r\n<!-- NEWSLETTER LINK -->\r\n<a href=\"https:\/\/docs.google.com\/forms\/d\/e\/1FAIpQLSf7TniIPCWHDzCSGh2dYZaCwDvi9yLKS5ovFdKuK1sdfOvwEg\/viewform\">\r\n<img decoding=\"async\" src=\"https:\/\/pythonprogramming.altervista.org\/wp-content\/uploads\/2023\/08\/image-13.png\" class=\"avatar\">\r\nSubscribe to the <b>newsletter<\/b> for updates<\/a><br>\r\n\r\n<!-- TKINTER TEMPLATE LINK -->\r\n<a href=\"https:\/\/pythonprogramming.altervista.org\/tkinter-templates\/\">\r\n<img decoding=\"async\" src=\"https:\/\/i0.wp.com\/pythonprogramming.altervista.org\/wp-content\/uploads\/2023\/07\/image-26.png\" class=\"avatar\">\r\nTkinter templates<\/a><br>\r\n\r\n<!-- MY AVATAR PUT A LINK TO YOUTUBE CHANNEL-->\r\n<iframe loading=\"lazy\" frameborder=\"0\" src=\"https:\/\/itch.io\/embed\/711828\" width=\"552\" height=\"167\"><a href=\"https:\/\/pythonprogrammi.itch.io\/pysnake\">PySnake by PythonProgrammi<\/a><\/iframe>\r\n<br>\r\n<style>\r\n.avatar {\r\n  vertical-align: middle;\r\n  width: 100px;\r\n  height: 100px;\r\n  border-radius: 50%;\r\n}\r\n<\/style>\r\n\r\n\r\n<a href=\"https:\/\/www.youtube.com\/channel\/UCzbxq5e9gLiY-je2-br1rvg\">\r\n\t<img decoding=\"async\" src=\"https:\/\/pythonprogramming.altervista.org\/wp-content\/uploads\/2020\/10\/avatar64x64.png\" alt=\"Avatar\" class=\"avatar\">\r\n\t My youtube channel<\/a><br>\r\n\r\n<br>\r\n\r\nTwitter: <a href=\"https:\/\/twitter.com\/pythonprogrammi\">@pythonprogrammi - python_pygame<\/a>\r\n<h3>Claude's Games<\/h3>\r\n<p><a href=\"https:\/\/pythonprogramming.altervista.org\/random-daily-game-1-arkanoid\/\">Arkanoid<\/a><br>\r\n<a href=\"https:\/\/pythonprogramming.altervista.org\/platform-2d-with-pygame-made-with-claude\/\">Platform 2d<\/a><\/p> <!-- videogames made with claude -->\r\n<a href=\"https:\/\/pythonprogramming.altervista.org\/artifacts-games-day-1-memory-game\/\">1. Memory game<\/a>\r\n<h4>Videos<\/h4>\r\n<a href=\"https:\/\/youtu.be\/ciLjWWw5pLY\">Speech recognition game<\/a>\r\n<h3>Pygame's Platform Game<\/h3>\r\n\r\n<a href=\"https:\/\/pythonprogramming.altervista.org\/pygame-platform-game-5-sounds-and-mixer\/\"><img decoding=\"async\" src=\"https:\/\/i1.wp.com\/pythonprogramming.altervista.org\/wp-content\/uploads\/2020\/01\/climbercover.png?w=557&ssl=1\"\/ width=\"50%\"><\/a>\r\n<script>\r\nvar title = \"Platform Pygame\";\r\n\t\tvar links = [\r\n[\"https:\/\/pythonprogramming.altervista.org\/pygame-animation-of-a-sprite-v-1-3\/\",\"Animation 1.3\"],\r\n[\"https:\/\/pythonprogramming.altervista.org\/pygame-sprite-animation-v-2-better-coding-test-it-checking-fps-on-the-screen\/\",\"Animation 1.2\"],\r\n[\"https:\/\/pythonprogramming.altervista.org\/pygame-how-to-display-the-frame-rate-fps-on-the-screen\/\",\"Display Frame rate\"],\r\n[\"https:\/\/pythonprogramming.altervista.org\/pygame-sprite-animation-update\/\",\"Animation 1.1\"],\r\n[\"https:\/\/pythonprogramming.altervista.org\/pygame-platformer-1\/\",\"Pygame Platform Game 1\"],\r\n[\"https:\/\/pythonprogramming.altervista.org\/python-platform-game-2\/\",\"Pygame Platform 2\"],\r\n[\"https:\/\/pythonprogramming.altervista.org\/pygame-platform-game-3-recap-cheatsheet\/\",\"Pygame PLatform 3 - recap and some Cheat Sheet\"],\r\n[\"https:\/\/pythonprogramming.altervista.org\/pygame-platform-game-4-background-and-stuffs\/\",\"Pygame Platform 4 - Background & organizing code\"],\r\n[\"https:\/\/pythonprogramming.altervista.org\/pygame-platform-game-5-sounds-and-mixer\/\",\"Pygame Platform 5 - Sounds\"],\r\n[\"https:\/\/pythonprogramming.altervista.org\/platform-game-in-detail-part-1\/\",\"Game in detail part 1\"],\r\n[\"https:\/\/pythonprogramming.altervista.org\/map-maker-1-2\/\", \"Map maker 1.2\"]\r\n\t\t];\r\n\t\t<\/script>\r\n<script>\r\n\t\r\nif (typeof next2 != \"undefined\"){let next2 = 0;}\r\n\t\r\nnext2 = 0;\r\n\thtml = \"\";\/\/<b style='color:coral;font-size:1.2em'>Other posts about \" + title + \"<\/b><br>\";\r\nfor (address of links) \r\n{\r\n\r\n\tif (next2 == 1){\r\n\t\thtml += \"<div style='background:coral'>\";\r\n\t\thtml += \"Next link => <a href='\" + address[0] + \"'>\" + address[1] + \"<\/a>\";\r\n\t\thtml += \"<\/div><br>\";\r\n\t\tnext2 = 0;\r\n\t}\r\n\tif (address[0] == document.URL) {\r\n\t\tnext2 = 1;\r\n\t}\r\n}\r\n\r\nif (typeof next != \"undefined\") {let next = 0;}\r\nif (typeof addressStart != \"undefined\") {let addressStart = \"\";}\r\nnext = 0;\r\naddressStart = \"<a href='\";\r\nfor (address of links) {\r\n\tif (next == 1){\r\n\t\thtml += \">>>\" + addressStart + address[0] + \"'>\" + address[1] + \"<\/a><br>\";\r\n\t\tnext = 0;\r\n\t}\r\n\telse if (addressStart + address[0] != document.URL)\r\n\t{\r\n\t\thtml += addressStart + address[0] + \"'>\" + address[1] + \"<\/a><br>\";\r\n\t}\r\n\telse\r\n\t{\r\n\t\tnext = 1;\r\n\t\tnext_address = address[0]\r\n\t\tnext_title = address[1]\r\n\t\thtml += \"<span style='color:gray'>\" + address[1] + \"<\/span><br>\";\r\n\t}\r\n\r\n}\r\n\r\n\thtml += `<span style=\"font-size:8px\">Powered by <a href=\"https:\/\/pythonprogramming.altervista.org\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-2673\" src=\"https:\/\/pythonprogramming.altervista.org\/wp-content\/uploads\/2019\/06\/altervista2.png\" alt=\"\" width=\"70\" height=\"25\" srcset=\"https:\/\/pythonprogramming.altervista.org\/wp-content\/uploads\/2019\/06\/altervista2.png 156w, https:\/\/pythonprogramming.altervista.org\/wp-content\/uploads\/2019\/06\/altervista2-150x56.png 150w\" sizes=\"auto, (max-width: 70px) 100vw, 70px\" \/>pythonprogramming.altervista.org<\/a><\/span>`\r\n\thtml = \"<div style='background:yellow'>\" + html + \"<\/div>\";\r\n\tdocument.write(html)\r\n<\/script>\r\n\r\n<h3>Other Pygame's posts<\/h3>\r\n\r\n<script>\r\nvar title = \"Pygame's Posts\"\r\nvar links = [\r\n[\"https:\/\/pythonprogramming.altervista.org\/pygame-platformer-1\/\",\"Platform game 1\"],\r\n[\"https:\/\/pythonprogramming.altervista.org\/make-a-platform-game-with-pygame-dafluffypotato\/\",\"DaFluffyPotato Platform Tutorials\"],\r\n[\"https:\/\/pythonprogramming.altervista.org\/python-and-classic-arcade-games-pong\/\",\"Pong Game Full\"],\r\n[\"https:\/\/pythonprogramming.altervista.org\/python-draws-in-colors-app-to-draw-with-pygame\/\",\"PyGameGIF 2\"],\r\n[\"https:\/\/pythonprogramming.altervista.org\/pygame-draw-app-with-animation\/\",\"PyGameGIF 1\"],\r\n[\"https:\/\/pythonprogramming.altervista.org\/pydraw-2-0-app-to-draw-gif\/\",\"PyDraw 2.0\"],\r\n[\"https:\/\/pythonprogramming.altervista.org\/pygame-drawing-2\/\",\"Draw with Pygame\"],\r\n[\"https:\/\/pythonprogramming.altervista.org\/animation-with-pygame\",\"Sprite animation 1\"],\r\n[\"https:\/\/pythonprogramming.altervista.org\/animation-on-pygame-2-free-characters-and-more-actions\/\",\"Sprite animation 2\"],\r\n[\"https:\/\/pythonprogramming.altervista.org\/starting-with-pygame\/\",\"Starting movements with Pygame\"],\r\n[\"https:\/\/pythonprogramming.altervista.org\/pygame-3-move-sprite\/\", \"Move a Sprite\"],\r\n[\"https:\/\/pythonprogramming.altervista.org\/pygame-4-fonts\/\",\"Text and Fonts\"],\r\n[\"https:\/\/pythonprogramming.altervista.org\/pygame-animate-a-sprite\/\", \"Animate a sprite\"],\r\n[\"https:\/\/pythonprogramming.altervista.org\/pygame-and-mouse-events\/\",\"Mouse events\"],\r\n[\"https:\/\/pythonprogramming.altervista.org\/pgp-aka-pygamepresentation-project\/\",\"Pygame presentation\"],\r\n\t[\"https:\/\/pythonprogramming.altervista.org\/moving-the-player-in-pygame-with-key-get_pressed\/\",\"How to use key.get_pressed()\"]\r\n]\r\n<\/script>\r\n\r\n\r\n<script>\r\n\t\r\nif (typeof next2 != \"undefined\"){let next2 = 0;}\r\n\t\r\nnext2 = 0;\r\n\thtml = \"\";\/\/<b style='color:coral;font-size:1.2em'>Other posts about \" + title + \"<\/b><br>\";\r\nfor (address of links) \r\n{\r\n\r\n\tif (next2 == 1){\r\n\t\thtml += \"<div style='background:coral'>\";\r\n\t\thtml += \"Next link => <a href='\" + address[0] + \"'>\" + address[1] + \"<\/a>\";\r\n\t\thtml += \"<\/div><br>\";\r\n\t\tnext2 = 0;\r\n\t}\r\n\tif (address[0] == document.URL) {\r\n\t\tnext2 = 1;\r\n\t}\r\n}\r\n\r\nif (typeof next != \"undefined\") {let next = 0;}\r\nif (typeof addressStart != \"undefined\") {let addressStart = \"\";}\r\nnext = 0;\r\naddressStart = \"<a href='\";\r\nfor (address of links) {\r\n\tif (next == 1){\r\n\t\thtml += \">>>\" + addressStart + address[0] + \"'>\" + address[1] + \"<\/a><br>\";\r\n\t\tnext = 0;\r\n\t}\r\n\telse if (addressStart + address[0] != document.URL)\r\n\t{\r\n\t\thtml += addressStart + address[0] + \"'>\" + address[1] + \"<\/a><br>\";\r\n\t}\r\n\telse\r\n\t{\r\n\t\tnext = 1;\r\n\t\tnext_address = address[0]\r\n\t\tnext_title = address[1]\r\n\t\thtml += \"<span style='color:gray'>\" + address[1] + \"<\/span><br>\";\r\n\t}\r\n\r\n}\r\n\r\n\thtml += `<span style=\"font-size:8px\">Powered by <a href=\"https:\/\/pythonprogramming.altervista.org\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-2673\" src=\"https:\/\/pythonprogramming.altervista.org\/wp-content\/uploads\/2019\/06\/altervista2.png\" alt=\"\" width=\"70\" height=\"25\" srcset=\"https:\/\/pythonprogramming.altervista.org\/wp-content\/uploads\/2019\/06\/altervista2.png 156w, https:\/\/pythonprogramming.altervista.org\/wp-content\/uploads\/2019\/06\/altervista2-150x56.png 150w\" sizes=\"auto, (max-width: 70px) 100vw, 70px\" \/>pythonprogramming.altervista.org<\/a><\/span>`\r\n\thtml = \"<div style='background:yellow'>\" + html + \"<\/div>\";\r\n\tdocument.write(html)\r\n<\/script>\n","protected":false},"excerpt":{"rendered":"Record from your screen with Python and ffmpeg\n<a class=\"moretag\" href=\"https:\/\/pythonprogramming.altervista.org\/record-the-screen-with-ffmpeg-and-python\/\"> [...]<\/a>","protected":false},"author":1,"featured_media":2232,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_crdt_document":"","footnotes":""},"categories":[1],"tags":[221,197,4,766],"class_list":["post-2228","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-examples","tag-audio","tag-ffmpeg","tag-python","tag-screen-recording"],"avopt_banners_inside_post":true,"avopt_banners_on_page":true,"av_copy_from":"","av_sharing_message":"","av_sharing_allowed":false,"av_sharing_on":{"fb":[],"tw":[]},"av_allow_affiliate_banner":false,"av_allow_affiliate_multi_banner":false,"av_show_affiliation_buy_button":false,"av_post_rating":true,"av_have_post_rating_value":false,"av_is_artificial_intelligence_content":false,"_links":{"self":[{"href":"https:\/\/pythonprogramming.altervista.org\/wp-json\/wp\/v2\/posts\/2228","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/pythonprogramming.altervista.org\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/pythonprogramming.altervista.org\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/pythonprogramming.altervista.org\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/pythonprogramming.altervista.org\/wp-json\/wp\/v2\/comments?post=2228"}],"version-history":[{"count":11,"href":"https:\/\/pythonprogramming.altervista.org\/wp-json\/wp\/v2\/posts\/2228\/revisions"}],"predecessor-version":[{"id":5388,"href":"https:\/\/pythonprogramming.altervista.org\/wp-json\/wp\/v2\/posts\/2228\/revisions\/5388"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/pythonprogramming.altervista.org\/wp-json\/wp\/v2\/media\/2232"}],"wp:attachment":[{"href":"https:\/\/pythonprogramming.altervista.org\/wp-json\/wp\/v2\/media?parent=2228"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/pythonprogramming.altervista.org\/wp-json\/wp\/v2\/categories?post=2228"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/pythonprogramming.altervista.org\/wp-json\/wp\/v2\/tags?post=2228"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}