Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

Add support for -i pipe:0

オープン
#334 コメント 8 件 リアクション 0 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

評価

難易度
4/5
見積もり時間
3〜5日
初心者へのやさしさ
48/100
issue の種類
機能追加
明瞭さ
おおむね明確
活発さ
静か
技術スタック
java
領域
cli, tooling

調査の方向性

FFmpegBuilder と Java ラッパーで使用されているプロセス処理のエントリーポイントから始めます。提案されている InputStream supplier がどのようにプロセスへ入力を供給できるかを確認し、addInput("pipe:0") が stdin を選択することを確認します。Java 8 との互換性を考慮し、既存の出力動作を維持したまま、ディスクに書き込まずにライブ入力をストリーミングできれば完了です。

索引モデルが issue の本文から書いたものです。

説明

enhancement

Hello, I need to transcode live videos,
essentially reading from an InputStream and pipeing the output into an OutputStream is what I need to do.
Unfortunately writing the file to disk is not possible for my use case.
I tried using 2 unix sockets which did work for some formats, but some input formats did not work that way. notably the MP4 demuxer
didnt like demuxing from a unix socket. It does however work with demuxing from stdin.

Sadly your CLI wrapper has no support for demuxing from stdin, so I have to rely on ProcessBuilder directly for this one task.

I wouldnt mind developing this as a feature and making a PR to this repo if you are intrested in this.
My idea would be to add a function to FFmpegBuilder that accepts a supplier to a InputStream.
A bit like this:

FFmpegBuilder builder = ...
Supplier<InputStream> streamSupplier = ...
builder.setStdIn(streamSupplier)

At some appropriate location in the library I would add this code or something similar:
(This may possible require starting of a "background" thread and I will maybe have to make adjustments for java 8 compat.)

Supplier<InputStream> streamSupplier = ...
Process proc = ...
if (streamSupplier != null) {
try(OutputStream outputStream = proc.getOutputStream(); 
    InputStream stream = streamSupplier.get()) {
    stream.transferTo(outputStream);
}
}

After these changes someone could then call
builder.addInput("pipe:0") to pipe the input from the InputStream.
For my usecase the output would still be a unix socket since my output muxer can write to the unix socket
and the input would be from the InputStream.

Tell me if you have any intrest in this feature and I will begin making it and give you a PR shortly.

主要言語
Java
スター
1.9k
フォーク
424
平均マージ
6時間 7分
マージ済み PR(30日)
6

コントリビューションガイド

このリポジトリのコントリビューションガイドは索引されていません

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

bramp/ffmpeg-cli-wrapper のほかの issue

bramp/ffmpeg-cli-wrapper の issue をすべて見る

似ている issue

Java の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。