sys.exit(1)
instance = vlc.Instance(
    '--sout=#transcode{vcodec=mp4v,acodec=mpga,vb=800,ab=128,deinterlace}:duplicate{dst=file{dst=%s},dst=display}'
     % savedcopy)
try:
    media = instance.media_new(movie)
except NameError:
    print('NameError: % (%s vs Libvlc %s)' % (sys.exc_info()[1], vlc.
        __version__, vlc.libvlc_get_version()))
sys.exit(1)
player = instance.media_player_new()
player.set_media(media)
player.play()
while 1:
    continue
Saving a stream while playing it using LibVLC