Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Assertion while playing RTSP stream. #129

Closed
FoxVisionPro opened this issue Dec 21, 2013 · 39 comments
Closed

Assertion while playing RTSP stream. #129

FoxVisionPro opened this issue Dec 21, 2013 · 39 comments
Assignees

Comments

@FoxVisionPro
Copy link

Hello,

There is an assertion error when i use YOUR player exemple to play an rtsp url. See by yourself: rtsp://******-

When i try to read this url, i have this message:

Runtime error !

Program:
C:\...\...\...\build-QtAV-Desktop....\bin\player.exe

This application has requested the Runtime to terminate it in an unusual way.
Please contact the application's support team for more information.

[OK]

The sound keep playing but there is no image until i click on [OK] then the program exits.

In my own application in Debug mode, the message is:

ASSERT failure in QCoreApplication::sendEvent: "Cannot send events to objects owned by a different thread. Current thread 65bb10. Receiver 'MainWindow' (of type 'QWidget') was created in thread 661d58", file kernel\qcoreapplication.cpp, line 494
Debug Error!

Program: C:\Programmation-Files\VC\QT5\5.1.0\msvc2012\bin\Qt5Cored.dll
Module: 5.1.0
File: global\qglobal.cpp
Line: 2022

ASSERT failure in QCoreApplication::sendEvent: "Cannot send events to objects owned by a different thread. Current thread 65bb10. Receiver 'MainWindow' (of type 'QWidget') was created in thread 661d58", file kernel\qcoreapplication.cpp, line 494

(Press Retry to debug the application)

Thanks,

@wang-bin
Copy link
Owner

works fine for me

@ghost ghost assigned wang-bin Dec 29, 2013
@FoxVisionPro
Copy link
Author

Ok, Do you have Qt 5.1 or 5.2 ? or other version ?

Thanks,

@wang-bin
Copy link
Owner

wang-bin commented Jan 2, 2014

5.2. What about you?

@FoxVisionPro
Copy link
Author

I'm using Qt 5.1 so i'll try to update QT to 5.2 version.
I'll try and i'll close if it is resolved.

@FoxVisionPro
Copy link
Author

Hi again :)

I installed Qt 5.2.

I'll try to use your last uploaded version of binaries of QtAv (msvc 2013) and after a couple of seconds, the result is a crash.
See screenshot: http://puu.sh/68uS7.jpg

As you can see, the program crash. May it's because of windows 8, may it's because the link i gave you is a mp4 video format (avc, aac), i don't understand :(

If you don't have the problem, it will be hard to resolve it :(
so i let the ticket open, and i ll try new versions of your library.

Thanks,

@wang-bin
Copy link
Owner

wang-bin commented Jan 4, 2014

I use win8 too. Is the video same as the link you post here?

@FoxVisionPro
Copy link
Author

Hi,

Yes i tested with the same link.
I tried in my application and i have new logs messages, maybe they could help..

See by yourself:

