2015-11-26 19 views
7

Ich habe eine App, in der ich Video-Frames von IP-Kamera entschlüsseln, aber die Methode in avcodec.h generieren bad_access, kann ich nicht herausfinden, was falsch ist.Fehler beim Decodieren von Kamera-Stream-Video-Frame mit FFMpeg iOS

Diese App funktionierte gut mit alten Bibliotheken FFMpeg, aber nach Apple-Richtlinie, um App zu unterstützen es Arm64 zu unterstützen, so aktualisierte ich meine Bibliotheken Arm 64 zu unterstützen und danach trat dieses Problem auf. Hier

ist der Screenshot

enter image description here

Während bad_access App wird das folgende Protokoll zu erzeugen:

[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 

komplette Fehlerprotokoll:https://drive.google.com/file/d/0B-Nh7ci6wLX0OVlxaXV4aGpJems/view?usp=sharing

Crash-Log:http://crashes.to/s/6765d63b540

Hinweis: Wenn Sie irgend etwas anderes brauchen, bitte Kommentar.

+0

Dieser Screenshot scheint nicht mit dem Absturzprotokoll übereinzustimmen. Das Crash-Protokoll sieht wie ein Problem bei der Dereferenzierung von NULL aus. Es wäre auch nützlich, die Parameterwerte zu kennen. – trojanfoe

+0

welche Parameter Sie sehen möchten. Sag mir einfach, was du brauchst. –

+0

Die Parameter, die an diese Methode übergeben wurden – trojanfoe

Antwort

3

Ich löste mein Problem, das Problem war mit abgeschriebenen Methode avcodec_alloc_frame(). Ich mich schließlich aktualisierte meine Header-Dateien verwenden, danach wurde Warnungen vor Abschreibung Methode avcodec_alloc_frame() so, ich es av_frame_alloc() aktualisiert und es funktionierte einwandfrei

ich den folgenden Code in Konstruktor

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]; 

Dann!