gstreamer-media-SDK
gstreamer-media-SDK copied to clipboard
mfx gstmfxencoder.c:1225:gst_mfx_encoder_encode: MFXVideoCORE_SyncOperation() error status: -17
0:01:04.484216435 6296 000002923214A100 ERROR mfx gstmfxencoder.c:1225:gst_mfx_encoder_encode: MFXVideoCORE_SyncOperation() error status: -12
0:01:04.484330998 6296 000002923214A100 ERROR mfxencode gstmfxenc.c:446:gst_mfxenc_handle_frame: failed to encode frame 1493 (status -3)
it repeatedly be reported over and over again.
What's the platform you are using, and what is the codec format used for encoding?
i use h264enc.
Intel(R) Media Server Studio 2017 - System Analyzer (64-bit)
The following versions of Media SDK API are supported by platform/driver
[opportunistic detection of MSDK API > 1.20]:
Version Target Supported Dec Enc
1.0 HW Yes X X
1.0 SW No
1.1 HW Yes X X
1.1 SW No
1.2 HW Yes X X
1.2 SW No
1.3 HW Yes X X
1.3 SW No
1.4 HW Yes X X
1.4 SW No
1.5 HW Yes X X
1.5 SW No
1.6 HW Yes X X
1.6 SW No
1.7 HW Yes X X
1.7 SW No
1.8 HW Yes X X
1.8 SW No
1.9 HW Yes X X
1.9 SW No
1.10 HW Yes X X
1.10 SW No
1.11 HW Yes X X
1.11 SW No
1.12 HW Yes X X
1.12 SW No
1.13 HW Yes X X
1.13 SW No
1.14 HW Yes X X
1.14 SW No
1.15 HW Yes X X
1.15 SW No
1.16 HW Yes X X
1.16 SW No
1.17 HW Yes X X
1.17 SW No
1.18 HW Yes X X
1.18 SW No
1.19 HW Yes X X
1.19 SW No
1.20 HW No
1.20 SW No
Graphics Devices:
Name Version State
Intel(R) HD Graphics 20.19.15.4531 Active
System info:
CPU: Intel(R) Celeron(R) CPU N3160 @ 1.60GHz
OS: Microsoft Windows 10 Pro
Arch: 64-bit
Installed Media SDK packages (be patient...processing takes some time):
Installed Media SDK DirectShow filters:
Installed Intel Media Foundation Transforms:
Intel(R) Hardware VP8 Sync Decoder MFT : {451E3CB7-2622-4BA5-8E1D-44B3C41D0924}
Intel(R) Hardware VP8 Decoder MFT : {6D856398-834E-4A89-8EE5-071BB3F58BE4}
Intel(R) Quick Sync Video H.264 Encoder MFT : {4BE8D3C0-0515-4A37-AD55-E4BAE19AF471}
Tips:
- SW target does not work: make sure Media SDK DLL (e.g. libmfxsw64.dll)
is located in your executable path or in system path.
Analysis complete... [press ENTER]
Your graphics driver could possibly have issues, can you upgrade to the latest driver? https://downloadcenter.intel.com/download/27267/Graphics-Intel-Graphics-Driver-for-Windows-15-40-?product=91831
i have upgraded the driver and test many times. it still occurs.
[2017-12-12 19:56:27.906] 0:57:59.502124552 8864 0000028A0BA0C740 ERROR mfx gstmfxencoder.c:1225:gst_mfx_encoder_encode: MFXVideoCORE_SyncOperation() error status: -12
[2017-12-12 20:25:11.134] 0:28:28.934378574 2972 0000017C1A49C740 ERROR mfx gstmfxencoder.c:1225:gst_mfx_encoder_encode: MFXVideoCORE_SyncOperation() error status: -12
[2017-12-12 20:28:44.607] 0:02:30.676160535 3092 000002293408C740 ERROR mfx gstmfxencoder.c:1225:gst_mfx_encoder_encode: MFXVideoCORE_SyncOperation() error status: -12
[2017-12-12 20:42:55.520] 0:14:01.516481519 3992 000001C4FEBCC740 ERROR mfx gstmfxencoder.c:1225:gst_mfx_encoder_encode: MFXVideoCORE_SyncOperation() error status: -12
[2017-12-12 21:13:03.448] 0:30:00.854658750 10656 000002B4436EC740 ERROR mfx gstmfxencoder.c:1225:gst_mfx_encoder_encode: MFXVideoCORE_SyncOperation() error status: -12
[2017-12-12 21:40:17.762] 0:26:49.966495504 7860 000002759BFB4740 ERROR mfx gstmfxencoder.c:1225:gst_mfx_encoder_encode: MFXVideoCORE_SyncOperation() error status: -12
[2017-12-12 22:05:52.089] 0:24:55.352145705 11232 0000020F69F2C740 ERROR mfx gstmfxencoder.c:1225:gst_mfx_encoder_encode: MFXVideoCORE_SyncOperation() error status: -12
[2017-12-12 23:20:37.290] 1:14:22.035581367 10656 0000024902B84740 ERROR mfx gstmfxencoder.c:1225:gst_mfx_encoder_encode: MFXVideoCORE_SyncOperation() error status: -12
[2017-12-12 23:24:14.214] 0:02:49.148540078 7428 000002F2537C4740 ERROR mfx gstmfxencoder.c:1225:gst_mfx_encoder_encode: MFXVideoCORE_SyncOperation() error status: -12
Ok, I will need to be able to reproduce this error on my side. Can you provide a simple GStreamer pipeline that invokes this error on your platform? Also, what's the typical duration of your video clips to be encoded before this error occurs? Have you also tested on other platforms such as Haswell / Kabylake for this error?
One more thing you can do is to change the async-depth property value in mfxh264enc to higher or lower, maybe 8 first or 2, since 4 is the default. Then check if you are still getting this error.
gst-launch-1.0 dshowvideosrc ! video/x-raw, format=YUY2, width=640, height=480 ! mfxh264enc rate-control=cbr bitrate=500 gop-size=10 gop-distance=1 preset=veryfast lookahead-ds="off" ! fakesink
I've run the provided the pipeline for over 2 hours (still continuing) with no issues so far. I'm using a Dell Haswell XPS 13 (core i7) with Intel HD 4400 graphics and Intel MSDK 2017 R1.
I used ksvideosrc instead of dshowvideosrc, since it seems dshowvideosrc element doesn't exist in my GStreamer 1.12.3 Windows installation. This could be a particular platform problem, can you try on alternative supported platform and see if you can reproduce that issue?
Still no issues after almost 4 hours, so something's up on your side:
i use this command:
gst-launch-1.0 videotestsrc ! video/x-raw, format=YUY2, width=640, height=480 ! mfxh264enc rate-control=cbr bitrate=500 gop-size=10 gop-distance=1 preset=veryfast lookahead-ds="off" ! fakesink --gst-debug=mfx*:6 2>gst.stderr.log
ran more than 15 hours, and finally reproduce:
15:17:39.996047879 3336 0000000003BD9140 ERROR mfx gstmfxencoder.c:1225:gst_mfx_encoder_encode: MFXVideoCORE_SyncOperation() error status: -12
this is grep -5 "MFXVideoCORE_SyncOperation" gst.stderr.log
:
15:17:37.964585152 3336 0000000003BD9140 DEBUG mfxencode gstmfxenc.c:224:gst_mfxenc_push_frame: output:84:40:16.030277777, size:2503
15:17:37.970836224 3336 0000000003BD9140 DEBUG mfxencode gstmfxenc.c:224:gst_mfxenc_push_frame: output:84:40:16.063611111, size:1915
15:17:37.977504589 3336 0000000003BD9140 DEBUG mfxencode gstmfxenc.c:224:gst_mfxenc_push_frame: output:84:40:16.096944444, size:1798
15:17:37.984261277 3336 0000000003BD9140 DEBUG mfxencode gstmfxenc.c:224:gst_mfxenc_push_frame: output:84:40:16.130277777, size:1796
15:17:37.991242611 3336 0000000003BD9140 DEBUG mfxencode gstmfxenc.c:224:gst_mfxenc_push_frame: output:84:40:16.163611111, size:1787
15:17:39.996047879 3336 0000000003BD9140 ERROR mfx gstmfxencoder.c:1225:gst_mfx_encoder_encode: MFXVideoCORE_SyncOperation() error status: -12
15:17:39.996222604 3336 0000000003BD9140 ERROR mfxencode gstmfxenc.c:446:gst_mfxenc_handle_frame: failed to encode frame 9144486 (status -3)
ERROR: from element /GstPipeline:pipeline0/GstVideoTestSrc:videotestsrc0: Internal data stream error.
Additional debug info:
gstbasesrc.c(2939): gst_base_src_loop (): /GstPipeline:pipeline0/GstVideoTestSrc:videotestsrc0:
streaming stopped, reason error (-5)
i wrote a script exec the following command, and got these errors many times.
gst-launch-1.0 videotestsrc ! video/x-raw, format=YUY2, width=640, height=480 ! mfxh264enc rate-control=cbr bitrate=500 gop-size=10 gop-distance=1 preset=veryfast lookahead-ds="off" ! fakesink --gst-debug=mfx*:6 2>>c:/tmp/auto.gstmfx.stderr.log
0:09:51.012541185 22364 00000000028EF1C0 ERROR mfx gstmfxencoder.c:1225:gst_mfx_encoder_encode: MFXVideoCORE_SyncOperation() error status: -12
0:02:47.803854455 21384 00000000029411C0 ERROR mfx gstmfxencoder.c:1225:gst_mfx_encoder_encode: MFXVideoCORE_SyncOperation() error status: -12
0:13:04.120588665 22176 00000000028EF1C0 ERROR mfx gstmfxencoder.c:1225:gst_mfx_encoder_encode: MFXVideoCORE_SyncOperation() error status: -12
0:40:57.654019451 22224 00000000029111C0 ERROR mfx gstmfxencoder.c:1225:gst_mfx_encoder_encode: MFXVideoCORE_SyncOperation() error status: -12
0:15:17.588704165 18580 00000000028EF1C0 ERROR mfx gstmfxencoder.c:1225:gst_mfx_encoder_encode: MFXVideoCORE_SyncOperation() error status: -12
0:00:21.449044835 21608 0000000002AFD1C0 ERROR mfx gstmfxencoder.c:1225:gst_mfx_encoder_encode: MFXVideoCORE_SyncOperation() error status: -12
0:20:54.476634802 22756 00000000029031C0 ERROR mfx gstmfxencoder.c:1225:gst_mfx_encoder_encode: MFXVideoCORE_SyncOperation() error status: -12
0:01:42.749587827 22712 0000000002AFD1C0 ERROR mfx gstmfxencoder.c:1225:gst_mfx_encoder_encode: MFXVideoCORE_SyncOperation() error status: -12
0:09:08.895183980 22420 000000000291F1C0 ERROR mfx gstmfxencoder.c:1225:gst_mfx_encoder_encode: MFXVideoCORE_SyncOperation() error status: -12
0:05:06.523735769 24188 00000000029111C0 ERROR mfx gstmfxencoder.c:1225:gst_mfx_encoder_encode: MFXVideoCORE_SyncOperation() error status: -12
0:10:24.496043398 23872 00000000028EF1C0 ERROR mfx gstmfxencoder.c:1225:gst_mfx_encoder_encode: MFXVideoCORE_SyncOperation() error status: -12
0:46:01.181149885 22544 0000000002AFD1C0 ERROR mfx gstmfxencoder.c:1225:gst_mfx_encoder_encode: MFXVideoCORE_SyncOperation() error status: -12
0:14:27.232558825 25424 000000000291F1C0 ERROR mfx gstmfxencoder.c:1225:gst_mfx_encoder_encode: MFXVideoCORE_SyncOperation() error status: -12
0:35:50.093314866 21868 00000000029111C0 ERROR mfx gstmfxencoder.c:1225:gst_mfx_encoder_encode: MFXVideoCORE_SyncOperation() error status: -12
0:01:23.017000842 24140 0000000002B331C0 ERROR mfx gstmfxencoder.c:1225:gst_mfx_encoder_encode: MFXVideoCORE_SyncOperation() error status: -12
0:09:52.273061188 24912 000000000272D1C0 ERROR mfx gstmfxencoder.c:1225:gst_mfx_encoder_encode: MFXVideoCORE_SyncOperation() error status: -12
0:00:24.626790455 24640 000000000291F1C0 ERROR mfx gstmfxencoder.c:1225:gst_mfx_encoder_encode: MFXVideoCORE_SyncOperation() error status: -12
0:00:25.067207825 24300 00000000029111C0 ERROR mfx gstmfxencoder.c:1225:gst_mfx_encoder_encode: MFXVideoCORE_SyncOperation() error status: -12
0:12:38.253089375 23660 000000000291F1C0 ERROR mfx gstmfxencoder.c:1225:gst_mfx_encoder_encode: MFXVideoCORE_SyncOperation() error status: -12
0:36:37.818156974 25476 00000000029411C0 ERROR mfx gstmfxencoder.c:1225:gst_mfx_encoder_encode: MFXVideoCORE_SyncOperation() error status: -12
0:01:56.920402675 23864 00000000028EF1C0 ERROR mfx gstmfxencoder.c:1225:gst_mfx_encoder_encode: MFXVideoCORE_SyncOperation() error status: -12
0:33:36.716151280 22956 00000000029411C0 ERROR mfx gstmfxencoder.c:1225:gst_mfx_encoder_encode: MFXVideoCORE_SyncOperation() error status: -12
I am a bit busy these days, but I'll look into it further. But so far, I haven't been reproduce it, and we even do weeks-long encodes without any issues with the MFX plugins. This could be an MSDK Windows issue itself with the Braswell platform, you could try reproducing your issue on another platform such as Kabylake / Haswell to confirm the problem.
@hxl-dy , does this issue still exist? If not, please close this issue.
it still exists. test command:
gst-launch-1.0 videotestsrc ! mfxh264enc ! fakesink -v --gst-debug=mfx*:6 2>simple.gst.stderr.log
stdout:
Setting pipeline to PAUSED ...
Pipeline is PREROLLING ...
Got context from element 'mfxench264-0': gst.mfx.Aggregator=context, gst.mfx.Aggregator=(GstMfxTaskAggregator)"\(GstMfxTaskAggregator\)\ mfxtaskaggregator0";
/GstPipeline:pipeline0/GstVideoTestSrc:videotestsrc0.GstPad:src: caps = video/x-raw, format=(string)NV12, width=(int)320, height=(int)240, framerate=(fraction)30/1, multiview-mode=(string)mono, pixel-aspect-ratio=(fraction)1/1, interlace-mode=(string)progressive
/GstPipeline:pipeline0/GstMfxEncH264:mfxench264-0.GstPad:sink: caps = video/x-raw, format=(string)NV12, width=(int)320, height=(int)240, framerate=(fraction)30/1, multiview-mode=(string)mono, pixel-aspect-ratio=(fraction)1/1, interlace-mode=(string)progressive
/GstPipeline:pipeline0/GstMfxEncH264:mfxench264-0.GstPad:src: caps = video/x-h264, stream-format=(string)byte-stream, alignment=(string)au, profile=(string)high, width=(int)320, height=(int)240, pixel-aspect-ratio=(fraction)1/1, framerate=(fraction)30/1, interlace-mode=(string)progressive, colorimetry=(string)bt601, chroma-site=(string)jpeg, multiview-mode=(string)mono, multiview-flags=(GstVideoMultiviewFlagsSet)0:ffffffff:/right-view-first/left-flipped/left-flopped/right-flipped/right-flopped/half-aspect/mixed-mono
/GstPipeline:pipeline0/GstFakeSink:fakesink0.GstPad:sink: caps = video/x-h264, stream-format=(string)byte-stream, alignment=(string)au, profile=(string)high, width=(int)320, height=(int)240, pixel-aspect-ratio=(fraction)1/1, framerate=(fraction)30/1, interlace-mode=(string)progressive, colorimetry=(string)bt601, chroma-site=(string)jpeg, multiview-mode=(string)mono, multiview-flags=(GstVideoMultiviewFlagsSet)0:ffffffff:/right-view-first/left-flipped/left-flopped/right-flipped/right-flopped/half-aspect/mixed-mono
Pipeline is PREROLLED ...
Setting pipeline to PLAYING ...
New clock: GstSystemClock
Execution ended after 0:07:48.108809033
Setting pipeline to PAUSED ...
Setting pipeline to READY ...
Setting pipeline to NULL ...
Freeing pipeline ...
grep -5 "MFXVideoCORE_SyncOperation" simple.gst.stderr.log:
0:07:46.696058058 9384 0000000005165280 DEBUG mfxencode gstmfxenc.c:224:gst_mfxenc_push_frame: output:1:37:13.166600000, size:3406
0:07:46.698708378 9384 0000000005165280 DEBUG mfxencode gstmfxenc.c:224:gst_mfxenc_push_frame: output:1:37:13.099933333, size:3201
0:07:46.701282535 9384 0000000005165280 DEBUG mfxencode gstmfxenc.c:224:gst_mfxenc_push_frame: output:1:37:13.066600000, size:3155
0:07:46.703816371 9384 0000000005165280 DEBUG mfxencode gstmfxenc.c:224:gst_mfxenc_push_frame: output:1:37:13.133266666, size:3170
0:07:46.706366208 9384 0000000005165280 DEBUG mfxencode gstmfxenc.c:224:gst_mfxenc_push_frame: output:1:37:13.299933333, size:3435
0:07:48.710061039 9384 0000000005165280 ERROR mfx gstmfxencoder.c:1358:gst_mfx_encoder_encode: MFXVideoCORE_SyncOperation() error status: -17
0:07:48.710316407 9384 0000000005165280 ERROR mfxencode gstmfxenc.c:446:gst_mfxenc_handle_frame: failed to encode frame 175001 (status -3)
ERROR: from element /GstPipeline:pipeline0/GstVideoTestSrc:videotestsrc0: Internal data stream error.
Additional debug info:
gstbasesrc.c(2939): gst_base_src_loop (): /GstPipeline:pipeline0/GstVideoTestSrc:videotestsrc0:
streaming stopped, reason error (-5)
Thanks for the report. Does this issue also exist for your other test platforms, or it happens only for Braswell so far?
Oh, I make a mistake that the error status is change to '-17' from '-12'. So far, Baytrail and Braswell both runs with this issue. And Baytrail occurs more easily.
Did you make sure that the plugins were built in the target platform itself? Can you try to build the plugins in the Baytrail / Braswell platform and check if the issue still occurs. There can be possible linkage issues.
I've compiled mfx on Baytrail, and executed the command with it. Same error occurs.
@hxl-dy , can you try the following pre-compiled gst-mfx libraries as attached? Depending on your platform, just unzip the .dll and corresponding .lib file to your GStreamer 1.14 Windows installation (normally %GSTREAMER_1_0_ROOT_X86_64%lib\gstreamer-1.0 for the 64-bit installation or %GSTREAMER_1_0_ROOT_X86%lib\gstreamer-1.0 for the 32-bit installation). gst_mfx_win32_1.14.zip gst_mfx_x64_1.14.zip
They were actually built from the Visual Studio project in this branch: https://github.com/ishmael1985/gstreamer-media-SDK/tree/windows
But I made a few minor changes to the source code for this issue.
@hxl-dy , any update, did the binaries work for you? Or do you need a 1.12 version?
hey @ishmael1985 could you put those binaries into the "Releases" section? :)
@half2me , sure, I already had planned to create 32 and 64-bit installers for both GStreamer 1.12 and 1.14 versions. They worked for you I assume :) Just want to confirm with @hxl-dy that this issue is fixed before I start packaging the binaries.
sorry for the late response. this issue still occurs on Braswell with Gstreamer-1.14.0.1. and haven't verify it on Baytrail.
How long do you normally have to wait until this error pops out?
about 40min
0:40:26.879577841 6380 00000000050F7540 DEBUG mfxencode gst\mfx\gstmfxenc.c:224:gst_mfxenc_push_frame: output:7:53:40.366377777, size:4384
0:40:26.882329938 6380 00000000050F7540 DEBUG mfxencode gst\mfx\gstmfxenc.c:224:gst_mfxenc_push_frame: output:7:53:40.499711111, size:3437
0:40:26.885104436 6380 00000000050F7540 DEBUG mfxencode gst\mfx\gstmfxenc.c:224:gst_mfxenc_push_frame: output:7:53:40.433044444, size:3201
0:40:26.888454314 6380 00000000050F7540 DEBUG mfxencode gst\mfx\gstmfxenc.c:224:gst_mfxenc_push_frame: output:7:53:40.399711111, size:3184
0:40:26.891898915 6380 00000000050F7540 DEBUG mfxencode gst\mfx\gstmfxenc.c:224:gst_mfxenc_push_frame: output:7:53:40.466377777, size:3173
0:40:28.895716009 6380 00000000050F7540 ERROR mfx gst-libs\mfx\gstmfxencoder.c:1355:gst_mfx_encoder_encode: MFXVideoCORE_SyncOperation() error status: -17
0:40:28.895984179 6380 00000000050F7540 ERROR mfxencode gst\mfx\gstmfxenc.c:446:gst_mfxenc_handle_frame: failed to encode frame 852620 (status -3)
ERROR: from element /GstPipeline:pipeline0/GstVideoTestSrc:videotestsrc0: Internal data stream error.
Additional debug info:
gstbasesrc.c(3055): gst_base_src_loop (): /GstPipeline:pipeline0/GstVideoTestSrc:videotestsrc0:
streaming stopped, reason error (-5)
Does this issue also happen for your Kabylake system? I have tried reproducing the issue on my Haswell and Kabylake Windows systems but no luck.
for kabylake, never happen.
Considering the intermittent nature of this error, I strongly believe this is purely an MSDK issue. Even FFMPEG QSV reports the same problems for encode:
https://trac.ffmpeg.org/ticket/5708
The only way to get around it is to restart the MFX encode session when this happens, but this really isn't an ideal solution.
@hxl-dy , can you try these new pre-compiled binaries? The changes involve resetting the encoder if MFX_ERR_DEVICE_FAILED or MFX_ERR_DEVICE_LOST error status occurs, then resume the encoding process.
You can also compile with the fix from my development branch: https://github.com/ishmael1985/gstreamer-media-SDK/tree/development