Code: Select all
vlc a.mpg --sout "#transcode{vcodec=mpeg4,acodec=mpga,vb=800,ab=128} :udp{dst=192.168.0.118,mux=ts}"
Code: Select all
#include<stdio.h>
#include<vlc/vlc.h>
int main()
{
libvlc_instance_t *instance;
libvlc_media_t *media;
libvlc_media_player_t *player;
instance=libvlc_new(0,NULL);
media=libvlc_media_new_path(instance,
"v4l2://");
const char *option[]={
"--sout \"#transcode{vcodec=mpeg4,acodec=mpga,vb=800,ab=128} :udp{dst=192.168.0.118,mux=ts}\""
};
int i;
for(i=0;i<sizeof(option)/sizeof(option[0]);++i)
{
libvlc_media_add_option(media,option[i]);
}
player=libvlc_media_player_new_from_media(media);
int save=libvlc_media_save_meta(media);
printf("meta:%d\n",save);
libvlc_media_release(media);
libvlc_media_player_play(player);
while(1);
libvlc_release(instance);
return 0;
}