I'm trying to save X seconds from a audio stream to a file. I have a RTSP server, and I made a simple script in python to save several seconds from this server to record in a file (.wav).
def main():
########################### MAIN INIT ###########################
instance = vlc.Instance("-vvv", "--no-video", "--clock-jitter=0", "--sout-audio", "--sout",
"#transcode{acodec=s16l,channels=2}:std{access=file,mux=wav,dst=test.wav}")
# Create a MediaPlayer with the default instance
player = instance.media_player_new()
# Load the media file
media = instance.media_new("rtsp://XXX.XX.XXX.XX:YYYY/")
# Add the media to the player
player.set_media(media)
# Play for 10 seconds then exit
player.play()
time.sleep(10)
if __name__ == '__main__':
main()
But when I run the script it creates the file "test.wav" but it's a text plane file instead of wav, what it's I'm waiting for.
Log show me next info:
[00000000022aec08] core input error: ES_OUT_RESET_PCR called
[00007f6704040518] core decoder error: cannot continue streaming due to errors
So I really appreciate someone who can help me. Thank so much.