Hello,
I'm trying to use the ffmpeg libraries to encode raw YUV422p video to
long GOP MPEG2.
I've successfully managed to encode the YUV422p video to a raw MPEG2
stream with separate audio files but have been stuck for a week or so
trying to get my code to stop seg faulting when it comes to encoding
MPEG2 using the AVStream struct (with a view to wrap to interleaved
movs) to represent the whole stream rather than just setting up only
an AVCodecContext and passing it to avcodec_encode_video with
outputbuffers and an input frame.
The codec contexts for both the working 'video only' version and the
interleaved version look identical with only a couple of exceptions
(the most notable one being the lack of input buffer in the one that
crashes), but even if I allocate one before calling avcodec_encode it
still seg faults, and more precisely, it falls over before it even
gets to the audio part. If a pair of more experienced eyes can shed
any light as to why this might be happening I'd be extremely grateful.
Max
Here are two links to the AVCodecContexts printouts:
http://www.maxleonard.net/libav/AVCodecContextQuicktime (crashes)
http://www.maxleonard.net/libav/AVCodecContextMPEG2Raw (works)
Here is the gdb output:
Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread 0x7ffff1bc9950 (LWP 1927)]
MPV_encode_picture (avctx=0x119b8e0, buf=0x7ffff0376010 "",
buf_size=33177600, data=0x11fc2a0)
at libavcodec/mpegvideo_enc.c:1194
1194 libavcodec/mpegvideo_enc.c: No such file or directory.
in libavcodec/mpegvideo_enc.c
Current language: auto; currently c
(gdb) backtrace
#0 MPV_encode_picture (avctx=0x119b8e0, buf=0x7ffff0376010 "",
buf_size=33177600, data=0x11fc2a0)
at libavcodec/mpegvideo_enc.c:1194
#1 0x0000000000636ffb in avcodec_encode_video (avctx=0x119b8e0,
buf=0x7ffff0376010 "", buf_size=33177600,
pict=0x1) at libavcodec/utils.c:495
#2 0x00000000005a2dd2 in ffmpeg_encoder_av_encode_video
(in_enc=0x119a5c0,
p_video=0x7fffcf998800 "\201\201}{~\177\200\200||
\204\204}\177\202\200\200\200\177~{x|
\201\177\177\200\177\177\201\200\201\202~\177\201\177\202\204\202~|~
\202\203\204\204\200}\203\204\177\201\206|z\205\203\177\177~
\201\203\177~\210\203|\203\201\177\203\202\201\205\203}\177\202\200~}
\202\205\201\203\201\177\202\204\200~\203\204\201~~
\203
\202
}
\200
\203
\202
\204
\205
\200
\177
\202
\202
\202
\203
\201
}
\201
\202
\177
\177
\200
\203
\204
\201
\177
}
\200
\204
\177
\202
\210
\203
\201
\203
\204
\204
\203
\203
\203
\204
\201
}
\202
\207
\200
\177
\204
\203
\201
\202
\203
\202
\203
\205
\203\202\202\201\177{wwocghcbcdbaegghhkf`ghehiiihigehffefnmijhhj"...)
at ffmpeg_encoder_av.c:587
#3 0x00000000004aa41a in start_record_thread (p_arg=<value optimized
out>) at recorder_functions.cpp:1424
#4 0x00007ffff54b0070 in start_thread () from /lib64/libpthread.so.0
#5 0x00007ffff48a010d in clone () from /lib64/libc.so.6
#6 0x0000000000000000 in ?? ()
(gdb)
_______________________________________________
libav-user mailing list
[email protected]
https://lists.mplayerhq.hu/mailman/listinfo/libav-user