{"id":24319,"date":"2024-11-21T19:39:43","date_gmt":"2024-11-21T17:39:43","guid":{"rendered":"https:\/\/www.wjst.de\/blog\/?p=24319"},"modified":"2024-11-23T09:16:57","modified_gmt":"2024-11-23T07:16:57","slug":"audio-video-latency-test","status":"publish","type":"post","link":"https:\/\/www.wjst.de\/blog\/sciencesurf\/2024\/11\/audio-video-latency-test\/","title":{"rendered":"Audio Video Latency Test"},"content":{"rendered":"<p>Here is new\u00a0 video test file build with R.<\/p>\n<p>I changed several things from the last version, basically switching to a new layout and going down from 100fps to 60fps as YT can handle this much better.<\/p>\n<p>&nbsp;<\/p>\n<p><iframe loading=\"lazy\" title=\"YouTube video player\" src=\"https:\/\/www.youtube.com\/embed\/GB7LVZb7YbI?si=DrmU5hF_UfXO_syw\" width=\"560\" height=\"315\" frameborder=\"0\" allowfullscreen=\"allowfullscreen\"><\/iframe><\/p>\n<p>&nbsp;<\/p>\n<p>Just in case, somebody wants to modify it, here is the script.<\/p>\n<pre class=\"brush: php; title: ; notranslate\" title=\"\">\r\nvid &lt;- function(nr){\r\n\tnr2 = as.integer(nr*60) # total number 1\/2s\r\n\tnr3 = -600 + (nr*10) # current ms title\r\n\tfor (ii in 1:60 ){\r\n\t\tfn = paste0(str_pad(nr*60+ii,5,pad = &quot;0&quot;), &quot;.png&quot;)\r\n\t\tpng(file =  fn, width = 1600, height = 900, units = &#039;px&#039;) # defaults to 300 ppi\r\n\t\tpar(mar=c(0,0,0,0),bg=&quot;black&quot;)\t\r\n\t\tplot(c(0, 1), c(0, 1), ann = F, bty = &#039;n&#039;, type = &#039;n&#039;, xaxt = &#039;n&#039;, yaxt = &#039;n&#039;, asp=1)\r\n\t\tcolor=&quot;red&quot;\r\n\t\trect(xleft=0.5, xright=(nr3+500)\/1000, ybottom=0.94, ytop=0.99, col= color)\r\n\t\tcolor=&quot;lightgrey&quot;\r\n\t\tif( (nr&lt;=58 &amp; ii==30+nr\/2) | (nr&gt;=60 &amp; ii==-30+nr\/2) ) {\r\n\t\t\tcirclize::draw.sector(0, 360, center = c(0.02, 0.01), rou1 = 0.01, col = color, border = color)\t\t\r\n\t\t}\t\r\n\t\tcirclize::draw.sector(90, 90-ii*6, center = c(0.5, 0.52), rou1 = 0.4, col = color, border = color)\r\n\t\tif (ii&lt;3 | ii&gt;57) {\r\n\t\t\tcolor=&quot;white&quot;\r\n\t\t\tcirclize::draw.sector(0, 360, center = c(0.5, 0.52), rou1 = 0.4, col = color, border = color)\r\n\t\t}\r\n\t\ttx=paste(nr3,&#039; ms&#039;)\r\n\t\ttext(x = 0.5, y = 0.85, tx, cex = 6, col = &quot;white&quot;, family=&quot;Lato&quot;, adj=0.5)\r\n\t\ttx=paste0(nr\/2,&#039;:&#039;,str_pad( round(100*ii\/60), 2, pad = &quot;0&quot;))\r\n\t\ttext(x = 0.5, y = 0.5, tx, cex = 12, col = &quot;white&quot;, family=&quot;Lato&quot;, adj=0.5)\r\n\t\ttx = &quot;play until beep &amp; flash in sync OR take image of source and processed video&quot;\r\n\t\ttext(x = 0.5, y = 0.075, tx, cex = 3, col = &quot;grey&quot;, family=&quot;Lato&quot;, adj=0.5)\r\n\t\tpar(bg=&quot;white&quot;)\r\n\t\tdev.off()\r\n\t}\t\r\n}\r\nfor (i in seq(0,120,2) ) {\r\n\tvid(i)\r\n}\r\nfn = paste0(list.files(&#039;*.png&#039;))\r\nav::av_encode_video(fn, framerate = 60, output = &#039;video.mp4&#039;)\r\n<\/pre>\n\n<p>&nbsp;<\/p>\n<div class=\"bottom-note\">\n  <span class=\"mod1\">CC-BY-NC Science Surf , accessed 27.04.2026<\/span>\n <\/div>","protected":false},"excerpt":{"rendered":"<p>Here is new\u00a0 video test file build with R. I changed several things from the last version, basically switching to a new layout and going down from 100fps to 60fps as YT can handle this much better. &nbsp; &nbsp; Just in case, somebody wants to modify it, here is the script. vid &lt;- function(nr){ nr2 &hellip; <a href=\"https:\/\/www.wjst.de\/blog\/sciencesurf\/2024\/11\/audio-video-latency-test\/\" class=\"more-link\">Continue reading <span class=\"screen-reader-text\">Audio Video Latency Test<\/span> <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[9],"tags":[2758],"class_list":["post-24319","post","type-post","status-publish","format-standard","hentry","category-computer-software","tag-video"],"_links":{"self":[{"href":"https:\/\/www.wjst.de\/blog\/wp-json\/wp\/v2\/posts\/24319","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.wjst.de\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.wjst.de\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.wjst.de\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.wjst.de\/blog\/wp-json\/wp\/v2\/comments?post=24319"}],"version-history":[{"count":5,"href":"https:\/\/www.wjst.de\/blog\/wp-json\/wp\/v2\/posts\/24319\/revisions"}],"predecessor-version":[{"id":24328,"href":"https:\/\/www.wjst.de\/blog\/wp-json\/wp\/v2\/posts\/24319\/revisions\/24328"}],"wp:attachment":[{"href":"https:\/\/www.wjst.de\/blog\/wp-json\/wp\/v2\/media?parent=24319"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.wjst.de\/blog\/wp-json\/wp\/v2\/categories?post=24319"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.wjst.de\/blog\/wp-json\/wp\/v2\/tags?post=24319"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}