Skip to content

An exception occurs when the multi-threaded version executes video-to-image conversion. #905

@tqq1994516

Description

@tqq1994516

Describe the bug
When I execute exec('-i', 'aa.mp4', '-y', '-r', '5', '-f', 'image2', 'frame_%04d.png'), it works normally with the core version, but gets stuck when using mt-core.

To Reproduce

ffmpeg.exec('-i', 'aa.mp4', '-y', '-r', '5', '-f', 'image2', 'frame_%04d.png')

Expected behavior
Outputs normally just like the single-threaded version

type stderr message ffmpeg version 5.1.4 Copyright (c) 2000-2023 the FFmpeg developers
game_tools.js:782 type stderr message   built with emcc (Emscripten gcc/clang-like replacement + linker emulating GNU ld) 3.1.40 (5c27e79dd0a9c4e27ef2326841698cdd4f6b5784)
game_tools.js:782 type stderr message   configuration: --target-os=none --arch=x86_32 --enable-cross-compile --disable-asm --disable-stripping --disable-programs --disable-doc --disable-debug --disable-runtime-cpudetect --disable-autodetect --nm=emnm --ar=emar --ranlib=emranlib --cc=emcc --cxx=em++ --objcc=emcc --dep-cc=emcc --extra-cflags='-I/opt/include -O3 -msimd128' --extra-cxxflags='-I/opt/include -O3 -msimd128' --disable-pthreads --disable-w32threads --disable-os2threads --enable-gpl --enable-libx264 --enable-libx265 --enable-libvpx --enable-libmp3lame --enable-libtheora --enable-libvorbis --enable-libopus --enable-zlib --enable-libwebp --enable-libfreetype --enable-libfribidi --enable-libass --enable-libzimg
   libavutil      57. 28.100 / 57. 28.100
   libavcodec     59. 37.100 / 59. 37.100
   libavformat    59. 27.100 / 59. 27.100
   libavdevice    59.  7.100 / 59.  7.100
   libavfilter     8. 44.100 /  8. 44.100
   libswscale      6.  7.100 /  6.  7.100
   libswresample   4.  7.100 /  4.  7.100
   libpostproc    56.  6.100 / 56.  6.100
 [mov,mp4,m4a,3gp,3g2,mj2 @ 0xdee970] Unknown cover type: 0x1.
 Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'aa.mp4':
   Metadata:
     major_brand     : isom
     minor_version   : 512
     compatible_brands: isomiso2avc1mp41
     LvMetaInfo      : {"data":{"os":"web","product":"dreamina","exportType":"generation","videoId":"0"},"trace_info":{"originItemId":"7556831327778131226"}}
     UserComment     : {"aigc_label_type":0,"source_info":"dreamina"}
     comment         : vid:v02870g10004d3fk4cnog65qngdcfsc0
     encoder         : Lavf58.76.100
   Duration: 00:00:05.02, start: 0.000000, bitrate: 6974 kb/s
   Stream #0:0[0x1](und): Video: h264 (High) (avc1 / 0x31637661), yuv420p(progressive), 960x960 [SAR 1:1 DAR 1:1], 6968 kb/s, 24.12 fps, 60 tbr, 15360 tbn (default)
     Metadata:
       handler_name    : VideoHandler
       vendor_id       : [0][0][0][0]
 Stream mapping:
   Stream #0:0 -> #0:0 (h264 (native) -> png (native))
 [swscaler @ 0x1200350] No accelerated colorspace conversion found from yuv420p to rgb24.
 Output #0, image2, to 'frame_%04d.png':
   Metadata:
     major_brand     : isom
     minor_version   : 512
     compatible_brands: isomiso2avc1mp41
     LvMetaInfo      : {"data":{"os":"web","product":"dreamina","exportType":"generation","videoId":"0"},"trace_info":{"originItemId":"7556831327778131226"}}
     UserComment     : {"aigc_label_type":0,"source_info":"dreamina"}
     comment         : vid:v02870g10004d3fk4cnog65qngdcfsc0
     encoder         : Lavf59.27.100
   Stream #0:0(und): Video: png, rgb24(pc, gbr/unknown/unknown, progressive), 960x960 [SAR 1:1 DAR 1:1], q=2-31, 200 kb/s, 5 fps, 5 tbn (default)
     Metadata:
       handler_name    : VideoHandler
       vendor_id       : [0][0][0][0]
       encoder         : Lavc59.37.100 png
 frame=    1 fps=0.0 q=-0.0 size=N/A time=00:00:00.20 bitrate=N/A speed=3.88x    
 frame=    4 fps=0.0 q=-0.0 size=N/A time=00:00:00.80 bitrate=N/A dup=0 drop=6 speed=1.24x    
 frame=    7 fps=5.7 q=-0.0 size=N/A time=00:00:01.40 bitrate=N/A dup=0 drop=17 speed=1.13x    
 frame=    9 fps=4.8 q=-0.0 size=N/A time=00:00:01.80 bitrate=N/A dup=0 drop=25 speed=0.956x    
 frame=   11 fps=4.4 q=-0.0 size=N/A time=00:00:02.20 bitrate=N/A dup=0 drop=33 speed=0.886x    
 frame=   13 fps=4.2 q=-0.0 size=N/A time=00:00:02.60 bitrate=N/A dup=0 drop=40 speed=0.843x    
 frame=   14 fps=3.9 q=-0.0 size=N/A time=00:00:02.80 bitrate=N/A dup=0 drop=47 speed=0.775x    
 frame=   16 fps=3.8 q=-0.0 size=N/A time=00:00:03.20 bitrate=N/A dup=0 drop=52 speed=0.762x    
 frame=   18 fps=3.8 q=-0.0 size=N/A time=00:00:03.60 bitrate=N/A dup=0 drop=59 speed=0.753x    
 frame=   20 fps=3.7 q=-0.0 size=N/A time=00:00:04.00 bitrate=N/A dup=0 drop=67 speed=0.742x    
 frame=   22 fps=3.7 q=-0.0 size=N/A time=00:00:04.40 bitrate=N/A dup=0 drop=74 speed=0.742x    
 frame=   25 fps=3.9 q=-0.0 size=N/A time=00:00:05.00 bitrate=N/A dup=0 drop=86 speed=0.776x    
 frame=   27 fps=3.9 q=-0.0 Lsize=N/A time=00:00:05.40 bitrate=N/A dup=0 drop=94 speed=0.781x    
 video:13941kB audio:0kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: unknown
 Aborted()

Screenshots

Image Image

Desktop (please complete the following information):

  • OS: [window11]
  • Browser [chrome]
  • Version [141.0.7390.76]

Additional context
When executing the multi-threaded version, the log output gets stuck at

Stream mapping:
   Stream #0:0 -> #0:0 (h264 (native) -> png (native))

And in the browser's network, a request for ffmpeg-core.worker.js is found to be in a pending state all the time.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions