Created
September 18, 2011 17:22
-
-
Save liamcurry/1225299 to your computer and use it in GitHub Desktop.
Converting FLAC to various formats
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ffmpeg -i name.flac -acodec alac name.m4a |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ffmpeg -i name.flac -acodec libmp3lame -ab 320k -ac 2 -ar 48000 name.mp3 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ffmpeg -i hlah_3.flac -strict experimental -acodec vorbis -aq 100 hlah.ogg |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python | |
import gobject | |
import gst | |
converter = gst.Pipeline('converter') | |
source = gst.element_factory_make('filesrc', 'file-source') | |
source.set_property('location', 'test.flac') | |
decoder = gst.element_factory_make('flacdec', 'decoder') | |
encoder = gst.element_factory_make('lame', 'encoder') | |
sink = gst.element_factory_make('filesink', 'sink') | |
sink.set_property('location', 'test.mp3') | |
converter.add(source, decoder, encoder, sink) | |
gst.element_link_many(source, decoder, encoder, sink) | |
converter.set_state(gst.STATE_PLAYING) | |
gobject.threads_init() | |
gobject.MainLoop().run() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python | |
import gst | |
import gobject | |
import os | |
dirname = os.path.dirname(os.path.abspath(__file__)) | |
source = os.path.join(dirname, 'test.flac') | |
dest = os.path.join(dirname, 'test.mp3') | |
pipeline = gst.parse_launch('filesrc location="%s" ! flacdec ! lame ! filesink location="%s"' % (source, dest)) | |
pipeline.set_state(gst.STATE_PLAYING) | |
gobject.threads_init() | |
gobject.MainLoop().run() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# wav -> ogg | |
gst-launch filesrc location=music.wav ! wavparse ! audioconvert ! vorbisenc ! oggmux ! filesink location=music.ogg | |
# wav -> mp3 | |
gst-launch filesrc location=music.wav ! wavparse ! audioconvert ! lame ! filesink location=music.mp3 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
From
FLAC
toMP3|OGG|OPUS
, usingavconv
: