Advertisement
sanitysama

crossfade webm generation for 4chan

Aug 31st, 2016
319
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.97 KB | None | 0 0
  1. you can create webms from individual songs & album covers, or full album crossfades just with foobar, ffmpeg and a nifty component called foo_run.
  2.  
  3. https://www.ffmpeg.org/download.html download the package and extract to C:\Program Files\ffmpeg
  4. http://www.foobar2000.org/download if you've never used foobar before. foobar won't override any of your music's current 'open with' preferences when you install it.
  5. http://www.foobar2000.org/components/view/foo_runcmd drop this in C:\Program Files (x86)\foobar2000\components
  6.  
  7. firstly open foobar, and drag some music into it. first we'll set up the crossfade/conversion preset.
  8.  
  9. you set up a conversion preset by right clicking a song, go into the "convert" menu then "..."
  10. in that menu enter the preferences as follows, leaving anything not specified here alone:
  11.  
  12. >output format: WAV
  13. >destination: [your choice of destination, but you will need to remember this path later], Overwrite, Merge all Tracks
  14. >processing: skip silence, crossfader (for album crossfades)
  15. >other: generate previews, fixed track length 30s (divide 5min/300s by the amount of tracks in the album), transfer attached pictures, copy other files to the >destination: cover.jpg (you can specify your own album art naming scheme here, but the ffmpeg command will only be looking for cover.jpg. the video depends on the existence of cover.jpg being in the same directory as the song you convert, so make sure it is there.)
  16.  
  17. save it as a preset by pressing 'save' then 'create new'. now you should be able to set up a hotkey for it if you choose. open foobar's preferences panel, navigate to the "keyboard shortcuts" panel, press "add new" then filter the list by what you named your preset, assign it a key, and you're done.
  18.  
  19. now we set up the command foobar will pass off to ffmpeg. you will have to heavily customize this command if you are not on windows.
  20.  
  21. open foobar's preferences, at the bottom of the list go to "Tools > Run Services". click add new and enter the following command. here's the command i use:
  22.  
  23. cmd /s /k pushd "C:\Program Files\ffmpeg\bin" && ffmpeg -framerate 7 -loop 1 -i "C:\converted\cover.jpg" -c:v libvpx -i "C:\converted\Image.wav" -c:a libvorbis -b:v 50k -vf scale=-1:300 -shortest -metadata title="%artist% - %album%" -metadata author="%artist%" -threads 8 -y "C:\converted\%artist% - %album%.webm" && pause && exit
  24.  
  25. i have several important reminders for this command so please read all of this. you will obviously need to change the path that ffmpeg.exe resides in from earlier if you decided to extract ffmpeg to a directory other than "C:\Program Files\ffmpeg\bin". also, you cannot specify an audio bitrate with "-b:a" or else /wsg/ will revoke it for some reason. i do not know the cause of this issue. you are also required to change "-threads 8" to the maximum amount of threads your processor can handle at once. if you do not know what this means, remove "-threads 8".
  26.  
  27. you can set up a hotkey to run this command as well if you wish to.
  28.  
  29. when you're ready to create a webm or album crossfade, highlight all of the songs in the album and hit your hotkey command to generate the crossfade, then highlight just one song and hit your hotkey to run the foo_run command. the foo_run component will pass on the highlighted song's metadata to ffmpeg, so we can keep things organized and make it easier to find sources using the metadata on 4chan.
  30.  
  31. if a crossfade comes out too long to post on 4chan (>300s), you should divide 300 by the number of tracks in the album and round down. you can just round down a second or two to make sure it doesn't put it over the 4MB filesize limit.
  32.  
  33. troubleshooting: if you're seeing ffmpeg encode in VP9 instead of VP8 (libvpx is VP8) or are getting the error "Error: Bad video stream. Only VP8 is supported." then just go download an older build of ffmpeg. i have no clue why ffmpeg would prefer VP9 when you're declaring VP8, but i can't find a solution for this problem, so i just went and grabbed ffmpeg-2.2.3-win32-static.7z and it's working now.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement