wang-bin / mdk-sdk

multimedia development kit. download:
https://sourceforge.net/projects/mdk-sdk/files/
288 stars 32 forks source link

Password for RTSP stream #98

Closed Poseidonhun closed 1 year ago

Poseidonhun commented 1 year ago

Hello!

I have problem to open a stream with username and password.

I am using this syntax at source property rtsp://username:password@server.com:8554/proxied

is it possible to use with username/password? only non password stream works for me Thanks

`MDK-JNI d3d11: 000001E2FEB18588, dxgi adapter vendor 8086, device 3e9b, revision 0, Intel(R) UHD Graphics 630. UMA

MDK-JNI set d3d11 device. Feature level: 0XB000, create flags: 0

MDK-JNI d3d11: 000001E2FEB18588, dxgi adapter vendor 8086, device 3e9b, revision 0, Intel(R) UHD Graphics 630. UMA

MDK-JNI default FrameReader000001E2FEB7A310 state: 0=>0=>0, 0

MDK-JNI default000001E2FEB7A310 void __cdecl mdk::abi::FrameReader::stop(void), current state: 0

MDK-JNI default FrameReader000001E2FEB7A310 state: 0=>0=>0, 0

MDK-JNI default000001E2FEB7A310 void __cdecl mdk::abi::FrameReader::stop(void), current state: 0

"rtsp://username:password@server.com:8554/proxied" MDK-JNI 000001E2FEB79B80 void __cdecl mdk::abi::MediaControlPush::setState(enum mdk::abi::State)@955 requested state 0=>1, current state 0. status: 0

MDK-JNI default 000001E2FEB7A310 FrameReader.start(0, ...)

MDK-JNI default 000001E2FEB7A310 FrameReader::update MediaStatus 0=>0X2

MDK-JNI default FrameReader000001E2FEB7A310 state: 0=>0=>1, 0

MDK-JNI default FrameReader000001E2FEB7A310 state: 0=>1=>1, 0

MDK-JNI start frame reader thread: 17416

MDK-JNI Failed to create io for url. io: 0000000000000000, open: false

MDK-JNI default 000001E2FEB7A310 FrameReader::update MediaStatus 0X2=>0X2

MDK-JNI try to load av module: D:\git\build-fishcam-app-Desktop_Qt_6_4_0_MSVC2019_64bit-Release\ffmpeg-6.dll

MDK-JNI ffmpeg loaded: D:\git\build-fishcam-app-Desktop_Qt_6_4_0_MSVC2019_64bit-Release\ffmpeg-6.dll

MDK-JNI Selected avutil runtime version: 58.13.101 (build: 58.13.101), license: LGPL version 2.1 or later

MDK-JNI Selected avutil runtime configuration: --extra-version=avbuild --disable-doc --disable-debug --enable-shared --enable-runtime-cpudetect --enable-libvpl --disable-ptx-compression --enable-mediafoundation --disable-postproc --toolchain=msvc --windres=llvm-windres --extra-windresflags='--target=x86_64-pc-windows-msvc -I/c/Program\ Files/Microsoft\ Visual\ Studio/2022/Enterprise/VC/Tools/MSVC/14.36.32532/include -I/c/Program\ Files/Microsoft\ Visual\ Studio/2022/Enterprise/VC/Tools/MSVC/14.36.32532/ATLMFC/include -I/c/Program\ Files/Microsoft\ Visual\ Studio/2022/Enterprise/VC/Auxiliary/VS/include -I/c/Program\ Files\ (x86)/Windows\ Kits/10/include/10.0.22621.0/ucrt -I/c/Program\ Files\ (x86)/Windows\ Kits/10/include/10.0.22621.0/um -I/c/Program\ Files\ (x86)/Windows\ Kits/10/include/10.0.22621.0/shared -I/c/Program\ Files\ (x86)/Windows\ Kits/10/include/10.0.22621.0/winrt -I/c/Program\ Files\ (x86)/Windows\ Kits/10/include/10.0.22621.0/cppwinrt -I/c/Program\ Files\ (x86)/Windows\ Kits/NETFXSDK/4.8/include/um' --enable-pic --extra-cflags='-I/d/a/avbuild/avbuild/tools/Vulkan-Headers/include -MD -Zi -FS -guard:cf -I/d/a/avbuild/avbuild/tools/dep/include -D_WIN32_WINNT=0x0600' --extra-ldflags='-NODEFAULTLIB:libcmt -DEBUG -guard:cf -OPT:REF -SUBSYSTEM:CONSOLE' --enable-small --disable-outdevs --disable-filters --enable-filter='null,afade,fifo,format,resample,aeval,allrgb,allyuv,atempo,pan,bars,color,key,crop,draw,eq,framerate,_qsv,_vaapi,v4l2,hw,scale,volume,test' --disable-muxers --disable-encoders --disable-decoders --disable-demuxers --disable-filter=scale_cuda --enable-decoder='sub,movtext,web,aac,ac3,alac,ape,ass,av1,ccaption,cook,dca,dnxhd,eac3,exr,truehd,ff,yuv,flv,flac,gif,h26[3-4],hevc,hap,mp[1-3],prores,peg,mlp,mpl2,nellymoser,opus,pcm,qtrle,png,tiff,rawvideo,sami,srt,ssa,v210,vc1,vorbis,vp[6-9],wm,wrapped_avframe,rv' --enable-demuxer='sub,ac3,ac,peg,web,ape,ass,avi,concat,dnxhd,dts,dash,flv,gif,hls,h264,hevc,kux,matroska,mov,mp3,mxf,ogg,pcm,rawvideo,rtp,spdif,srt,vc1,v210,wav,pipe,image2,mlv,nsv,nut' --enable-encoder='aac,dnxhd,exr,ff,yuv,gif,h26[3-4],av1,hevc,mjpeg,png,opus,pcm,prores,rawvideo,spdif,speedhq,jpeg,png,tiff,vp[8-9],wrapped_avframe,nvenc,qsv,v4l2m2m,vaapi,vorbis' --enable-muxer='jpeg,dnxhd,fifo,flv,gif,hls,h264,hevc,image2,mov,mp4,mpegts,matroska,null,og,pcm,rawvideo,spdif,pipe,segment,webm,wav,dash,nu'

MDK-JNI av_dict_set00007FFF2E626ED0

MDK-JNI Selected avcodec runtime version: 60.21.100 (build: 60.21.100), license: LGPL version 2.1 or later

MDK-JNI av_packet_alloc00007FFF2E151250

MDK-JNI Selected avformat runtime version: 60.9.100 (build: 60.9.100), license: LGPL version 2.1 or later

MDK-JNI avformat_alloc_context00007FFF2E5EAA50

MDK-JNI before avformat_open_input. io: 0000000000000000(/pb: 0000000000000000, url: rtsp://username:password@server.com:8554/proxied

MDK-JNI FFmpeg/Libav runtime git-2023-06-27-9b6d191-avbuild

MDK-JNI after avformat_open_input. pb: 0000000000000000, iformat: 00007FFF2E9AACC0 context flags: 2097216, input format flags: 1`

