Skip to content
TheChatArchiveThe Chat Archive
Claudeclaude-3-7-sonnet-20250219-thinking-32k· AnthropicHugging Face LMArena Human Preference 140K

how i can use the "randomi" filter expression in FFMPEG?

From a Chatbot Arena battleThe same person sent this prompt to two anonymous models at once. Compare it with Coherecommand-a-03-2025’s answer.
  1. User

    how i can use the "randomi" filter expression in FFMPEG?

  2. Claude Assistant

    To use random integer generation in FFmpeg filter expressions, you can use the random(min, max) function. This generates random integer values between the specified minimum and maximum values.

    Here's a basic example that applies a random hue shift to a video:

    ffmpeg -i input.mp4 -vf "hue=h=random(0,360)" output.mp4
    

    You can also use it for more complex operations like randomly selecting frames:

    ffmpeg -i input.mp4 -vf "select=if(eq(random(0,100),0),1,0)" -vsync vfr random_frames.mp4
    

    For consistent results across multiple runs, you can set a seed:

    ffmpeg -i input.mp4 -vf "random_seed=42,hue=h=random(0,360)" output.mp4
    

    Would you like me to explain any of these examples in more detail?

Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.