Skip to content
This repository has been archived by the owner on Apr 13, 2023. It is now read-only.

when trying to record mp4 H264 i got this : System.IO.IOException: Pipe is broken !! #330

Open
adamtigerking opened this issue Nov 25, 2018 · 8 comments

Comments

@adamtigerking
Copy link

adamtigerking commented Nov 25, 2018

its happen everytime i hit record , the software wait like a 2 seconds then pop this error to me and stop recording :

System.IO.IOException: Pipe is broken.
at System.IO.Pipes.PipeStream.WinIOError(Int32 errorCode)
at System.IO.Pipes.PipeStream.BeginWriteCore(Byte[] buffer, Int32 offset, Int32 count, AsyncCallback callback, Object state)
at System.IO.Pipes.PipeStream.BeginWrite(Byte[] buffer, Int32 offset, Int32 count, AsyncCallback callback, Object state)
at System.IO.Stream.<>c.b__53_0(Stream stream, ReadWriteParameters args, AsyncCallback callback, Object state)
at System.Threading.Tasks.TaskFactory1.FromAsyncTrim[TInstance,TArgs](TInstance thisRef, TArgs args, Func5 beginMethod, Func`3 endMethod)
at System.IO.Stream.BeginEndWriteAsync(Byte[] buffer, Int32 offset, Int32 count)
at System.IO.Stream.WriteAsync(Byte[] buffer, Int32 offset, Int32 count, CancellationToken cancellationToken)
at System.IO.Stream.WriteAsync(Byte[] buffer, Int32 offset, Int32 count)
at Captura.Models.FFmpegWriter.WriteFrame(IBitmapFrame Frame)
at Captura.Models.WithPreviewWriter.WriteFrame(IBitmapFrame Image)
at Screna.Recorder.DoWrite()

@MathewSachin
Copy link
Owner

Please provide data from FFmpeg Log. Can be opened from Settings / FFmpeg

@adamtigerking
Copy link
Author

adamtigerking commented Nov 25, 2018

" Please provide data from FFmpeg Log. Can be opened from Settings / FFmpeg "

ffmpeg version N-92511-g0279cb4f69 Copyright (c) 2000-2018 the FFmpeg developers
built with gcc 8.2.1 (GCC) 20181017
configuration: --enable-gpl --enable-version3 --enable-sdl2 --enable-fontconfig --enable-gnutls --enable-iconv --enable-libass --enable-libbluray --enable-libfreetype --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-libopus --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libtheora --enable-libtwolame --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxml2 --enable-libzimg --enable-lzma --enable-zlib --enable-gmp --enable-libvidstab --enable-libvorbis --enable-libvo-amrwbenc --enable-libmysofa --enable-libspeex --enable-libxvid --enable-libaom --enable-libmfx --enable-amf --enable-ffnvcodec --enable-cuvid --enable-d3d11va --enable-nvenc --enable-nvdec --enable-dxva2 --enable-avisynth
libavutil 56. 23.101 / 56. 23.101
libavcodec 58. 40.100 / 58. 40.100
libavformat 58. 22.100 / 58. 22.100
libavdevice 58. 6.100 / 58. 6.100
libavfilter 7. 46.100 / 7. 46.100
libswscale 5. 4.100 / 5. 4.100
libswresample 3. 4.100 / 3. 4.100
libpostproc 55. 4.100 / 55. 4.100
Input #0, rawvideo, from '\.\pipe\captura-7cfe56dc-d6a5-4ae0-9860-940bfc9470b6':
Duration: N/A, start: 0.000000, bitrate: 260928 kb/s
Stream #0:0: Video: rawvideo (BGRA / 0x41524742), bgra, 450x604, 260928 kb/s, 30 tbr, 30 tbn, 30 tbc
Guessed Channel Layout for Input Stream #1.0 : stereo
Input #1, s16le, from '\.\pipe\captura-3b8f77df-36ef-4818-8d2c-ca9cb98c3d15':
Duration: N/A, bitrate: 1411 kb/s
Stream #1:0: Audio: pcm_s16le, 44100 Hz, stereo, s16, 1411 kb/s
Stream mapping:
Stream #0:0 -> #0:0 (rawvideo (native) -> h264 (h264_nvenc))
Stream #1:0 -> #0:1 (pcm_s16le (native) -> aac (native))
Press [q] to stop, [?] for help
[h264_nvenc @ 008363c0] Cannot load nvcuda.dll
Error initializing output stream 0:0 -- Error while opening encoder for output stream #0:0 - maybe incorrect parameters such as bit_rate, rate, width or height
Conversion failed!

@MathewSachin
Copy link
Owner

MathewSachin commented Nov 25, 2018

Seems like NVENC is not supported on your system.
Do you have an NVIDIA graphic card? If not, use the x264 mp4 encoder.
If yes, please provide its model number so i can check if it supports NVENC.

@adamtigerking
Copy link
Author

i have ATI radeon HD 4350 video Card , so the H264 only work with NVIDIA cards ?

@adamtigerking adamtigerking changed the title when trying to record mp4 H264/x264 i got this : System.IO.IOException: Pipe is broken !! when trying to record mp4 H264 i got this : System.IO.IOException: Pipe is broken !! Nov 25, 2018
@MathewSachin
Copy link
Owner

No, use the first encoder in the list using x264 encoding. It is H.264.

@adamtigerking
Copy link
Author

adamtigerking commented Nov 25, 2018

- yet another error when using x264 :

System.IO.IOException: Insufficient system resources exist to complete the requested service.

at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)
at System.IO.Pipes.PipeStream.WinIOError(Int32 errorCode)
at System.IO.Pipes.PipeStream.BeginWriteCore(Byte[] buffer, Int32 offset, Int32 count, AsyncCallback callback, Object state)
at System.IO.Pipes.PipeStream.BeginWrite(Byte[] buffer, Int32 offset, Int32 count, AsyncCallback callback, Object state)
at System.IO.Stream.<>c.b__53_0(Stream stream, ReadWriteParameters args, AsyncCallback callback, Object state)
at System.Threading.Tasks.TaskFactory1.FromAsyncTrim[TInstance,TArgs](TInstance thisRef, TArgs args, Func5 beginMethod, Func`3 endMethod)
at System.IO.Stream.BeginEndWriteAsync(Byte[] buffer, Int32 offset, Int32 count)
at System.IO.Stream.WriteAsync(Byte[] buffer, Int32 offset, Int32 count, CancellationToken cancellationToken)
at System.IO.Stream.WriteAsync(Byte[] buffer, Int32 offset, Int32 count)
at Captura.Models.FFmpegWriter.WriteFrame(IBitmapFrame Frame)
at Captura.Models.WithPreviewWriter.WriteFrame(IBitmapFrame Image)
at Screna.Recorder.DoWrite()

