Ham62

VideoAudioCombine.bas

May 13th, 2020
465
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #include "windows.bi"
  2.  
  3. dim as WIN32_FIND_DATA wfd
  4. Dim as string sVideo, sAudio
  5.  
  6. dim as HANDLE hFind = FindFirstFile("*", @wfd)
  7. do
  8.     if wfd.dwFileAttributes AND FILE_ATTRIBUTE_DIRECTORY then
  9.         sVideo = wfd.cFileName+"\"+Dir(wfd.cFileName+"\*.mp4")
  10.        sAudio = wfd.cFileName+"\"+Dir(wfd.cFileName+"\*.m4a")
  11.        
  12.        dim as string sCmd = "ffmpeg -i """+sVideo+""" -i """+sAudio+ _
  13.                             """ -c:v copy -c:a aac -map 0:v:0 -map 1:a:0 -shortest """+ _
  14.                             wfd.cFileName+"\output.mp4"""
  15.        print sCmd
  16.        shell sCmd
  17.    end if
  18. loop until (FindNextFile(hFind, @wfd) = 0)
  19.  
  20. print
  21. print "Finished converting directory!"
  22. print "Press any key to exit..."
  23. sleep
Add Comment
Please, Sign In to add comment