{"id":467,"date":"2024-09-02T14:13:52","date_gmt":"2024-09-02T14:13:52","guid":{"rendered":"https:\/\/xuan.co.uk\/?p=467"},"modified":"2024-09-02T14:19:40","modified_gmt":"2024-09-02T14:19:40","slug":"mp3-to-video-for-odysee","status":"publish","type":"post","link":"https:\/\/xuan.co.uk\/?p=467","title":{"rendered":"MP3 to Video for Odysee"},"content":{"rendered":"<p>This DOS batch script takes all MP3&#8217;s found on a folder and converts them to MP4 using a single image. FFMPEG and picture need to be in the same folder<\/p>\n<p>&nbsp;<\/p>\n<p>For NVidia GPU<\/p>\n<div>@echo off<\/div>\n<div>setlocal enabledelayedexpansion<\/div>\n<div><\/div>\n<div>rem Set the image file name<\/div>\n<div>set image=select.jpg<\/div>\n<div><\/div>\n<div>rem Loop over all mp3 files in the directory<\/div>\n<div>for %%f in (*.mp3) do (<\/div>\n<div>\u00a0 \u00a0 rem Get the base file name without the extension<\/div>\n<div>\u00a0 \u00a0 set &#8220;filename=%%~nf&#8221;<\/div>\n<div><\/div>\n<div>\u00a0 \u00a0 rem Run the ffmpeg command with the current mp3 file<\/div>\n<div>\u00a0 \u00a0 ffmpeg -loop 1 -i &#8220;!image!&#8221; -i &#8220;%%f&#8221; -c:v h264_nvenc -preset fast -pix_fmt yuv420p -maxrate 5000K -bufsize 5000K -vf &#8220;scale=if(gte(iw\\,ih)\\,min(1920\\,iw)\\,-2):if(lt(iw\\,ih)\\,min(1920\\,ih)\\,-2)&#8221; -movflags +faststart -c:a aac -b:a 160k -shortest &#8220;!filename!.mp4&#8221;<\/div>\n<div>)<\/div>\n<div><\/div>\n<div>endlocal<\/div>\n<div><\/div>\n<div><\/div>\n<div>For CPU<\/div>\n<div><\/div>\n<div>\n<p>@echo off<br \/>\nsetlocal enabledelayedexpansion<\/p>\n<p>rem Set the image file name<br \/>\nset &#8220;image=select.jpg&#8221;<\/p>\n<p>rem Loop over all mp3 files in the directory<br \/>\nfor %%f in (*.mp3) do (<br \/>\nrem Get the base file name without the extension<br \/>\nset &#8220;filename=%%~nf&#8221;<\/p>\n<p>rem Run the ffmpeg command with the current mp3 file<br \/>\nffmpeg -loop 1 -i &#8220;!image!&#8221; -i &#8220;%%f&#8221; -c:v libx264 -crf 21 -preset faster -pix_fmt yuv420p -maxrate 5000K -bufsize 5000K -vf &#8220;scale=if(gte(iw\\,ih)\\,min(1920\\,iw)\\,-2):if(lt(iw\\,ih)\\,min(1920\\,ih)\\,-2)&#8221; -movflags +faststart -c:a aac -b:a 160k -shortest &#8220;!filename!.mp4&#8221;<br \/>\n)<\/p>\n<p>endlocal<\/p>\n<\/div>\n<div><\/div>\n","protected":false},"excerpt":{"rendered":"<p>This DOS batch script takes all MP3&#8217;s found on a folder and converts them to MP4 using a single image. FFMPEG and picture need to be in the same folder &nbsp; For NVidia GPU @echo off setlocal enabledelayedexpansion rem Set the image file name set image=select.jpg rem Loop over all <a class=\"more-link\" href=\"https:\/\/xuan.co.uk\/?p=467\">Read More&#8230;<\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[4],"tags":[91,90,65],"class_list":["post-467","post","type-post","status-publish","format-standard","hentry","category-tech-tips","tag-mp3-to-video","tag-odysee","tag-tech-tips"],"_links":{"self":[{"href":"https:\/\/xuan.co.uk\/index.php?rest_route=\/wp\/v2\/posts\/467","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/xuan.co.uk\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/xuan.co.uk\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/xuan.co.uk\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/xuan.co.uk\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=467"}],"version-history":[{"count":3,"href":"https:\/\/xuan.co.uk\/index.php?rest_route=\/wp\/v2\/posts\/467\/revisions"}],"predecessor-version":[{"id":471,"href":"https:\/\/xuan.co.uk\/index.php?rest_route=\/wp\/v2\/posts\/467\/revisions\/471"}],"wp:attachment":[{"href":"https:\/\/xuan.co.uk\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=467"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/xuan.co.uk\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=467"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/xuan.co.uk\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=467"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}