wang-bin commented 1 year ago

what's the error if use password? please paste the whole log

Poseidonhun commented 1 year ago

I had paste everything except this, MDK-JNI demuxer io timeout detected: 10058ms elapsed

MDK-JNI demuxer io timeout detected: 10159ms elapsed

MDK-JNI demuxer io timeout detected: 10259ms elapsed

maybe I am not in the correct log level?

`VideoTextureItem::VideoTextureItem() {

setFlag(ItemHasContents, true);
m_player = make_shared<Player>();
m_player->onStateChanged([this](State value){
    emit statusChanged();
});
m_player->setRenderCallback([=](void *){
    QMetaObject::invokeMethod(this, "update");
});
m_player->setFrameRate(-1);
m_player->setBufferRange();
m_player->setDecoders(MediaType::Video, {"MFT:d3d=11:copy=0", "FFmpeg", "CUDA", "hap", "D3D11", "DXVA", "dav1d"});
SetGlobalOption("avformat", "fflags=+nobuffer:analyzeduration=1000:probesize=100:fpsprobesize=0:avioflags=direct");
SetGlobalOption("logLevel","all");
SetGlobalOption("profiler.gpu", 1);
setLogHandler([](LogLevel v, const char* msg){
    if (v < LogLevel::Info)
        qWarning()<<"MDK-JNI"<< msg;
    else
        qDebug()<<"MDK-JNI"<< msg;
});

}`

