2015-11-26 5 views
7

J'ai une application, dans lequel je décode les images vidéo provenant de caméra ip, mais la méthode avcodec_decode_video2(m_pCodecCtx, m_pFrame, &consumed_bytes, &avpkt); présent dans avcodec.h générant bad_access, je ne peux pas comprendre ce qui ne va pas.Erreur lors du décodage caméra vidéo flux en utilisant FFMpeg iOS

Cette application fonctionnait très bien avec les anciennes bibliothèques FFMpeg, mais par la politique de la pomme, afin de publier app il supporte arm64, donc j'ai mis à jour mes bibliothèques pour soutenir arm64 et après que ce problème est survenu.

Voici la capture d'écran

enter image description here

Alors que l'application bad_access génère le journal suivant:

[h264 @ 0x1071400] sps_id 12 out of range 
[h264 @ 0x1071400] pps_id 417 out of range 
[h264 @ 0x1071400] sps_id 3 out of range 
[h264 @ 0x1071400] sps_id 32 out of range 
[h264 @ 0x1071400] sps_id 6 out of range 
[h264 @ 0x1071400] sps_id 0 out of range 
[h264 @ 0x1071400] sps_id 32 out of range 
[h264 @ 0x1071400] sps_id 1 out of range 
[h264 @ 0x1071400] sps_id 3 out of range 
[h264 @ 0x1071400] sps_id 0 out of range 
[h264 @ 0x1071400] sps_id 32 out of range 
[h264 @ 0x1071400] sps_id 0 out of range 
[h264 @ 0x1071400] sps_id 1 out of range 
[h264 @ 0x1071400] sps_id 1 out of range 
[h264 @ 0x1071400] sps_id 1 out of range 
[h264 @ 0x1071400] sps_id 1 out of range 
[h264 @ 0x1071400] sps_id 1 out of range 
[h264 @ 0x1071400] sps_id 1 out of range 
[h264 @ 0x1071400] sps_id 1 out of range 
[h264 @ 0x1071400] sps_id 2 out of range 
[h264 @ 0x1071400] sps_id 2 out of range 
[h264 @ 0x1071400] sps_id 2 out of range 
[h264 @ 0x1071400] sps_id 2 out of range 
[h264 @ 0x1071400] sps_id 2 out of range 
[h264 @ 0x1071400] sps_id 0 out of range 
[h264 @ 0x1071400] sps_id 32 out of range 
[h264 @ 0x1071400] sps_id 3 out of range 
[h264 @ 0x1071400] sps_id 0 out of range 
[h264 @ 0x1071400] sps_id 1 out of range 
[h264 @ 0x1071400] sps_id 1 out of range 
[h264 @ 0x1071400] sps_id 1 out of range 
[h264 @ 0x1071400] sps_id 1 out of range 
[h264 @ 0x1071400] sps_id 1 out of range 
[h264 @ 0x1071400] sps_id 1 out of range 
[h264 @ 0x1071400] sps_id 1 out of range 
[h264 @ 0x1071400] sps_id 2 out of range 
[h264 @ 0x1071400] sps_id 2 out of range 
[h264 @ 0x1071400] sps_id 2 out of range 
[h264 @ 0x1071400] sps_id 2 out of range 
[h264 @ 0x1071400] sps_id 2 out of range 
[h264 @ 0x1071400] pps_id 418 out of range 
[h264 @ 0x1071400] Partitioned H.264 support is incomplete 
[h264 @ 0x1071400] sps_id 6 out of range 
[h264 @ 0x1071400] sps_id 0 out of range 
[h264 @ 0x1071400] sps_id 0 out of range 
[h264 @ 0x1071400] sps_id 0 out of range 
[h264 @ 0x1071400] sps_id 0 out of range 
[h264 @ 0x1071400] sps_id 0 out of range 
[h264 @ 0x1071400] sps_id 0 out of range 
[h264 @ 0x1071400] sps_id 0 out of range 
[h264 @ 0x1071400] sps_id 1 out of range 
[h264 @ 0x1071400] non-existing PPS 3 referenced 
[h264 @ 0x1071400] decode_slice_header error 
[h264 @ 0x1071400] sps_id 0 out of range 
[h264 @ 0x1071400] slice type 10 too large at 0 0 
[h264 @ 0x1071400] decode_slice_header error 
[h264 @ 0x1071400] sps_id 0 out of range 
[h264 @ 0x1071400] sps_id 0 out of range 
[h264 @ 0x1071400] sps_id 0 out of range 
[h264 @ 0x1071400] sps_id 0 out of range 
[h264 @ 0x1071400] non-existing PPS 2 referenced 
[h264 @ 0x1071400] decode_slice_header error 
[h264 @ 0x1071400] sps_id 0 out of range 
[h264 @ 0x1071400] sps_id 0 out of range 
[h264 @ 0x1071400] sps_id 0 out of range 
[h264 @ 0x1071400] sps_id 0 out of range 
[h264 @ 0x1071400] slice type 29 too large at 0 0 
[h264 @ 0x1071400] decode_slice_header error 
[h264 @ 0x1071400] sps_id 2 out of range 
[h264 @ 0x1071400] sps_id 0 out of range 
[h264 @ 0x1071400] sps_id 0 out of range 
[h264 @ 0x1071400] sps_id 0 out of range 
[h264 @ 0x1071400] sps_id 0 out of range 
[h264 @ 0x1071400] sps_id 0 out of range 
[h264 @ 0x1071400] slice type 32 too large at 0 0 
[h264 @ 0x1071400] decode_slice_header error 
[h264 @ 0x1071400] slice type 32 too large at 0 0 
[h264 @ 0x1071400] decode_slice_header error 
[h264 @ 0x1071400] slice type 32 too large at 0 0 
[h264 @ 0x1071400] decode_slice_header error 
[h264 @ 0x1071400] slice type 32 too large at 0 0 

erreur complète journal:https://drive.google.com/file/d/0B-Nh7ci6wLX0OVlxaXV4aGpJems/view?usp=sharing

journal des blocages:http://crashes.to/s/6765d63b540

Note: Si vous avez besoin d'autre chose, s'il vous plaît commenter.

+0

Cette capture d'écran ne semble pas correspondre au journal de plantage. Le journal de plantage ressemble à un problème de déréférencement NULL. Il serait également utile de connaître les valeurs des paramètres. – trojanfoe

+0

quels paramètres vous voulez voir. Dites-moi ce dont vous avez besoin. –

+0

Les paramètres passés à cette méthode – trojanfoe

Répondre

3

J'ai résolu mon problème, Le problème était avec la méthode dépréciée avcodec_alloc_frame().

j'utilisais le code suivant dans le constructeur

m_pCodecCtx = avcodec_alloc_context3(m_pCodec); 
    if(m_pCodecCtx == NULL) 
    { 
     NSLog(@"if(pCodecCtx == NULL)\n"); 
     return ; 
    } 
    [g_Lock lock]; 
    //¥Úø™codec°£»Áπ˚¥Úø™≥…𶵃ª∞£¨∑÷≈‰AVFrame£  
    if(avcodec_open2(m_pCodecCtx, m_pCodec, NULL) >= 0)  
    {  
     m_pFrame = avcodec_alloc_frame(); /* Allocate video frame */ 

    } 
    [g_Lock unlock]; 

Puis j'ai finalement mis à jour mes fichiers d'en-tête, par la suite je me suis avertissements sur la dépréciation de la méthode avcodec_alloc_frame(), je mis à jour à av_frame_alloc() et cela a fonctionné parfaitement!