Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- av_register_all();
- avformat_network_init();
- AVDictionary *option = NULL;
- const char* url = "rtsp://local_watcher/live.sdp";
- av_dict_set(&option, "rtsp_transport", "tcp", 0);
- // Open RTSP
- int err = avformat_open_input(&ctx, url, NULL, &option);
- av_dict_free(&option);
- int index = -1;
- for (int i = 0; i < ctx->nb_streams; i++) {
- if (ctx->streams[i]->codec->codec_type == AVMEDIA_TYPE_VIDEO) {
- index = i;
- break;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement