"/bin/sh: 1: ldconfig: not found" "broken pipe"

Converting source frames into swapped frames
Forum rules
Read the FAQs and search the forum before posting a new topic.

Please mark any answers that fixed your problems so others can find the solutions.
Post Reply
User avatar
sethcoast
Posts: 4
Joined: Mon Oct 14, 2019 5:37 pm
Has thanked: 2 times

"/bin/sh: 1: ldconfig: not found" "broken pipe"

Post by sethcoast » Thu Mar 05, 2020 5:55 am

I'm getting an extremely strange error when running convert on my video. After about 2% conversion the program will crash with:

/bin/sh: 1: ldconfig: not found
# The number of iterations. Set to 0 to loop indefinitely.
03/05/2020 05:04:06 ERROR Got Exception on main handler:
Traceback (most recent call last):
File "/home/sethd63/faceswap/venv/lib/python3.7/site-packages/imageio_ffmpeg/_io.py", line 479, in write_frames
p.stdin.write(bb)
BrokenPipeError: [Errno 32] Broken pipe

It's incredibly nondescript, and I cannot figure out why this is happening. Here is the crash log:

Code: Select all

03/05/2020 05:41:21 MainProcess     _predict_faces_0 _base           largest_face_index        DEBUG    0
03/05/2020 05:41:21 MainProcess     _predict_faces_0 _base           largest_face_index        DEBUG    0
03/05/2020 05:41:21 MainProcess     _predict_faces_0 _base           largest_face_index        DEBUG    0
03/05/2020 05:41:22 MainProcess     _predict_faces_0 _base           largest_face_index        DEBUG    0
03/05/2020 05:41:22 MainProcess     MainThread      multithreading  completed                 DEBUG    False
03/05/2020 05:41:22 MainProcess     _predict_faces_0 _base           largest_face_index        DEBUG    0
03/05/2020 05:41:23 MainProcess     _predict_faces_0 _base           largest_face_index        DEBUG    0
03/05/2020 05:41:23 MainProcess     _predict_faces_0 _base           largest_face_index        DEBUG    0
03/05/2020 05:41:23 MainProcess     MainThread      multithreading  completed                 DEBUG    False
03/05/2020 05:41:23 MainProcess     _predict_faces_0 _base           largest_face_index        DEBUG    0
03/05/2020 05:41:24 MainProcess     _predict_faces_0 _base           largest_face_index        DEBUG    0
03/05/2020 05:41:24 MainProcess     _predict_faces_0 _base           largest_face_index        DEBUG    0
03/05/2020 05:41:24 MainProcess     MainThread      multithreading  completed                 DEBUG    False
03/05/2020 05:41:25 MainProcess     _predict_faces_0 _base           largest_face_index        DEBUG    0
03/05/2020 05:41:25 MainProcess     MainThread      multithreading  completed                 DEBUG    False
03/05/2020 05:41:26 MainProcess     _predict_faces_0 _base           largest_face_index        DEBUG    0
03/05/2020 05:41:26 MainProcess     MainThread      multithreading  completed                 DEBUG    False
03/05/2020 05:41:27 MainProcess     _predict_faces_0 _base           largest_face_index        DEBUG    0
03/05/2020 05:41:27 MainProcess     _predict_faces_0 _base           largest_face_index        DEBUG    0
03/05/2020 05:41:27 MainProcess     MainThread      multithreading  completed                 DEBUG    False
03/05/2020 05:41:27 MainProcess     _predict_faces_0 _base           largest_face_index        DEBUG    0
03/05/2020 05:41:28 MainProcess     _predict_faces_0 _base           largest_face_index        DEBUG    0
03/05/2020 05:41:28 MainProcess     MainThread      multithreading  completed                 DEBUG    False
03/05/2020 05:41:28 MainProcess     _predict_faces_0 _base           largest_face_index        DEBUG    0
03/05/2020 05:41:29 MainProcess     _predict_faces_0 _base           largest_face_index        DEBUG    0
03/05/2020 05:41:29 MainProcess     _predict_faces_0 _base           largest_face_index        DEBUG    0
03/05/2020 05:41:29 MainProcess     _predict_faces_0 _base           largest_face_index        DEBUG    0
03/05/2020 05:41:29 MainProcess     MainThread      multithreading  completed                 DEBUG    False
03/05/2020 05:41:30 MainProcess     _predict_faces_0 _base           largest_face_index        DEBUG    0
03/05/2020 05:41:30 MainProcess     _predict_faces_0 _base           largest_face_index        DEBUG    0
03/05/2020 05:41:30 MainProcess     MainThread      multithreading  completed                 DEBUG    False
03/05/2020 05:41:31 MainProcess     _predict_faces_0 _base           largest_face_index        DEBUG    0
03/05/2020 05:41:31 MainProcess     _predict_faces_0 _base           largest_face_index        DEBUG    0
03/05/2020 05:41:31 MainProcess     _predict_faces_0 _base           largest_face_index        DEBUG    0
03/05/2020 05:41:31 MainProcess     MainThread      multithreading  completed                 DEBUG    False
03/05/2020 05:41:32 MainProcess     _predict_faces_0 _base           largest_face_index        DEBUG    0
03/05/2020 05:41:32 MainProcess     _predict_faces_0 _base           largest_face_index        DEBUG    0
03/05/2020 05:41:32 MainProcess     MainThread      multithreading  completed                 DEBUG    False
03/05/2020 05:41:33 MainProcess     _predict_faces_0 _base           largest_face_index        DEBUG    0
03/05/2020 05:41:33 MainProcess     _predict_faces_0 _base           largest_face_index        DEBUG    0
03/05/2020 05:41:33 MainProcess     _predict_faces_0 _base           largest_face_index        DEBUG    0
03/05/2020 05:41:33 MainProcess     MainThread      multithreading  completed                 DEBUG    False
03/05/2020 05:41:34 MainProcess     _predict_faces_0 _base           largest_face_index        DEBUG    0
03/05/2020 05:41:34 MainProcess     _predict_faces_0 _base           largest_face_index        DEBUG    0
03/05/2020 05:41:34 MainProcess     MainThread      multithreading  completed                 DEBUG    False
03/05/2020 05:41:35 MainProcess     MainThread      multithreading  completed                 DEBUG    False
03/05/2020 05:41:36 MainProcess     MainThread      multithreading  completed                 DEBUG    False
03/05/2020 05:41:37 MainProcess     MainThread      multithreading  completed                 DEBUG    False
03/05/2020 05:41:38 MainProcess     MainThread      multithreading  completed                 DEBUG    False
03/05/2020 05:41:39 MainProcess     MainThread      multithreading  completed                 DEBUG    False
03/05/2020 05:41:40 MainProcess     MainThread      multithreading  completed                 DEBUG    False
03/05/2020 05:41:41 MainProcess     MainThread      multithreading  completed                 DEBUG    False
03/05/2020 05:41:42 MainProcess     MainThread      multithreading  completed                 DEBUG    False
03/05/2020 05:41:43 MainProcess     MainThread      multithreading  completed                 DEBUG    False
03/05/2020 05:41:44 MainProcess     MainThread      multithreading  completed                 DEBUG    False
03/05/2020 05:41:45 MainProcess     MainThread      multithreading  completed                 DEBUG    False
03/05/2020 05:41:46 MainProcess     MainThread      multithreading  completed                 DEBUG    False
03/05/2020 05:41:47 MainProcess     MainThread      multithreading  completed                 DEBUG    False
03/05/2020 05:41:48 MainProcess     MainThread      multithreading  completed                 DEBUG    False
03/05/2020 05:41:49 MainProcess     MainThread      multithreading  completed                 DEBUG    False
03/05/2020 05:41:50 MainProcess     MainThread      multithreading  completed                 DEBUG    False
03/05/2020 05:41:51 MainProcess     MainThread      multithreading  completed                 DEBUG    False
03/05/2020 05:41:52 MainProcess     MainThread      multithreading  completed                 DEBUG    False
03/05/2020 05:41:54 MainProcess     MainThread      multithreading  completed                 DEBUG    False
03/05/2020 05:41:55 MainProcess     MainThread      multithreading  completed                 DEBUG    False
03/05/2020 05:41:56 MainProcess     MainThread      multithreading  completed                 DEBUG    False
03/05/2020 05:41:56 MainProcess     _save_0         multithreading  run                       DEBUG    Error in thread (_save_0): [Errno 32] Broken pipe\n\nFFMPEG COMMAND:\n/home/sethd63/faceswap/venv/lib/python3.7/site-packages/imageio_ffmpeg/binaries/ffmpeg-linux64-v4.1 -y -f rawvideo -vcodec rawvideo -s 4096x2160 -pix_fmt rgb24 -r 23.98 -i - -an -vcodec libx264 -pix_fmt yuv420p -crf 25 -v error -vf scale=4096:2160 -c:v libx264 -crf 23 -preset medium /home/sethd63/data/converted/__tmp_Phife_Dawg_Tribute_converted.mov\n\nFFMPEG STDERR OUTPUT:\n
03/05/2020 05:41:57 MainProcess     MainThread      multithreading  check_and_raise_error     DEBUG    Thread error caught: [(<class 'OSError'>, OSError('[Errno 32] Broken pipe\n\nFFMPEG COMMAND:\n/home/sethd63/faceswap/venv/lib/python3.7/site-packages/imageio_ffmpeg/binaries/ffmpeg-linux64-v4.1 -y -f rawvideo -vcodec rawvideo -s 4096x2160 -pix_fmt rgb24 -r 23.98 -i - -an -vcodec libx264 -pix_fmt yuv420p -crf 25 -v error -vf scale=4096:2160 -c:v libx264 -crf 23 -preset medium /home/sethd63/data/converted/__tmp_Phife_Dawg_Tribute_converted.mov\n\nFFMPEG STDERR OUTPUT:\n'), <traceback object at 0x7f387c063aa0>)]
03/05/2020 05:41:59 MainProcess     MainThread      plaidml_tools   initialize                DEBUG    PlaidML already initialized
03/05/2020 05:42:01 MainProcess     MainThread      plaidml_tools   get_supported_devices     DEBUG    [<plaidml._DeviceConfig object at 0x7f387b97f390>]
03/05/2020 05:42:01 MainProcess     MainThread      plaidml_tools   get_all_devices           DEBUG    Experimental Devices: [<plaidml._DeviceConfig object at 0x7f387b94fe50>]
03/05/2020 05:42:01 MainProcess     MainThread      plaidml_tools   get_all_devices           DEBUG    [<plaidml._DeviceConfig object at 0x7f387b94fe50>, <plaidml._DeviceConfig object at 0x7f387b97f390>]
03/05/2020 05:42:01 MainProcess     MainThread      plaidml_tools   __init__                  DEBUG    Initialized: PlaidMLStats
03/05/2020 05:42:01 MainProcess     MainThread      plaidml_tools   supported_indices         DEBUG    [1]
03/05/2020 05:42:01 MainProcess     MainThread      plaidml_tools   supported_indices         DEBUG    [1]
03/05/2020 05:42:06 MainProcess     _predict_faces_0 _base           largest_face_index        DEBUG    0
03/05/2020 05:42:06 MainProcess     _predict_faces_0 _base           largest_face_index        DEBUG    0
03/05/2020 05:42:07 MainProcess     _predict_faces_0 _base           largest_face_index        DEBUG    0
03/05/2020 05:42:07 MainProcess     _predict_faces_0 _base           largest_face_index        DEBUG    0
03/05/2020 05:42:07 MainProcess     _predict_faces_0 _base           largest_face_index        DEBUG    0
03/05/2020 05:42:07 MainProcess     _predict_faces_0 _base           largest_face_index        DEBUG    0
03/05/2020 05:42:07 MainProcess     _predict_faces_0 _base           largest_face_index        DEBUG    0
03/05/2020 05:42:07 MainProcess     _predict_faces_0 _base           largest_face_index        DEBUG    0
03/05/2020 05:42:08 MainProcess     _predict_faces_0 _base           largest_face_index        DEBUG    0
03/05/2020 05:42:08 MainProcess     _predict_faces_0 _base           largest_face_index        DEBUG    0
03/05/2020 05:42:08 MainProcess     _predict_faces_0 _base           largest_face_index        DEBUG    0
03/05/2020 05:42:08 MainProcess     _predict_faces_0 _base           largest_face_index        DEBUG    0
03/05/2020 05:42:08 MainProcess     _predict_faces_0 _base           largest_face_index        DEBUG    0
03/05/2020 05:42:08 MainProcess     _predict_faces_0 _base           largest_face_index        DEBUG    0
03/05/2020 05:42:08 MainProcess     _predict_faces_0 _base           largest_face_index        DEBUG    0
03/05/2020 05:42:08 MainProcess     _predict_faces_0 _base           largest_face_index        DEBUG    0
03/05/2020 05:42:11 MainProcess     _predict_faces_0 _base           largest_face_index        DEBUG    0
03/05/2020 05:42:11 MainProcess     _predict_faces_0 _base           largest_face_index        DEBUG    0
03/05/2020 05:42:11 MainProcess     _predict_faces_0 _base           largest_face_index        DEBUG    0
03/05/2020 05:42:11 MainProcess     _predict_faces_0 _base           largest_face_index        DEBUG    0
03/05/2020 05:42:11 MainProcess     _predict_faces_0 _base           largest_face_index        DEBUG    0
03/05/2020 05:42:11 MainProcess     _predict_faces_0 _base           largest_face_index        DEBUG    0
03/05/2020 05:42:11 MainProcess     _predict_faces_0 _base           largest_face_index        DEBUG    0
03/05/2020 05:42:11 MainProcess     _predict_faces_0 _base           largest_face_index        DEBUG    0
03/05/2020 05:42:11 MainProcess     _predict_faces_0 _base           largest_face_index        DEBUG    0
Traceback (most recent call last):
  File "/home/sethd63/faceswap/venv/lib/python3.7/site-packages/imageio_ffmpeg/_io.py", line 479, in write_frames
    p.stdin.write(bb)
BrokenPipeError: [Errno 32] Broken pipe

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/sethd63/faceswap/lib/cli.py", line 128, in execute_script
    process.process()
  File "/home/sethd63/faceswap/scripts/convert.py", line 157, in process
    self._convert_images()
  File "/home/sethd63/faceswap/scripts/convert.py", line 184, in _convert_images
    self._check_thread_error()
  File "/home/sethd63/faceswap/scripts/convert.py", line 204, in _check_thread_error
    thread.check_and_raise_error()
  File "/home/sethd63/faceswap/lib/multithreading.py", line 84, in check_and_raise_error
    raise error[1].with_traceback(error[2])
  File "/home/sethd63/faceswap/lib/multithreading.py", line 37, in run
    self._target(*self._args, **self._kwargs)
  File "/home/sethd63/faceswap/scripts/convert.py", line 630, in _save
    self._writer.write(filename, image)
  File "/home/sethd63/faceswap/plugins/convert/writer/ffmpeg.py", line 114, in write
    self.save_from_cache()
  File "/home/sethd63/faceswap/plugins/convert/writer/ffmpeg.py", line 135, in save_from_cache
    self.writer.append_data(save_image[:, :, ::-1])
  File "/home/sethd63/faceswap/venv/lib/python3.7/site-packages/imageio/core/format.py", line 492, in append_data
    return self._append_data(im, total_meta)
  File "/home/sethd63/faceswap/venv/lib/python3.7/site-packages/imageio/plugins/ffmpeg.py", line 572, in _append_data
    self._write_gen.send(im)
  File "/home/sethd63/faceswap/venv/lib/python3.7/site-packages/imageio_ffmpeg/_io.py", line 486, in write_frames
    raise IOError(msg)
OSError: [Errno 32] Broken pipe

FFMPEG COMMAND:
/home/sethd63/faceswap/venv/lib/python3.7/site-packages/imageio_ffmpeg/binaries/ffmpeg-linux64-v4.1 -y -f rawvideo -vcodec rawvideo -s 4096x2160 -pix_fmt rgb24 -r 23.98 -i - -an -vcodec libx264 -pix_fmt yuv420p -crf 25 -v error -vf scale=4096:2160 -c:v libx264 -crf 23 -preset medium /home/sethd63/data/converted/__tmp_Phife_Dawg_Tribute_converted.mov

FFMPEG STDERR OUTPUT:


============ System Information ============
encoding:            UTF-8
git_branch:          master
git_commits:         7de2821 Merge branch 'staging'. 6e08c95 bug fix: tools.alignments. Set filename correctly when merging alignments. 726e6cf Merge branch 'staging'. bd72add Update sphinx_requirements.txt. 7100b9e Update sphinx_requirements.txt
gpu_cuda:            10.0
gpu_cudnn:           No global version found
gpu_devices:         GPU_0: NVIDIA Corporation - Tesla P100-PCIE-16GB (experimental), GPU_1: NVIDIA Corporation - Tesla P100-PCIE-16GB (supported)
gpu_devices_active:  GPU_0, GPU_1
gpu_driver:          ['410.104', '410.104']
gpu_vram:            GPU_0: 16280MB, GPU_1: 16280MB
os_machine:          x86_64
os_platform:         Linux-4.9.0-9-amd64-x86_64-with-debian-9.9
os_release:          4.9.0-9-amd64
py_command:          faceswap.py convert -i /home/sethd63/data/raw/jake_smith/Phife_Dawg_Tribute.mov -o /home/sethd63/data/converted -ref /home/sethd63/data/raw/jake_smith/Phife_Dawg_Tribute.mov -m /home/sethd63/models/jake_phife_villain_snapshot_125001_iters -c match-hist -M extended -sc sharpen -w ffmpeg
py_conda_version:    N/A
py_implementation:   CPython
py_version:          3.7.4
py_virtual_env:      True
sys_cores:           8
sys_processor:       
sys_ram:             Total: 30163MB, Available: 3345MB, Used: 25897MB, Free: 3559MB

=============== Pip Packages ===============
absl-py==0.9.0
astor==0.8.1
cffi==1.14.0
cycler==0.10.0
decorator==4.4.1
enum34==1.1.9
fastcluster==1.1.26
ffmpy==0.2.2
gast==0.2.2
google-pasta==0.1.8
grpcio==1.27.2
h5py==2.9.0
imageio==2.6.1
imageio-ffmpeg==0.4.1
joblib==0.14.1
Keras==2.2.4
Keras-Applications==1.0.8
Keras-Preprocessing==1.1.0
kiwisolver==1.1.0
Markdown==3.2.1
matplotlib==3.1.1
networkx==2.4
numpy==1.17.4
nvidia-ml-py3==7.352.1
opencv-python==4.1.2.30
opt-einsum==3.1.0
pathlib==1.0.1
Pillow==6.2.1
plaidml==0.6.4
plaidml-keras==0.6.4
protobuf==3.11.3
psutil==5.7.0
pycparser==2.19
pyparsing==2.4.6
python-dateutil==2.8.1
PyWavelets==1.1.1
PyYAML==5.3
scikit-image==0.16.2
scikit-learn==0.22.1
scipy==1.4.1
six==1.14.0
tensorboard==1.15.0
tensorflow==1.15.0
tensorflow-estimator==1.15.1
termcolor==1.1.0
toposort==1.5
tqdm==4.43.0
Werkzeug==1.0.0
wrapt==1.12.0

