gaogaotiantian / pitch-visualizer

Visualize pitch for a video
Apache License 2.0
212 stars 35 forks source link

ffmpeg returen non-zero exit status 218 #3

Open songlyzz opened 11 months ago

songlyzz commented 11 months ago

up主您好,我尝试用您的代码,但发现ffmpeg 报错显示如下:

python gen_pitch.py --audio 1ganbei(Vocals).mp3 -t F ganbei.mp4 --ffmpeg /histor/sun/huangjunsong/software/ffmpeg-6.1/ffmpeg Generating pitch video 0%| | 3/3264 [00:01<24:40, 2.20frame/s]MovieWriter stderr: Impossible to convert between the formats supported by the filter 'Parsed_null_0' and the filter 'auto_scale_0' [vf#0:0 @ 0x3481e40] Error reinitializing filters! Failed to inject frame into filter network: Function not implemented Error while filtering: Function not implemented [out#0/mp4 @ 0x347c540] Nothing was written into output file, because at least one of its streams received no packets.

0%| | 3/3264 [00:01<28:21, 1.92frame/s] Traceback (most recent call last): File "/histor/sun/huangjunsong/anaconda3/lib/python3.8/site-packages/matplotlib/animation.py", line 231, in saving yield self File "/histor/sun/huangjunsong/anaconda3/lib/python3.8/site-packages/matplotlib/animation.py", line 1085, in save writer.grab_frame(savefig_kwargs) File "/histor/sun/huangjunsong/anaconda3/lib/python3.8/site-packages/matplotlib/animation.py", line 357, in grab_frame self.fig.savefig(self._proc.stdin, format=self.frame_format, File "/histor/sun/huangjunsong/anaconda3/lib/python3.8/site-packages/matplotlib/figure.py", line 3274, in savefig self.canvas.print_figure(fname, kwargs) File "/histor/sun/huangjunsong/anaconda3/lib/python3.8/site-packages/matplotlib/backends/backend_qtagg.py", line 81, in print_figure super().print_figure(*args, kwargs) File "/histor/sun/huangjunsong/anaconda3/lib/python3.8/site-packages/matplotlib/backend_bases.py", line 2338, in print_figure result = print_method( File "/histor/sun/huangjunsong/anaconda3/lib/python3.8/site-packages/matplotlib/backend_bases.py", line 2204, in print_method = functools.wraps(meth)(lambda *args, *kwargs: meth( File "/histor/sun/huangjunsong/anaconda3/lib/python3.8/site-packages/matplotlib/_api/deprecation.py", line 410, in wrapper return func(inner_args, inner_kwargs) File "/histor/sun/huangjunsong/anaconda3/lib/python3.8/site-packages/matplotlib/backends/backend_agg.py", line 454, in print_raw fh.write(renderer.buffer_rgba()) BrokenPipeError: [Errno 32] Broken pipe

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "gen_pitch.py", line 202, in generate_pitch_video(options.audio, pitch_video_path, options.tone) File "gen_pitch.py", line 112, in generate_pitch_video ani.save(output, writer=FFWriter) File "/histor/sun/huangjunsong/anaconda3/lib/python3.8/site-packages/matplotlib/animation.py", line 1085, in save writer.grab_frame(**savefig_kwargs) File "/histor/sun/huangjunsong/anaconda3/lib/python3.8/contextlib.py", line 131, in exit self.gen.throw(type, value, traceback) File "/histor/sun/huangjunsong/anaconda3/lib/python3.8/site-packages/matplotlib/animation.py", line 233, in saving self.finish() File "/histor/sun/huangjunsong/anaconda3/lib/python3.8/site-packages/matplotlib/animation.py", line 347, in finish raise subprocess.CalledProcessError( subprocess.CalledProcessError: Command '['/histor/sun/huangjunsong/software/ffmpeg-6.1/ffmpeg', '-f', 'rawvideo', '-vcodec', 'rawvideo', '-s', '1920x1080', '-pix_fmt', 'rgba', '-r', '15', '-loglevel', 'error', '-i', 'pipe:', '-vcodec', 'h264', '-pix_fmt', 'yuv420p', '-y', '/tmp/tmpyl1xq4sd/pitch.mp4']' returned non-zero exit status 218.

请问这是ffmpeg 处理视频的问题吗?这该如何解决呢?

wwxiaoqi commented 11 months ago

I think that it requires proper encoding parameters like -vf format=nv12,hwupload

songlyzz commented 11 months ago

I think that it requires proper encoding parameters like -vf format=nv12,hwupload

that mean I should add -vf format=nv12,hwupload in subprocess.CalledProcess command to use ffmpeg?

gaogaotiantian commented 11 months ago

这我还真不确定是什么情况,没遇到过……我对ffmpeg其实没有那么熟悉,看起来是在做pitch那个视频的时候出的错。

gaogaotiantian commented 11 months ago

哎,你的matplotlib version是多少?是最新的么?

Liu-zhenwei-0210 commented 11 months ago

老师您好,我想请问下我按照您的代码做到最后一步PS D:\five\pitch-visualizer> python gen_pitch.py --audio vocal.mp3 -t F ganbei.MP4 时,它并没有生成一个音频文件,而是出现一下提示: Generating pitch video 3805frame [01:56, 32.64frame/s] Combining video Traceback (most recent call last): File "D:\five\pitch-visualizer\gen_pitch.py", line 235, in combine_video(options.ffmpeg, options.video, pitch_video_path, options.output, options.pitch_width, options.pitch_position) File "D:\five\pitch-visualizer\gen_pitch.py", line 153, in combinevideo width, = process.stdout.decode().split("x") ValueError: too many values to unpack (expected 2) 请问这是什么原因呢?该如何解决呢。

gaogaotiantian commented 11 months ago

看起来是因为你ffprobe那一步出问题了。你在command line里做ffprobe -v error -select_streams v:0 -show_entries stream=width,height -of csv=s=x:p=0 GANBEI.mp4结果是啥

Liu-zhenwei-0210 commented 11 months ago

老师您好,我的结果是这个:ffprobe -v error -select_streams v:0 -show_entries stream=width,height -of csv=s=x:p=0 ganbei.MP4

1920x1080x

gaogaotiantian commented 11 months ago

看起来是你ffprobe的bug,输出不应该有最后的那个x才对……试着更新一下ffmpeg?