मैं फ़ंक्शन avcodec_decode_video2 का उपयोग कर रहा हूं। स्ट्रीम में एन्कोडिंग परिवर्तन पर, यह -10 9 4 9 55552 लौटाता है। प्रलेखन केवल राज्यों:मैं यह कैसे पता लगा सकता हूं कि यह ffmpeg त्रुटि कोड का अर्थ क्या है?
त्रुटि पर एक नकारात्मक मूल्य, लौट आए अन्यथा बाइट्स की संख्या का इस्तेमाल किया या शून्य अगर कोई फ्रेम decompressed जा सकता है।
लेकिन रिटर्न कोड या दस्तावेज़ीकरण के किसी अन्य रूप का प्रतीत नहीं होता है। त्रुटि का क्या मतलब है और मैं सामान्य रूप से यह कैसे निर्धारित कर सकता हूं?
avcodec.h#include <errno.h>
#if EINVAL > 0
#define AVERROR(e) (-(e)) /**< Returns a negative error code from a POSIX error code, to return from library functions. */
#define AVUNERROR(e) (-(e)) /**< Returns a POSIX error code from a library function error return value. */
#else
/* Some platforms have E* and errno already negated. */
#define AVERROR(e) (e)
#define AVUNERROR(e) (e)
#endif
#define AVERROR_UNKNOWN AVERROR(EINVAL) /**< unknown error */
#define AVERROR_IO AVERROR(EIO) /**< I/O error */
#define AVERROR_NUMEXPECTED AVERROR(EDOM) /**< Number syntax expected in filename. */
#define AVERROR_INVALIDDATA AVERROR(EINVAL) /**< invalid data found */
#define AVERROR_NOMEM AVERROR(ENOMEM) /**< not enough memory */
#define AVERROR_NOFMT AVERROR(EILSEQ) /**< unknown format */
#define AVERROR_NOTSUPP AVERROR(ENOSYS) /**< Operation not supported. */
#define AVERROR_NOENT AVERROR(ENOENT) /**< No such file or directory. */
#define AVERROR_EOF AVERROR(EPIPE) /**< End of file. */
#define AVERROR_PATCHWELCOME -MKTAG('P','A','W','E') /**< Not yet implemented in FFmpeg. Patches welcome. */
यह त्रुटियां जिन्हें आप पूरा कर सकते हैं का पूरा सेट है, libavcodec \ फ़ाइल में
:
धन्यवाद। मैं यह कहता हूं, हालांकि, वे सभी errno.h पर आधारित हैं जो 1-131 से लेकर हैं। मुझे समझ में नहीं आता कि -10 9 4 9 5555 के रूप में इतना बड़ा मूल्य कैसे वापस किया जा सकता है। – Asik
उपरोक्त कोड में आप निषेध के साथ खेल सकते हैं। यहां तक कि हमारी संख्या अजीब लगती है। तो क्यों लिखें (अगर retcode == AVERROR (EINVAL)) { printf ("अज्ञात त्रुटि"); } –