wang-bin commented 1 year ago

the reason timeout but not password. what about vlc, ffplay?

Poseidonhun commented 1 year ago

Both works. But the problem is not this? MDK-JNI Failed to create io for url. io: 0000000000000000, open: false

wang-bin commented 1 year ago

it's expected for rtsp, not an error

Poseidonhun commented 1 year ago

I had increased the timeout to 20sec. Then I have this now. Seems to me codec problem

MDK-JNI [FFmpeg:rtsp] Could not find codec parameters for stream 0 (Video: h264, none): unspecified size Consider increasing the value for the 'analyzeduration' (0) and 'probesize' (5000000) options

MDK-JNI supports 205 ffmpeg sw pixel formats. unsupported: uyyvyy411 x2rgb10be x2bgr10be p212be p212le p412be p412le

MDK-JNI incorrect start_time: -9223372036854776, duration: -9223372036854776

MDK-JNI av_read_frame error: (0xabb6a7bb) Immediate exit requested

MDK-JNI Format: rtsp, range: 0 +0ms, bitrate: 0, size: 0 Metadata: title: Stream Streams: 1 Video: stream#0, range: 0 +0ms, frames: 0 codec: h264 tag: 0 profile: -99 level: -99, unknown, bpc:0, bpp:0(), channels:(), map: 0 0 0 0, bitrate: 0, 0x0, fps: 90000, bframes: 0 extra data(49): 00 00 00 01 27 4D 40 29 95 A0 1E 00 89 F9 61 00 00 03 00 01 00 00 03 00 3C E2 C0 00 2D C6 C0 00 77 35 EF 7B 80 78 91 35 00 00 00 01 28 EE 02 5C 80

MDK-JNI default 0000029E58E8B7A0 FrameReader::update MediaStatus 0X2=>0X4

MDK-JNI buffering progress 0%

MDK-JNI default 0000029E58E8B7A0 FrameReader::update MediaStatus 0X4=>0X14

MDK-JNI ++++++++++++BUFFERING START++++++++++++

MDK-JNI MDK-JNI av_read_frame error: (0xabb6a7bb) Immediate exit requested

MDK-JNI default 0000029E58E8B7A0 FrameReader::update MediaStatus 0X14=>0X54

MDK-JNI read packet error. FrameReader@0000029E58E8B7A0 sending Packet::End to all packet queues. PacketIO@0000029E5B3569E0 ->url: rtsp://user:password@server.com:8554/proxied

MDK-JNI default FrameReader0000029E58E8B7A0 state: 0=>1=>1, 1

MDK-JNI default FrameReader0000029E58E8B7A0 update state: 0=>1

MDK-JNI default FrameReader0000029E58E8B7A0 state: 1=>1=>0, 0

MDK-JNI 0000029E58E8B7A0 bool __cdecl mdk::abi::FrameReaderImpl::unload(void), current status 0x54, invalid: 0, loading: 0, loaded: 4, buffering: 16, seeking: 0, prepared: 0, EOF: 64

MDK-JNI 0000029E610A9780 request avformat input interrupt

MDK-JNI buffering progress 100%

MDK-JNI default 0000029E58E8B7A0 FrameReader::update MediaStatus 0X54=>0X164

MDK-JNI ++++++++++++BUFFERING END++++++++++++

MDK-JNI MDK-JNI interrupted by user

MDK-JNI 13032default 0000029E58E8B7A0 bool __cdecl mdk::abi::FrameReader::update(enum mdk::abi::MediaStatus) @1052: reset status_mask

MDK-JNI default 0000029E58E8B7A0 FrameReader::update MediaStatus 0X164=>0X41

MDK-JNI default FrameReader0000029E58E8B7A0 state: 1=>0=>0, 1

MDK-JNI default FrameReader0000029E58E8B7A0 update state: 1=>0

wang-bin commented 1 year ago

SetGlobalOption("avformat", "fflags=+nobuffer:fpsprobesize=0:avioflags=direct");

remove analyzeduration=1000:probesize=100 or use a large value

Poseidonhun commented 1 year ago

I force the server to use tcp connection than it works. Thanks for the fast responses!