Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

height not divisible by 2 #58

Open
zijin2 opened this issue Jul 13, 2021 · 7 comments
Open

height not divisible by 2 #58

zijin2 opened this issue Jul 13, 2021 · 7 comments

Comments

@zijin2
Copy link

zijin2 commented Jul 13, 2021

Stream mapping:
Stream #0:0 -> #0:0 (rawvideo (native) -> h264 (libx264))
[libx264 @ 0x55714fd995c0] height not divisible by 2 (400x711)
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!
Traceback (most recent call last):
File "demo_video.py", line 132, in
writer(posed_frame)
File "demo_video.py", line 108, in call
self.ff_proc.stdin.write(frame.tobytes())
BrokenPipeError: [Errno 32] Broken pipe

请教下711是怎么来的呢 输入的视频分明长宽都是偶数

@VoidLLY
Copy link

VoidLLY commented Sep 13, 2021

Stream mapping:
Stream #0:0 -> #0:0 (rawvideo (native) -> h264 (libx264))
[libx264 @ 0x55714fd995c0] height not divisible by 2 (400x711)
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!
Traceback (most recent call last):
File "demo_video.py", line 132, in
writer(posed_frame)
File "demo_video.py", line 108, in call
self.ff_proc.stdin.write(frame.tobytes())
BrokenPipeError: [Errno 32] Broken pipe

请教下711是怎么来的呢 输入的视频分明长宽都是偶数

你后来解决这个问题了吗, 我遇到了相似的情况

@mnauf
Copy link

mnauf commented Jan 21, 2022

same problem

@ThanosUTH
Copy link

any news on this?

@sibadakesi
Copy link

Dont care, use cv2.imencode(".jpg", frame)[1].tobytes() to replace frame.tobytes()

@YatsenNo1
Copy link

input_frame[1] 换成(int)(input_frame[1]/2)*2

@vielleicht-fe
Copy link

Dont care, use cv2.imencode(".jpg", frame)[1].tobytes() to replace frame.tobytes()

我替换了之后,产生下面的报错:
ffmpeg version 4.3.1 Copyright (c) 2000-2020 the FFmpeg developers
built with gcc 10.2.1 (GCC) 20200726
configuration: --disable-static --enable-shared --enable-gpl --enable-version3 --enable-sdl2 --enable-fontconfig --enable-gnutls --enable-iconv --enable-libass --enable-libdav1d --enable-libbluray --enable-libfreetype --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-libopus --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libsrt --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-libvmaf --enable-libvorbis --enable-libvo-amrwbenc --enable-libmysofa --enable-libspeex --enable-libxvid --enable-libaom --enable-libgsm --enable-librav1e --disable-w32threads --enable-libmfx --enable-ffnvcodec --enable-cuda-llvm --enable-cuvid --enable-d3d11va --enable-nvenc --enable-nvdec --enable-dxva2 --enable-avisynth --enable-libopenmpt --enable-amf
libavutil 56. 51.100 / 56. 51.100
libavcodec 58. 91.100 / 58. 91.100
libavformat 58. 45.100 / 58. 45.100
libavdevice 58. 10.100 / 58. 10.100
libavfilter 7. 85.100 / 7. 85.100
libswscale 5. 7.100 / 5. 7.100
libswresample 3. 7.100 / 3. 7.100
libpostproc 55. 7.100 / 55. 7.100
Input #0, rawvideo, from 'pipe:':
Duration: N/A, start: 0.000000, bitrate: 294798 kb/s
Stream #0:0: Video: rawvideo (BGR[24] / 0x18524742), bgr24, 853x480, 294798 kb/s, 30 tbr, 30 tbn, 30 tbc
Stream mapping:
Stream #0:0 -> #0:0 (rawvideo (native) -> h264 (libx264))
[libx264 @ 00000234c0d49300] width not divisible by 2 (853x480)
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!
Traceback (most recent call last):
File "demo_video.py", line 132, in
writer(posed_frame)
File "demo_video.py", line 108, in call
self.ff_proc.stdin.write(cv2.imencode(".jpg", frame)[1].tobytes())
BrokenPipeError: [Errno 32] Broken pipe

@zmhsmart
Copy link

有解决的办法吗

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

No branches or pull requests

8 participants