问题描述
- vlc 如何将 mp3 格式转成 wma 格式 ?
-
我是用这个语句进行转换的:
这样行不sout=#transcode{acode=none}:standard{access=file,mux=asf,dst=Here_Here_Here.wma}
转换成功,但在用windows 自带的播放器时,进行快进时出现卡的状况,导致播放器崩溃。
解决方案
int main(int argc, char* argv[])
{
libvlc_instance_t* inst;
libvlc_media_player_t *mp;
libvlc_media_t *m;
const char *options[] = {
":no-audio",
":sout=#transcode{acode=none,ab=128,channels=2, samplerate=44100, threads=2}:standard{access=file,mux=asf,dst=Here_Here_Here.wma} ",
":sout-mux-caching=1",
":sout-keep"};
inst = libvlc_new (0, NULL);// Load the VLC engine
const char str[] = "believe.mp3";
m = libvlc_media_new_path (inst, str);// Create a new item
if (!m)
{
libvlc_release (inst);
return 0;
}
for (int i = 0; i < sizeof(options) / sizeof(options[0]); i++)
libvlc_media_add_option (m, options[i]);
mp = libvlc_media_player_new_from_media (m);// Create a media player playing environment
if (!mp)
{
libvlc_release (inst);
return 0;
}
libvlc_media_player_play (mp);// play the media_player
Sleep(5000);
libvlc_media_player_stop(mp);// Stop playing
libvlc_media_player_release(mp);// Free the media_player
//libvlc_media_release (m);// No need to keep the media now
printf("start......");
libvlc_release (inst);
printf("ending......");
return 1;
}
解决方案二:
MP3格式与WMA格式的音乐有什么区别
用VLC转换标准格式mp3
时间: 2024-09-23 16:06:31