---------------- ffmpeg log : -------------------------------------------------------------

ffmpeg version N-92511-g0279cb4f69 Copyright (c) 2000-2018 the FFmpeg developers
built with gcc 8.2.1 (GCC) 20181017
configuration: --enable-gpl --enable-version3 --enable-sdl2 --enable-fontconfig --enable-gnutls --enable-iconv --enable-libass --enable-libbluray --enable-libfreetype --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-libopus --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libtheora --enable-libtwolame --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxml2 --enable-libzimg --enable-lzma --enable-zlib --enable-gmp --enable-libvidstab --enable-libvorbis --enable-libvo-amrwbenc --enable-libmysofa --enable-libspeex --enable-libxvid --enable-libaom --enable-libmfx --enable-amf --enable-ffnvcodec --enable-cuvid --enable-d3d11va --enable-nvenc --enable-nvdec --enable-dxva2 --enable-avisynth
libavutil 56. 23.101 / 56. 23.101
libavcodec 58. 40.100 / 58. 40.100
libavformat 58. 22.100 / 58. 22.100
libavdevice 58. 6.100 / 58. 6.100
libavfilter 7. 46.100 / 7. 46.100
libswscale 5. 4.100 / 5. 4.100
libswresample 3. 4.100 / 3. 4.100
libpostproc 55. 4.100 / 55. 4.100
Input #0, rawvideo, from '\.\pipe\captura-7beb825a-8791-48a4-86b7-6854abd91889':
Duration: N/A, start: 0.000000, bitrate: 728851 kb/s
Stream #0:0: Video: rawvideo (BGRA / 0x41524742), bgra, 1190x638, 728851 kb/s, 30 tbr, 30 tbn, 30 tbc
Guessed Channel Layout for Input Stream #1.0 : stereo
Input #1, s16le, from '\.\pipe\captura-073028ab-0abe-4e97-83f5-d3a1cc7ea84e':
Duration: N/A, bitrate: 1411 kb/s
Stream #1:0: Audio: pcm_s16le, 44100 Hz, stereo, s16, 1411 kb/s
Stream mapping:
Stream #0:0 -> #0:0 (rawvideo (native) -> h264 (libx264))
Stream #1:0 -> #0:1 (pcm_s16le (native) -> aac (native))
Press [q] to stop, [?] for help
[swscaler @ 03e21c80] Warning: data is not aligned! This can lead to a speed loss
[libx264 @ 03dc6100] using cpu capabilities: MMX2 SSE2 SSE3 Cache64
[libx264 @ 03dc6100] profile High 4:4:4 Predictive, level 3.1, 4:2:0, 8-bit
[libx264 @ 03dc6100] 264 - core 157 r2935 545de2f - H.264/MPEG-4 AVC codec - Copyleft 2003-2018 - http://www.videolan.org/x264.html - options: cabac=0 ref=1 deblock=0:0:0 analyse=0:0 me=dia subme=0 psy=0 mixed_ref=0 me_range=16 chroma_me=1 trellis=0 8x8dct=0 cqm=0 deadzone=21,11 fast_pskip=0 chroma_qp_offset=0 threads=3 lookahead_threads=1 sliced_threads=0 nr=0 decimate=1 interlaced=0 bluray_compat=0 constrained_intra=0 bframes=0 weightp=0 keyint=250 keyint_min=25 scenecut=0 intra_refresh=0 rc=cqp mbtree=0 qp=0
Output #0, mp4, to 'C:\Captura record\2018-11-25-10-57-00.mp4':
Metadata:
encoder : Lavf58.22.100
Stream #0:0: Video: h264 (libx264) (avc1 / 0x31637661), yuv420p(progressive), 1190x638, q=-1--1, 30 fps, 15360 tbn, 30 tbc
Metadata:
encoder : Lavc58.40.100 libx264
Side data:
cpb: bitrate max/min/avg: 0/0/0 buffer size: 0 vbv_delay: -1
Stream #0:1: Audio: aac (LC) (mp4a / 0x6134706D), 44100 Hz, stereo, fltp, 256 kb/s
Metadata:
encoder : Lavc58.40.100 aac
frame= 5 fps=0.0 q=0.0 size= 0kB time=00:00:00.00 bitrate=5907.7kbits/s speed=0.000106x
frame= 8 fps=5.8 q=0.0 size= 256kB time=00:00:00.11 bitrate=18066.6kbits/s speed=0.0841x
frame= 9 fps=4.7 q=0.0 size= 256kB time=00:00:00.16 bitrate=12904.7kbits/s speed=0.085x
frame= 13 fps=5.3 q=0.0 size= 256kB time=00:00:00.30 bitrate=6948.7kbits/s speed=0.123x
frame= 20 fps=6.7 q=0.0 size= 256kB time=00:00:00.53 bitrate=3927.5kbits/s speed=0.18x
frame= 27 fps=7.7 q=0.0 size= 256kB time=00:00:00.76 bitrate=2737.4kbits/s speed=0.219x
frame= 33 fps=8.3 q=0.0 size= 256kB time=00:00:00.97 bitrate=2150.8kbits/s speed=0.244x
frame= 40 fps=8.9 q=0.0 size= 256kB time=00:00:01.18 bitrate=1771.2kbits/s speed=0.262x
frame= 47 fps=9.4 q=0.0 size= 256kB time=00:00:01.43 bitrate=1457.0kbits/s speed=0.287x
frame= 59 fps= 10 q=0.0 size= 256kB time=00:00:01.83 bitrate=1143.5kbits/s speed=0.315x
frame= 66 fps= 10 q=0.0 size= 256kB time=00:00:02.06 bitrate=1015.0kbits/s speed=0.325x
frame= 74 fps= 11 q=0.0 size= 256kB time=00:00:02.30 bitrate= 911.9kbits/s speed=0.335x
frame= 80 fps= 11 q=0.0 size= 256kB time=00:00:02.53 bitrate= 828.7kbits/s speed=0.341x
frame= 87 fps= 11 q=0.0 size= 256kB time=00:00:02.76 bitrate= 759.1kbits/s speed=0.348x
frame= 92 fps= 11 q=0.0 size= 256kB time=00:00:02.92 bitrate= 716.9kbits/s speed=0.346x
frame= 98 fps= 11 q=0.0 size= 256kB time=00:00:03.13 bitrate= 669.1kbits/s speed=0.349x
frame= 105 fps= 11 q=0.0 size= 256kB time=00:00:03.36 bitrate= 623.0kbits/s speed=0.354x
frame= 112 fps= 11 q=0.0 size= 256kB time=00:00:03.59 bitrate= 582.8kbits/s speed=0.357x
frame= 118 fps= 11 q=0.0 size= 256kB time=00:00:03.78 bitrate= 554.2kbits/s speed=0.358x
frame= 125 fps= 11 q=0.0 size= 256kB time=00:00:04.01 bitrate= 522.2kbits/s speed=0.362x
frame= 130 fps= 11 q=0.0 size= 256kB time=00:00:04.20 bitrate= 499.1kbits/s speed=0.358x
frame= 134 fps= 11 q=0.0 size= 256kB time=00:00:04.31 bitrate= 485.7kbits/s speed=0.351x
frame= 151 fps= 12 q=0.0 size= 256kB time=00:00:04.89 bitrate= 428.1kbits/s speed=0.378x
frame= 152 fps= 11 q=0.0 size= 256kB time=00:00:04.94 bitrate= 424.1kbits/s speed=0.366x
frame= 164 fps= 11 q=0.0 size= 256kB time=00:00:05.31 bitrate= 394.5kbits/s speed=0.366x
frame= 182 fps= 12 q=0.0 size= 512kB time=00:00:05.90 bitrate= 711.0kbits/s speed=0.392x
frame= 195 fps= 13 q=0.0 size= 512kB time=00:00:06.36 bitrate= 659.3kbits/s speed=0.409x
frame= 213 fps= 13 q=0.0 size= 512kB time=00:00:06.96 bitrate= 602.2kbits/s speed=0.433x
frame= 231 fps= 14 q=0.0 size= 512kB time=00:00:07.54 bitrate= 555.8kbits/s speed=0.455x
frame= 250 fps= 15 q=0.0 size= 512kB time=00:00:08.17 bitrate= 513.2kbits/s speed=0.478x
frame= 265 fps= 15 q=0.0 size= 768kB time=00:00:08.66 bitrate= 726.0kbits/s speed=0.493x
frame= 282 fps= 16 q=0.0 size= 768kB time=00:00:09.26 bitrate= 679.1kbits/s speed=0.512x
frame= 298 fps= 16 q=0.0 size= 768kB time=00:00:09.79 bitrate= 642.1kbits/s speed=0.527x
frame= 315 fps= 16 q=0.0 size= 768kB time=00:00:10.35 bitrate= 607.5kbits/s speed=0.542x
frame= 332 fps= 17 q=0.0 size= 768kB time=00:00:10.91 bitrate= 576.5kbits/s speed=0.556x
frame= 349 fps= 17 q=0.0 size= 1024kB time=00:00:11.49 bitrate= 729.9kbits/s speed=0.571x
frame= 367 fps= 18 q=0.0 size= 1024kB time=00:00:12.07 bitrate= 694.8kbits/s speed=0.585x
frame= 383 fps= 18 q=0.0 size= 1024kB time=00:00:12.63 bitrate= 664.1kbits/s speed=0.598x
frame= 401 fps= 19 q=0.0 size= 1024kB time=00:00:13.23 bitrate= 633.8kbits/s speed=0.612x
frame= 416 fps= 19 q=0.0 size= 1024kB time=00:00:14.25 bitrate= 588.4kbits/s speed=0.644x
frame= 416 fps= 19 q=-1.0 Lsize= 1154kB time=00:00:14.79 bitrate= 639.2kbits/s speed=0.661x
video:681kB audio:460kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 1.135399%
[libx264 @ 03dc6100] frame I:2 Avg QP: 0.00 size:343243
[libx264 @ 03dc6100] frame P:414 Avg QP: 0.00 size: 26
[libx264 @ 03dc6100] mb I I16..4: 100.0% 0.0% 0.0%
[libx264 @ 03dc6100] mb P I16..4: 0.2% 0.0% 0.0% P16..4: 0.0% 0.0% 0.0% 0.0% 0.0% skip:99.8%
[libx264 @ 03dc6100] coded y,uvDC,uvAC intra: 74.2% 73.2% 73.2% inter: 0.0% 0.0% 0.0%
[libx264 @ 03dc6100] i16 v,h,dc,p: 67% 33% 0% 0%
[libx264 @ 03dc6100] i8c dc,h,v,p: 22% 27% 51% 1%
[libx264 @ 03dc6100] kb/s:402.26
[aac @ 03dc7bc0] Qavg: 191.943

@MathewSachin
Copy link
Owner

MathewSachin commented Nov 25, 2018

Please provide your system specifications: CPU & RAM.

It seems to me that Captura is unable to capture at the specified fps on your system.

@MathewSachin
Copy link
Owner

Please try using the MF writer in latest Beta release. It is a hardware based H.264 encoder and performs better than when using with FFmpeg.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants