bilibili / ijkplayer

Android/iOS video player based on FFmpeg n3.4, with MediaCodec, VideoToolbox support.
GNU General Public License v2.0
32.38k stars 8.1k forks source link

Rtsp #2148

Open marva2013 opened 7 years ago

marva2013 commented 7 years ago

How can i read video with RTSP protocol , when i run the demo application i found this error : live2.sdp: Protocol not found Thanks

migueltarga commented 7 years ago

https://github.com/Bilibili/ijkplayer/issues/1737

bbcallen commented 7 years ago

RTSP is disabled by default, you need to modify config/module-lite.sh to enable it.

ghost commented 7 years ago

1、我用module-default.sh是可以播放RTSP,但是打的包快500M,太大了。 2、现在是采用修改module-lite.sh文件, export COMMON_FF_CFG_FLAGS="$COMMON_FF_CFG_FLAGS --enable-protocol=rtp" export COMMON_FF_CFG_FLAGS="$COMMON_FF_CFG_FLAGS --enable-demuxer=rtsp" 然后修改ff_ffplay.c文件, 修改:static int packet_queue_get_or_buffering(FFPlayer ffp, PacketQueue q, AVPacket pkt, int serial, int *finished) { assert(finished); if (!ffp->packet_buffering) return packet_queue_get(q, pkt, 1, serial);

while (1) { int new_packet = packet_queue_get(q, pkt, 0, serial); if (new_packet < 0) return -1; else if (new_packet == 0) { if (q->is_buffer_indicator && !*finished) ffp_toggle_buffering(ffp, 1); new_packet = packet_queue_get(q, pkt, 1, serial); if (new_packet < 0) return -1; }

if (*finished == *serial) {
    av_packet_unref(pkt);
    continue;
}
else
    break;

}

return 1; }

TO-----> static int packet_queue_get_or_buffering(FFPlayer ffp, PacketQueue q, AVPacket pkt, int serial, int finished)

{

while (1) {

int new_packet = packet_queue_get(q, pkt, 1, serial);

if (new_packet < 0)

{

    new_packet = packet_queue_get(q, pkt, 0, serial);

    if(new_packet < 0)

    return -1;

}
else if (new_packet == 0) {

    if (!finished)

    ffp_toggle_buffering(ffp, 1);

    new_packet = packet_queue_get(q, pkt, 1, serial);

    if (new_packet < 0)

    return -1;

}
if (finished == *serial) {

    av_free_packet(pkt);

    continue;

}
else

break;

} return 1; }

然后编译,打包播放不了,我从网上搜到的开源视频流地址:rtsp://218.204.223.237:554/live/1/66251FC11353191F/e7ooqwcfbqjoo80j.sdp

求大家指教!!!

taotao361 commented 7 years ago

请问 coder_XL你的问题解决了吗

spaul13 commented 6 years ago

while using the internet open source video stream address (rtsp: //218.204.223.237: 554 / live / 1 / 0547424F573B085C / gsfp90ef4k0a6iap.sdp)

I am getting the following error,

02-19 21:02:34.306 29772-30094/? E/IJKMEDIA: Connection to tcp://218.204.223.237:554?timeout=0 failed: Connection refused 02-19 21:02:34.306 29772-30094/? D/IJKMEDIA: trying to open the file 02-19 21:02:34.306 29772-30094/? E/IJKMEDIA: rtsp://218.204.223.237:554/live/1/ 0547424F573B085C/gsfp90ef4k0a6iap.sdp: Connection refused

Can @migueltarga , @marva2013 , @taotao361 , @bbcallen , @DawnLan anyone tell me why I am getting this error?