Trying to use 'H.264 variable-length decoder, no film grain technology' as input
NV12 is supported for output
Using 'H.264 variable-length decoder, no film grain technology' to decode to 'NV12'
**************Video decoder found
setCapture 0xb0f348
QObject::connect: No such signal QtAV::VideoThread::terminated()
EQTask tid=0xa67df0
EQTask::run() tid=0xa67df0 (b: 0, c: 0, s: 0)
EQTask tid=0xa67df0
WindowSize: 1280x720
EQTask::run() tid=0xa67df0 (b: 0, c: 0, s: 0)
EQTask tid=0xa67df0
EQTask::run() tid=0xa67df0 (b: 0, c: 0, s: 0)
queue threshold==>>14
queue capacity==>>22
stream: 1, duration=-9223372036854775808 (-102481911520608624 ms==0.000000), time_base=0.000011
codec: h264(H.264 / AVC / MPEG-4 AVC / MPEG-4 part 10)
stream: 0, duration=-9223372036854775808 (-192153584101141152 ms==0.000000), time_base=0.000021
codec: aac(AAC (Advanced Audio Coding))
Starting audio thread...
Starting video thread...
queue empty!!
queue empty!!
demux thread start running...2 avthreads
demux thread pause 0
get av queue a/v thread = 0x6a39ef8 0x7065770
AVClock started!!!!!!!!
out rect: 0.000000 0x719 ==>
0.000000 0x719 <<<<<<<<
out rect: 0.000000 0x719 ==>
0.000000 0x719 <<<<<<<<
out rect: 0.000000 0x719 ==>
0.000000 0x480 <<<<<<<<
out rect: 0.000000 0x480 ==>
0.000000 0x719 <<<<<<<<
available hardware decoder output format 61 (dxva2_vld)
available software decoder output format 0 (yuv420p)
DxCreateVideoDecoder id 28 720x480
QtAV::VideoDecoderDXVAPrivate::DxCreateVideoDecoder @725 vs=0x84e892c surface_count=17 surface_width=720 surface_height=480
IDirectXVideoAccelerationService_CreateSurface succeed with 17 surfaces (720x480)
we got 2 decoder configurations
configuration[0] ConfigBitstreamRaw 1
configuration[1] ConfigBitstreamRaw 2
IDirectXVideoDecoderService_CreateVideoDecoder succeed. decoder=0x3a95cdc
Using DXVA2 (NVIDIA NVS 5100M, vendor 4318(NVIDIA), device 2604, revision 162) for hardware decoding.
{FFmpeg} no picture
no frame could be decompressed: Error number 3268 occurred
{FFmpeg} Cannot parallelize deblocking type 1, decoding such frames in sequential order
{FFmpeg} no picture
no frame could be decompressed: Error number 1549 occurred
{FFmpeg} Warning: data is not aligned! This can lead to a speedloss
QtAV::VideoRenderer::setInSize => calculating aspect ratio from converted input data(1.500000)
out rect: 1.500000 0x719 ==>
1.500000 1078x719 <<<<<<<<
{FFmpeg} RTP: missed 20 packets
{FFmpeg} Frame num gap 0 12
{FFmpeg} Assertion abs(src_linesize) >= bytewidth failed at /home/kyle/software/ffmpeg/source/ffmpeg-git/libavutil/imgutils.c:248
timer: 5, current thread: 0xa67df0, player thread: 0xa67df0
stopping audio thread...
QObject::killTimer: timers cannot be stopped from another thread
audio thread stop after decode()
Audio thread stops running...
stopping video thread...
{FFmpeg} RTP: missed 1 packets
stopping video thread...
stopping video thread...

It seems an assertion occured !
What do you think about that ?

PS: i tried with VLC media player, and the url works great.

Thanks,

@FoxVisionPro
Copy link
Author

May it's because of ffmpeg... i'll try to use another version..

@wang-bin
Copy link
Owner

wang-bin commented Jan 4, 2014

I see. Current solution is disable hardware decoding. You can uncheck DXVA in player.

Hardware decoding is not quite stable. It can work fine for most video. I have this assertion for some video.

@wang-bin
Copy link
Owner

wang-bin commented Jan 4, 2014

not ffmpeg fault.

@FoxVisionPro
Copy link
Author

Ok i'll try

@FoxVisionPro
Copy link
Author

Sorry but unfortunately, this is not DXVA, the player still crash after a couple of seconds.
I noticed that the crash occurs at different times, but still at the beginning of the video. (in seconds).

@FoxVisionPro
Copy link
Author

{FFmpeg} RTP: missed 9 packets
{FFmpeg} Frame num gap 14 12
{FFmpeg} Assertion abs(src_linesize) >= bytewidth failed at libavutil/imgutils.c:248

There is a loop of audio thread a the end. (afteryour library decided to stop the thread)

@wang-bin
Copy link
Owner

wang-bin commented Jan 4, 2014

It's strange. I have no idea now. Can you try ffplay or mplayer?

@FoxVisionPro
Copy link
Author

I'll try. I must build your library with mplayer or ffplay libraries, or i just have to install them and try with your player ?

@FoxVisionPro
Copy link
Author

Ok i just tried ffplay. It works well, so you were right, it's not ffmpeg oO

@FoxVisionPro
Copy link
Author

It's strange because you are using ffmpeg.... how can i disable dxva in my application ? (with code)
I tried your player, may it didn't disable it successfuly.

@wang-bin
Copy link
Owner

wang-bin commented Jan 4, 2014

AVPlayer::setPriority(const QVector& ids); In my player, open "Decoder" menu, then uncheck dxva

@FoxVisionPro
Copy link
Author

I just noticed something.
FFplay write:

libavutil      52. 58.101 / 52. 58.101

and your logs write:

Build with libavutil-52.48.101

And the assertion is in the libavutil library as:

{FFmpeg} Assertion abs(src_linesize) >= bytewidth failed at libavutil/imgutils.c:248

Is there a version issue ?

Yes for your player, don't worry, i already did it xD
Ok thanks for the code, i'll try it.

Thanks,

@wang-bin
Copy link
Owner

wang-bin commented Jan 4, 2014

The packages I uploaded to sourceforge have right version. If the version mismatch, you can see red text warning about runtime version in "About" dialog's ffmpeg page.

