[HOW TO] CDG+MP3 Transcoder

General discussions.

Moderator: moderators

[HOW TO] CDG+MP3 Transcoder

Postby marsmayhem » Wed Aug 10, 2011 7:59 am

I couldn't find a transcoder for CDG+MP3 karaoke files, and some people have requested it as a feature. Having played around with ffmpeg and cdg files outside of Subsonic, I wrote a batch file to transcode cdg + mp3 to an FLV.

I'm on Windows (XP-SP3). I installed an ffmpeg build from http://ffmpeg.zeranoe.com/builds/ because the ffmpeg that came with subsonic either wasn't fast enough on my setup and caused dropouts during the transcoding, or the CDG decoder is better in the build I used. You don't have to do this, but if you have performance issues with the cdg transcode, try a build other than the SVN build that comes with Subsonic.

I installed the latest static build and dropped the new ffmpeg.exe in my subsonic\transcode folder. I renamed the existing one to something else.


Here are the steps to setup cdg+mp3 transcoding in Subsonic:

1) Create a batch file called cdg2flv.bat with the following content:

Code: Select all
@echo off
@setlocal
@REM invoke:  cdg2flv.bat %o %s %b %w %h
@REM 1-start, 2-file, 3-bitrate, 4-width, 5-height
@cd c:\subsonic\transcode
@for /f "tokens=* delims= " %%F in ('echo %2') do ffmpeg.exe -ss %1 -i %2 -i "%%~dpnF.mp3" -async 1 -b %3k -s %4x%5 -acodec copy -v 0 -pix_fmt yuv420p -f flv -



Place this batch file in your subsonic transcode folder (eg c:\subsonic\transcode)

2) Go to Subsonic's Settings | General | Video Mask and add ".cdg" to the list. This is needed so that the file shows up as a video file in Subsonic.

3) Go to Subsonic's Settings | Transcoding and add the following transcoder:

Name: cdg > flv
Convert from: cdg
Convert to: flv
Step 1: cdg2flv.bat %o %s %b %w %h

Make sure the Enabled checkbox is checked, then click the Save button.


4) Go to Subsonic's Settings | Players and enable the "cdg > flv" under the Active Transcodings section.


Lastly, this only works if your cdg and mp3 files are named the same and in the same location as each other. eg

03 - Immigrant Song.cdg
03 - Immigrant Song.mp3

I should mention I'm on Subsonic 4.5 beta 2, but I don't think that affects the transcoding. Should work on latest stable.

Thanks to this forum post here for inspiring the format of this article:
http://forum.subsonic.org/forum/viewtopic.php?t=5466&highlight=

Thanks to Sindre for a very impressive product.

EDIT: Tested with 4.5 stable and the ffmpeg that comes with that version. No need to download latest ffmpeg (unless you want to).
marsmayhem
 
Posts: 19
Joined: Wed Aug 10, 2011 7:09 am

Return to General

Who is online

Users browsing this forum: No registered users and 3 guests