Opened 13 years ago

Closed 13 years ago

Last modified 12 years ago

#284 closed defect (fixed)

Mpg format can not be converted to any other format

Reported by: yxmlines Owned by: Michael Niedermayer
Priority: normal Component: avcodec
Version: unspecified Keywords: crash abort
Cc: Blocked By:
Blocking: Reproduced by developer: no
Analyzed by developer: no

Description

Mpg format can not be converted to any other formatting tips are as follows
Assertion avctx->thread_count > 1 failed at libavcodec/mpeg12.c:2343

Change History (8)

comment:1 by yxmlines, 13 years ago

ps
Video files
http://cid-f1595d774ec888cd.office.live.com/self.aspx/.Public/other/ED.mpg
Command line
ffmpeg -i opening.mpg test.avi

ffmpeg version git-N-30805-g7a02527, Copyright (c) 2000-2011 the FFmpeg develope
rs

built on Jun 16 2011 18:25:31 with gcc 4.5.2
configuration: --prefix=/ffmpeg2 --enable-gpl --enable-version3 --enable-nonfr

ee --enable-postproc --arch=x86 --cpu=i686 --enable-w32threads --enable-runtime-
cpudetect --enable-hardcoded-tables --enable-memalign-hack --enable-avisynth --e
nable-bzlib --enable-frei0r --enable-libaacplus --enable-libopencore-amrnb --ena
ble-libopencore-amrwb --enable-libdirac --enable-libfaac --enable-libfreetype --
enable-libgsm --enable-libmp3lame --enable-libnut --enable-libopenjpeg --enable-
libschroedinger --enable-libspeex --enable-libtheora --enable-libvo-amrwbenc --e
nable-libvorbis --enable-libvpx --enable-libxvid --enable-libxavs --enable-libx2
64 --enable-zlib --enable-libopencv --enable-librtmp --extra-libs='-lrtmp -lpola
rssl -lws2_32 -lwinmm'

libavutil 51. 8. 0 / 51. 8. 0
libavcodec 53. 7. 0 / 53. 7. 0
libavformat 53. 3. 1 / 53. 3. 1
libavdevice 53. 1. 1 / 53. 1. 1
libavfilter 2. 18. 0 / 2. 18. 0
libswscale 0. 14. 1 / 0. 14. 1
libpostproc 51. 2. 0 / 51. 2. 0

Assertion avctx->thread_count > 1 failed at libavcodec/mpeg12.c:2343

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

Last edited 13 years ago by yxmlines (previous) (diff)

comment:2 by yxmlines, 13 years ago

Status: newopen

comment:3 by Carl Eugen Hoyos, 13 years ago

Not reproducible on Linux.

Is "ffmpeg -i ED.mpg" sufficient to trigger the problem? Or "ffmpeg -i ED.mpg -f null -"?
Could you try an unpatched version of FFmpeg?

comment:4 by yxmlines, 13 years ago

Did not add any patches and enable all external encoder / decoder
D:\WinLinux\Minsys\temp\ffmpeg-new>ffmpeg -i "E:\Program Files\TSA\Resource\Movi
e\ED.mpg" -f null
ffmpeg version git-N-30805-g7a02527, Copyright (c) 2000-2011 the FFmpeg develope
rs

built on Jun 17 2011 01:10:56 with gcc 4.5.2
configuration: --prefix=/ffmpeg2 --enable-gpl --enable-version3 --enable-nonfr

ee --enable-postproc --arch=x86 --cpu=i686 --enable-w32threads --enable-runtime-
cpudetect --enable-hardcoded-tables --enable-memalign-hack --enable-avisynth --e
nable-bzlib --enable-frei0r --enable-libopencore-amrnb --enable-libopencore-amrw
b --enable-libdirac --enable-libfaac --enable-libfreetype --enable-libgsm --enab
le-libmp3lame --enable-libnut --enable-libopenjpeg --enable-libschroedinger --en
able-libspeex --enable-libtheora --enable-libvo-aacenc --enable-libvo-amrwbenc -
-enable-libvorbis --enable-libvpx --enable-libxvid --enable-libxavs --enable-lib
x264 --enable-zlib --enable-libopencv --enable-librtmp --extra-libs='-lrtmp -lpo
larssl -lws2_32 -lwinmm'

libavutil 51. 8. 0 / 51. 8. 0
libavcodec 53. 7. 0 / 53. 7. 0
libavformat 53. 3. 1 / 53. 3. 1
libavdevice 53. 1. 1 / 53. 1. 1
libavfilter 2. 18. 0 / 2. 18. 0
libswscale 0. 14. 1 / 0. 14. 1
libpostproc 51. 2. 0 / 51. 2. 0

Assertion avctx->thread_count > 1 failed at libavcodec/mpeg12.c:2343

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

Do not add any patches and disable all external encoder / decoder, enables only w32threads and memalign-hack
D:\WinLinux\Minsys\temp\ffmpeg-new2>ffmpeg -i "E:\Program Files\TSA\Resource\Mov
ie\ED.mpg" -f null
ffmpeg version git-N-30805-g7a02527, Copyright (c) 2000-2011 the FFmpeg develope
rs

built on Jun 17 2011 01:50:15 with gcc 4.5.2
configuration: --prefix=/ffmpeg2 --enable-w32threads --enable-memalign-hack
libavutil 51. 8. 0 / 51. 8. 0
libavcodec 53. 7. 0 / 53. 7. 0
libavformat 53. 3. 1 / 53. 3. 1
libavdevice 53. 1. 1 / 53. 1. 1
libavfilter 2. 18. 0 / 2. 18. 0
libswscale 0. 14. 1 / 0. 14. 1

Assertion avctx->thread_count > 1 failed at libavcodec/mpeg12.c:2343

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

Will be reported only when using mpeg1video/mpeg2video
Assertion avctx-> thread_count> 1 failed at libavcodec/mpeg12.c: 2343

Version 0, edited 13 years ago by yxmlines (next)

comment:5 by Michael Niedermayer, 13 years ago

Please try if the patch below fixes it (and threads still work)
thx

--- a/libavcodec/w32thread.c
+++ b/libavcodec/w32thread.c
@@ -135,11 +135,11 @@ int ff_thread_init(AVCodecContext *s){
         return 0;
     }
 
-    s->active_thread_type= FF_THREAD_SLICE;
-
     if (s->thread_count <= 1)
         return 0;
 
+    s->active_thread_type= FF_THREAD_SLICE;
+
     assert(!s->thread_opaque);
     c= av_mallocz(sizeof(ThreadContext)*s->thread_count);
     s->thread_opaque= c;

in reply to:  5 comment:6 by yxmlines, 13 years ago

Replying to michael:

Please try if the patch below fixes it (and threads still work)
thx

--- a/libavcodec/w32thread.c
+++ b/libavcodec/w32thread.c
@@ -135,11 +135,11 @@ int ff_thread_init(AVCodecContext *s){
         return 0;
     }
 
-    s->active_thread_type= FF_THREAD_SLICE;
-
     if (s->thread_count <= 1)
         return 0;
 
+    s->active_thread_type= FF_THREAD_SLICE;
+
     assert(!s->thread_opaque);
     c= av_mallocz(sizeof(ThreadContext)*s->thread_count);
     s->thread_opaque= c;

Patch test
Able to convert video files encoded using mpeg1video/mpeg2video
thanks

comment:7 by Michael Niedermayer, 13 years ago

Resolution: fixed
Status: openclosed

thanks, the patch will be included with my next push

comment:8 by Carl Eugen Hoyos, 12 years ago

Component: FFmpegavcodec
Keywords: crash abort added
Note: See TracTickets for help on using tickets.