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

ffmpeg video filter vf with imageio-ffmpeg #103

Open
sugizo opened this issue Mar 4, 2024 · 2 comments
Open

ffmpeg video filter vf with imageio-ffmpeg #103

sugizo opened this issue Mar 4, 2024 · 2 comments
Labels
question Further information is requested

Comments

@sugizo
Copy link

sugizo commented Mar 4, 2024

objective
use ffmpeg video filter vf with imageio-ffmpeg

code

from imageio_ffmpeg import read_frames, write_frames

output_file = 'magma.mp4'

reader = read_frames(video_file)
meta = reader.__next__()

writer = write_frames(output_file, audio_path = video_file,
                      size = meta['size'], fps = meta['fps'],
                      input_params = ['-y', ],
                      output_params = ['-r', fps_v, 
                                       '-vf', "[v0]pseudocolor = preset = magma[v1]", ] )
writer.send(None)

for frame in reader:
    writer.send(frame)

writer.close()

result

BrokenPipeError                           Traceback (most recent call last)
[/usr/local/lib/python3.10/dist-packages/imageio_ffmpeg/_io.py](https://localhost:8080/#) in write_frames(path, size, pix_fmt_in, pix_fmt_out, fps, quality, bitrate, codec, macro_block_size, ffmpeg_log_level, ffmpeg_timeout, input_params, output_params, audio_path, audio_codec)
    626             try:
--> 627                 p.stdin.write(bb)
    628             except Exception as err:

BrokenPipeError: [Errno 32] Broken pipe

During handling of the above exception, another exception occurred:

OSError                                   Traceback (most recent call last)
1 frames
[/usr/local/lib/python3.10/dist-packages/imageio_ffmpeg/_io.py](https://localhost:8080/#) in write_frames(path, size, pix_fmt_in, pix_fmt_out, fps, quality, bitrate, codec, macro_block_size, ffmpeg_log_level, ffmpeg_timeout, input_params, output_params, audio_path, audio_codec)
    632                     "OUTPUT:\n".format(err, cmd_str)
    633                 )
--> 634                 raise IOError(msg)
    635 
    636             nframes += 1

OSError: [Errno 32] Broken pipe

FFMPEG COMMAND:
/usr/local/lib/python3.10/dist-packages/imageio_ffmpeg/binaries/ffmpeg-linux64-v4.2.2 -y -f rawvideo -vcodec rawvideo -s 640x368 -pix_fmt rgb24 -r 10.00 -y -i - -i merge_audio_ffmpeg.mp4 -vcodec libx264 -pix_fmt yuv420p -crf 25 -v warning -r 10 -vf [v0]pseudocolor = preset = magma[v1] -map 0:v:0 -map 1:a:0 magma.mp4

FFMPEG STDERR OUTPUT:

best regards

@almarklein
Copy link
Member

Is there anything below FFMPEG STDERR OUTPUT:? I suspect ffmpeg does not like the arguments and gave up.

@almarklein almarklein added the question Further information is requested label Mar 5, 2024
@sugizo
Copy link
Author

sugizo commented Mar 5, 2024

Is there anything below FFMPEG STDERR OUTPUT:?

there's nothing below FFMPEG STDERR OUTPUT:

the parameter
-vf [v0]pseudocolor = preset = magma[v1]
is work fine when test with :
ffmpeg on shell, vidgear, ffmpegio, typed-ffmpeg, python-ffmpeg, ffmpeg-python

best regards

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

No branches or pull requests

2 participants