I think there are some mistakes in my player and result in a crash

@FoxVisionPro
Copy link
Author

Ok :)

@FoxVisionPro
Copy link
Author

I just built your library again but i commented this in the pro file, so i think i disabled the dxva:

[...]
#win32 {
    #OptionalDepends += dxva
#}

The error occurs again. I don't know what i could do now :( just wait for next version may be.
A thing is strange in the logs, in fact, the version of libAVUTIL is still:

Build with libavcodec-55.39.101
Build with libavformat-55.19.104
Build with libavutil-52.48.101
Build with libswscale-2.5.101
Build with libswresample-0.17.104
Build with libavresample-1.1.0

but i just build it with:

FFmpeg version: 2013-12-19 git-d2d794f
  libavutil      52. 58.101 / 52. 58.101
  libavcodec     55. 45.102 / 55. 45.102
  libavformat    55. 22.100 / 55. 22.100
  libavdevice    55.  5.102 / 55.  5.102
  libavfilter     4.  0.100 /  4.  0.100
  libswscale      2.  5.101 /  2.  5.101
  libswresample   0. 17.104 /  0. 17.104
  libpostproc    52.  3.100 / 52.  3.100

may it's just a display error. But if this can be my solution ... :D

Thanks :/

@wang-bin
Copy link
Owner

wang-bin commented Jan 4, 2014

You are not build the version that ffmpeg show.. Did you set the environment correctly?

@FoxVisionPro
Copy link
Author

yes oO, i have only one version of ffmpeg-dev on my computer, it's strange...
I'll search about that.

Thanks for your help, i hope my issue with rtsp protocol will be resolved quickly :(
I'll try setting ffmpeg versions...

Thanks for your help :/

@FoxVisionPro
Copy link
Author

That's ok, i finally successfully change version (it was a bad dll) but the problem persist, so i just wait.

Thanks,

@FoxVisionPro
Copy link
Author

I have a good news xD, with the last version of ffmpeg and the DXVA disabled, your library don't crash anymore :)
However i have no DXVA :(

@wang-bin
Copy link
Owner

wang-bin commented Jan 4, 2014

the package is build with ffmpeg 2.1.1, the latest release. you are using ffmpeg from git?

what about your dxva? can not compile?

@FoxVisionPro
Copy link
Author

Yes, this is a nightly build :) of ffmpeg
DXVA just crash as usual, i just comment lines about DXVA in your .pro files in order to directly disable it.

@wang-bin
Copy link
Owner

wang-bin commented Jan 4, 2014

you can build with dxva and disable at runtime or in your code

@FoxVisionPro
Copy link
Author

Yes sure :p, it's just to be sure (i'm too prudent)

@FoxVisionPro
Copy link
Author

I think dvxa crashes when rtsp (rtp behind with udp packets) lose packets and some parts of the video are invalid.
We can see missing packets when the image pass from http://puu.sh/69eSt.jpg to http://puu.sh/69eT9.jpg.

We can see display errors due to the missing packets.
At the beginning of the video there is no errors because it's black and the network works well, but after a couple of seconds packets are missing (my connexion is bad) and the video crashes.

I hope to help :p
Thanks,

@wang-bin
Copy link
Owner

wang-bin commented Jan 4, 2014

Yes. It helps. You are right i think. Hardware decoding must decode a key frame(I frame) first then other types. The released QtAV 1.3.0 often crash when seeking and using dxva, with the same reason. I fixed it. But it not works for network stream now.

: )

@FoxVisionPro
Copy link
Author

Oki nice :)
I wait for you to fix this now :D

xD, thanks

@FoxVisionPro
Copy link
Author

Hello,

Have you resolved or trying to resolve this issue please ?
If not, do you think you'll try soon ?

Because i already use QtAV in a big project, i hope this feature works since i really need it.

Thanks for your patience

@wang-bin
Copy link
Owner

FFmpeg AVPacket has a flag, can be AV_PKT_FLAG_CORRUPT. I find vlc has a similar flag called BLOCK_FLAG_CORRUPTED, vlc does not decode such packets. So I think it is the solution. I will try it soon.

@wang-bin
Copy link
Owner

try the latest code. see a968f20

@wang-bin
Copy link
Owner

I have not test environment. so you may try yourself and tell me the result

@FoxVisionPro
Copy link
Author

Cool, i'll try today and i ll tell you the result
Thanks,

@FoxVisionPro
Copy link
Author

Oh that seems working well !!
If i have a bug or something else, i post a new issue, but my tests seems to work well for now with hardware acceleration.

Thanks u so much !!
Have a good day :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants