Skip to content

Commit

Permalink
libav: Allow libcamera-vid to run with minimal options using libav
Browse files Browse the repository at this point in the history
Set a default output file to /dev/null if none has been provided.
Set the default container to an elementary stream.

Signed-off-by: Naushir Patuck <[email protected]>
  • Loading branch information
naushir authored and davidplowman committed Sep 14, 2023
1 parent 15e9007 commit 87ba9f2
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion core/video_options.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ struct VideoOptions : public Options
("libav-video-codec", value<std::string>(&libav_video_codec)->default_value("h264_v4l2m2m"),
"Sets the libav video codec to use. "
"To list available codecs, run the \"ffmpeg -codecs\" command.")
("libav-format", value<std::string>(&libav_format)->default_value(""),
("libav-format", value<std::string>(&libav_format)->default_value("h264"),
"Sets the libav encoder output format to use. "
"Leave blank to try and deduce this from the filename.\n"
"To list available formats, run the \"ffmpeg -formats\" command.")
Expand Down
2 changes: 1 addition & 1 deletion encoder/libav_encoder.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -388,7 +388,7 @@ void LibAvEncoder::initOutput()
char err[64];
if (!(out_fmt_ctx_->flags & AVFMT_NOFILE))
{
std::string filename = options_->output;
std::string filename = options_->output.empty() ? "/dev/null" : options_->output;

// libav uses "pipe:" for stdout
if (filename == "-")
Expand Down

0 comments on commit 87ba9f2

Please sign in to comment.