Closed silvioprog closed 2 years ago
As mentioned on the mpv issue, reproduced here for future visitors:
Your two options for this are passing the keyword argument to the constructor:
import mpv
player = mpv.MPV(stream_record='out.mp3')
player.play('http://s1.myradiostream.com:12508/listen.mp3')
player.wait_for_playback()
or setting the property on MPV before playback:
import mpv
player = mpv.MPV()
player.stream_record='out.mp3'
player.play('http://s1.myradiostream.com:12508/listen.mp3')
player.wait_for_playback()
setting the player.stream_record
property to a new value mid playback also seems to correctly switch to a new stream and close the old one correctly.
import mpv
import time
player = mpv.MPV()
player.play('http://s1.myradiostream.com:12508/listen.mp3')
time.sleep(10)
player.stream_record='outdelayed.mp3'
time.sleep(5)
player.stream_record='outdelayed2.mp3'
time.sleep(5)
player.stream_record='outdelayed3.mp3'
player.wait_for_playback()
@dfaker, firstly, thanks a lot for this information, it worked and will help me a lot!
So, I have another question. To stop the only the recording without stop the radio, I'll use this (ugly) code (that works fine):
player.stream_record = ''
Is this a proper way to stop a recording and keep the streaming playing?
That doesn't strike me as a distasteful solution at all.
Thanks again for the additional info, @dfaker. I'm going to use it. :+1:
Hi.
First, thanks for this awesome project!
So, is there any option to start a streaming record?
For example, using the
mpv
command line tool, we can record a streaming into a output file:It would be really a useful feature!
cheers