オーディオストリームからX秒をファイルに保存しようとしています。私はRTSPサーバーを持っており、このサーバーから数秒間ファイルを保存するためにPythonで単純なスクリプトを作成しました(.wav)。ファイルへのRTSPストリームの記録(.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()
しかし、私は、スクリプトを実行すると、それは私が待っている何、それはファイル「test.wav」を作成しますが、それは代わりにwavファイルのテキスト・プレーン・ファイルです。
ログは私に次の情報を表示:
[00000000022aec08] core input error: ES_OUT_RESET_PCR called
[00007f6704040518] core decoder error: cannot continue streaming due to errors
だから私は本当に私を助けることができる誰かに感謝しています。 ありがとうございます。