I'm new to libvlc and want to save h264-video and aac-audio from an RTSP-stream into a file plus count the recorded video frames (for logging together with data from other sensors).
My recording works well with this example but obviously I have no possibility to access any frames to count them:
Code: Select all
libvlc_instance_t* inst = libvlc_new(0, NULL);
libvlc_media_t* m = libvlc_media_new_location(inst, "rtsp://ip-address/stream.sdp");
libvlc_media_add_option (m, ":sout=#std{access=file,mux=mp4,dst=\"outfile.mp4\"}");
libvlc_media_player_t* mp = libvlc_media_player_new_from_media(m);
libvlc_media_release(m);
libvlc_media_player_play (mp);
I already asked on IRC today and got the hint to implement my own video output and use libvlc_video_set_callbacks together with libvlc_video_set_format. But I have no clue how to do the synchronised video- and audio-processing into my file. Maybe I am just searching for the wrong keywords. Any help and further hints are warmly welcome!
der Michi