================= Configs ==================
--------- extract.ini ---------

[global]
allow_growth:             False

[detect.cv2_dnn]
confidence:               50

[detect.s3fd]
confidence:               70
batch-size:               4

[detect.mtcnn]
minsize:                  20
threshold_1:              0.6
threshold_2:              0.7
threshold_3:              0.7
scalefactor:              0.709
batch-size:               8

[align.fan]
batch-size:               12

[mask.vgg_obstructed]
batch-size:               2

[mask.vgg_clear]
batch-size:               6

[mask.unet_dfl]
batch-size:               8

--------- .faceswap ---------
backend:                  amd

--------- convert.ini ---------

[writer.ffmpeg]
container:                mov
codec:                    libx264
crf:                      23
preset:                   medium
tune:                     none
profile:                  auto
level:                    auto

[writer.pillow]
format:                   png
draw_transparent:         False
optimize:                 False
gif_interlace:            True
jpg_quality:              75
png_compress_level:       3
tif_compression:          tiff_deflate

[writer.opencv]
format:                   png
draw_transparent:         False
jpg_quality:              75
png_compress_level:       3

[writer.gif]
fps:                      25
loop:                     0
palettesize:              256
subrectangles:            False

[scaling.sharpen]
method:                   unsharp_mask
amount:                   150
radius:                   0.3
threshold:                5.0

[mask.mask_blend]
type:                     normalized
kernel_size:              3
passes:                   4
threshold:                4
erosion:                  0.0

[mask.box_blend]
type:                     gaussian
distance:                 11.0
radius:                   5.0
passes:                   1

[color.manual_balance]
colorspace:               HSV
balance_1:                0.0
balance_2:                0.0
balance_3:                0.0
contrast:                 0.0
brightness:               0.0

[color.color_transfer]
clip:                     True
preserve_paper:           True

[color.match_hist]
threshold:                99.0

--------- train.ini ---------

[global]
coverage:                 68.75
mask_type:                none
mask_blur_kernel:         3
mask_threshold:           4
learn_mask:               False
icnr_init:                False
conv_aware_init:          False
subpixel_upscaling:       False
reflect_padding:          False
penalized_mask_loss:      True
loss_function:            mae
learning_rate:            5e-05

[trainer.original]
preview_images:           14
zoom_amount:              5
rotation_range:           10
shift_range:              5
flip_chance:              50
color_lightness:          30
color_ab:                 8
color_clahe_chance:       50
color_clahe_max_size:     4

[model.dfl_sae]
input_size:               128
clipnorm:                 True
architecture:             df
autoencoder_dims:         0
encoder_dims:             42
decoder_dims:             21
multiscale_decoder:       False

[model.unbalanced]
input_size:               128
lowmem:                   False
clipnorm:                 True
nodes:                    1024
complexity_encoder:       128
complexity_decoder_a:     384
complexity_decoder_b:     512

[model.dlight]
features:                 best
details:                  good
output_size:              256

[model.villain]
lowmem:                   False

[model.original]
lowmem:                   False

[model.dfl_h128]
lowmem:                   False

[model.realface]
input_size:               64
output_size:              128
dense_nodes:              1536
complexity_encoder:       128
complexity_decoder:       512


User avatar
torzdf
Posts: 447
Joined: Fri Jul 12, 2019 12:53 am
Answers: 77
Has thanked: 14 times
Been thanked: 98 times

Re: "/bin/sh: 1: ldconfig: not found" "broken pipe"

Post by torzdf » Thu Mar 05, 2020 9:28 am

This *may* actually be a problem with the input video.

If you try the opencv writer and you get the same issue, then it is almost definitely a problem with the input, in which case you should probably look to either re-encode the video or extract it to individual frames.
My word is final

User avatar
sethcoast
Posts: 4
Joined: Mon Oct 14, 2019 5:37 pm
Has thanked: 2 times

Re: "/bin/sh: 1: ldconfig: not found" "broken pipe"

Post by sethcoast » Thu Mar 05, 2020 3:22 pm

torzdf wrote:
Thu Mar 05, 2020 9:28 am
This *may* actually be a problem with the input video.

If you try the opencv writer and you get the same issue, then it is almost definitely a problem with the input, in which case you should probably look to either re-encode the video or extract it to individual frames.
Ok this is great to know. I will try that and let you know how it goes. Thank you so much for the help!

Post Reply