Skip to content

Feature Request: Allow skipping video/audio input #10

Open

Description

@mateowoetam

Allow skipping video/audio input

Right now the beheader script always requires a video or audio input, even if the user just wants to combine an image with other file types (e.g. PDF, HTML, ZIP, extras).

The usage is currently defined as:

const [output, image, video] = argv.slice(2);
if (!output) printHelpAndExit();

This enforces <video|audio> as a mandatory third argument. Later, the tool always probes and re-encodes it:

const streamProbe = await $`ffprobe ... "${video}"`.quiet();
...
if (isVideo) await $`ffmpeg -i "${video}" ...`;
else await $`ffmpeg -i "${video}" ...`;

That means the tool cannot run without a video/audio file, even if the user only wants to embed other formats.


Proposal

Make the video argument optional, so that beheader can also generate polyglots from just an image + PDF/HTML/ZIP/etc. For example:

const [output, image, video] = argv.slice(2);

if (!output || !image) printHelpAndExit();

if (video) {
  // current ffmpeg/ffprobe path
} else {
  // create a minimal "empty" MP4 container to hold atoms
}

This way, users could run:

beheader out.polyglot cover.png -p doc.pdf -z data.zip

without needing to supply a dummy audio/video file.


Benefits

  • Makes the tool more flexible for users who only want to bundle non-video assets.
  • Removes the need to create placeholder video/audio files for these cases.
  • Still compatible with existing workflows that expect video/audio input.

Activity

  1. 85diamonds commented on Oct 21, 2025

    @85diamonds

    Sadly this is necessary I believe, since the video header has a unique section called the skipped section, in which everything needed is stored. That means without the .mp4 or alike video file header, there probably can't be a polyglot at all.

    I am too lazy to rewatch the video portal runner made on this, so this is almost purely from memory, but I have fast fingers and Google, which could easily tell me about the skipped section in most modern video file types.

  2. p2r3 commented on Oct 21, 2025

    @p2r3
    Owner

    Sadly this is necessary I believe, since the video header has a unique section called the skipped section, in which everything needed is stored. That means without the .mp4 or alike video file header, there probably can't be a polyglot at all.

    No, nothing requires a video container to be present, that'd make very little sense. The skip atom is only used by the video container itself, and wouldn't apply to other formats in any way.

    You also seem to have missed their proposal, which suggested adding a minimal dummy container.

  3. p2r3 commented on Oct 21, 2025

    @p2r3
    Owner

    To address the issue itself, I'm not personally interested in implementing this. The proposed solution is hacky, and the only elegant way to do this would be to refactor a significant part of the script.

    Keep in mind that this is also very much an esoteric joke program. While I do appreciate the professionalism (I really do!), I doubt that the tool greatly benefits from being more "flexible", or adapting to user's "workflows". I'd be surprised if anyone has ever applied this program practically, and even more so if they were truly hindered by the requirement of an audio/video parameter.

  4. 85diamonds commented on Oct 21, 2025

    @85diamonds

    To address the issue itself, I'm not personally interested in implementing this. The proposed solution is hacky, and the only elegant way to do this would be to refactor a significant part of the script.

    Keep in mind that this is also very much an esoteric joke program. While I do appreciate the professionalism (I really do!), I doubt that the tool greatly benefits from being more "flexible", or adapting to user's "workflows". I'd be surprised if anyone has ever applied this program practically, and even more so if they were truly hindered by the requirement of an audio/video parameter.

    @p2r3 It is always fun to show this to your friends, or even to store archives secretly and in plain sight. It would be great if there was an in-depth video, or some documentation on how this works if achievable, I would love to learn more about ripping apart files and scotch taping them together (which sounds pretty violent actually)

  5. 85diamonds commented on Oct 21, 2025

    @85diamonds

    @mateowoetam You could always create a fork, I would be happy to help, even with my limited environment :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions