fprintf(stderr, " --default-hdmi-input default to HDMI over SDI inputs for cards that have both\n");
fprintf(stderr, " --fake-cards-audio make fake (disconnected) cards output a simple tone\n");
fprintf(stderr, " --v4l-output DEVICE send video (no audio) to V4L2 output/loopback\n");
- fprintf(stderr, " --http-uncompressed-video send uncompressed NV12 video to HTTP clients\n");
fprintf(stderr, " --http-x264-video send x264-compressed video to HTTP clients\n");
fprintf(stderr, " --record-x264-video store x264-compressed video to disk (implies --http-x264-video,\n");
fprintf(stderr, " removes the need for working VA-API encoding)\n");
{ "default-hdmi-input", no_argument, 0, OPTION_DEFAULT_HDMI_INPUT },
{ "fake-cards-audio", no_argument, 0, OPTION_FAKE_CARDS_AUDIO },
{ "v4l-output", required_argument, 0, OPTION_V4L_OUTPUT },
- { "http-uncompressed-video", no_argument, 0, OPTION_HTTP_UNCOMPRESSED_VIDEO },
{ "http-x264-video", no_argument, 0, OPTION_HTTP_X264_VIDEO },
{ "record-x264-video", no_argument, 0, OPTION_RECORD_X264_VIDEO },
{ "separate-x264-disk-encode", no_argument, 0, OPTION_SEPARATE_X264_DISK_ENCODE },
case OPTION_V4L_OUTPUT:
global_flags.v4l_output_device = optarg;
break;
- case OPTION_HTTP_UNCOMPRESSED_VIDEO:
- global_flags.uncompressed_video_to_http = true;
- break;
case OPTION_HTTP_MUX:
global_flags.stream_mux_name = optarg;
break;
}
}
- if (global_flags.uncompressed_video_to_http +
- global_flags.x264_video_to_http +
+ if (global_flags.x264_video_to_http +
global_flags.av1_video_to_http > 1) {
- fprintf(stderr, "ERROR: --http-{uncompressed,x264,av1}-video are mutually incompatible\n");
+ fprintf(stderr, "ERROR: --http-{x264,av1}-video are mutually incompatible\n");
exit(1);
}
if (global_flags.bit_depth == 10) {
global_flags.x264_video_to_http = true;
}
}
- if (global_flags.x264_video_to_disk && !global_flags.uncompressed_video_to_http && !global_flags.av1_video_to_http) {
+ if (global_flags.x264_video_to_disk && !global_flags.av1_video_to_http) {
global_flags.x264_video_to_http = true; // Quick Sync to HTTP but x264 to disk doesn't make sense.
}
if (global_flags.min_num_cards <= 0) {
int max_num_cards = MAX_VIDEO_CARDS;
std::string va_display;
bool fake_cards_audio = false;
- bool uncompressed_video_to_http = false;
bool x264_video_to_http = false;
bool x264_video_to_disk = false; // Disables Quick Sync entirely. Implies x264_video_to_http == true.
bool x264_separate_disk_encode = false; // Disables Quick Sync entirely. Implies x264_video_to_disk == true.
if (global_flags.x264_video_to_disk) {
// Quick Sync is entirely disabled.
use_zerocopy = false;
- } else if (global_flags.uncompressed_video_to_http) {
- fprintf(stderr, "Disabling zerocopy H.264 encoding due to --http-uncompressed-video.\n");
- use_zerocopy = false;
} else if (global_flags.x264_video_to_http) {
fprintf(stderr, "Disabling zerocopy H.264 encoding due to --http-x264-video.\n");
use_zerocopy = false;
if (file_mux) {
file_mux->add_packet(pkt, task.pts + global_delay(), task.dts + global_delay());
}
- if (!global_flags.uncompressed_video_to_http &&
- !global_flags.x264_video_to_http &&
+ if (!global_flags.x264_video_to_http &&
!global_flags.av1_video_to_http) {
stream_mux->add_packet(pkt, task.pts + global_delay(), task.dts + global_delay());
}
}
}
-void QuickSyncEncoderImpl::add_packet_for_uncompressed_frame(int64_t pts, int64_t duration, const uint8_t *data)
-{
- AVPacket pkt;
- memset(&pkt, 0, sizeof(pkt));
- pkt.buf = nullptr;
- pkt.data = const_cast<uint8_t *>(data);
- pkt.size = frame_width * frame_height * 2;
- pkt.stream_index = 0;
- pkt.flags = AV_PKT_FLAG_KEY;
- pkt.duration = duration;
- stream_mux->add_packet(pkt, pts, pts);
-}
-
void memcpy_with_pitch(uint8_t *dst, const uint8_t *src, size_t src_width, size_t dst_pitch, size_t height)
{
if (src_width == dst_pitch) {
assert(surf != nullptr);
}
uint8_t *data = reinterpret_cast<uint8_t *>(surf->y_ptr);
- if (global_flags.uncompressed_video_to_http) {
- add_packet_for_uncompressed_frame(pts, duration, data);
- } else if (http_encoder != nullptr) {
+ if (http_encoder != nullptr) {
http_encoder->add_frame(pts, duration, frame.ycbcr_coefficients, data, received_ts);
} if (disk_encoder != nullptr && disk_encoder != http_encoder) {
disk_encoder->add_frame(pts, duration, frame.ycbcr_coefficients, data, received_ts);
void open_output_file(const std::string &filename);
void encode_thread_func();
void encode_remaining_frames_as_p(int encoding_frame_num, int gop_start_display_frame_num, int64_t last_dts);
- void add_packet_for_uncompressed_frame(int64_t pts, int64_t duration, const uint8_t *data);
void pass_frame(PendingFrame frame, int display_frame_num, int64_t pts, int64_t duration);
void encode_frame(PendingFrame frame, int encoding_frame_num, int display_frame_num, int gop_start_display_frame_num,
int frame_type, int64_t pts, int64_t dts, int64_t duration, movit::YCbCrLumaCoefficients ycbcr_coefficients);
avctx->pb->ignore_boundary_point = 1;
Mux::Codec video_codec;
- if (global_flags.uncompressed_video_to_http) {
- video_codec = Mux::CODEC_NV12;
- } else if (global_flags.av1_video_to_http) {
+ if (global_flags.av1_video_to_http) {
video_codec = Mux::CODEC_AV1;
} else {
video_codec = Mux::CODEC_H264;
avstream_video->codecpar->codec_id = AV_CODEC_ID_H264;
} else if (video_codec == CODEC_AV1) {
avstream_video->codecpar->codec_id = AV_CODEC_ID_AV1;
- } else if (video_codec == CODEC_NV12) {
- avstream_video->codecpar->codec_id = AV_CODEC_ID_RAWVIDEO;
- avstream_video->codecpar->codec_tag = avcodec_pix_fmt_to_codec_tag(AV_PIX_FMT_NV12);
} else {
assert(video_codec == CODEC_MJPEG);
avstream_video->codecpar->codec_id = AV_CODEC_ID_MJPEG;
enum Codec {
CODEC_H264,
CODEC_AV1,
- CODEC_NV12, // Uncompressed 4:2:0.
CODEC_MJPEG
};
enum WriteStrategy {