def recordStream(instream, outfile):
    '''Record the network stream to the output file.'''

    inst = vlc.Instance() # Create a VLC instance
    p = inst.media_player_new() # Create a player instance
    cmd1 = "sout=file/ts:%s" % outfile
    media = inst.media_new(instream, cmd1)
    media.get_mrl()
    p.set_media(media)
    return (inst, p, media)
Record the network stream to the output file.
recipes/Python/579096_vlcpy_stream_capture_scheduler/recipe-579096.py