Test programs: Could not find tag for codec vp8 in stream #0, codec not currently supported in container
Trying the test programs, both xdp-recordme and recordme create an empty ~/clementine.mp4 and the console shows
[mp4 @ 0x7efc4403b540] Could not find tag for codec vp8 in stream #0, codec not currently supported in container
kpipewire_record_logging: Error occurred when writing header: Invalid argument
I built kpipewire from the v5.27.7 tag (couldn't build master since my ECM is 5.108.0 vs requested 5.240.0).
My system info:
- KDE Plasma 5.27.7
- KDE Frameworks 5.109.0
- Qt: 5.15.10
- Kernel: 6.4.9-zen1-1-zen (arch linux)
- Wayland
- laptop with prime graphics, intel and nvidia
Full output of xdp-recordme:
kf.kirigami: Failed to find a Kirigami platform plugin
select sources done "/org/freedesktop/portal/desktop/request/1_467/RecordMe3918602276"
params QMap() 0
started! "/org/freedesktop/portal/desktop/request/1_467/RecordMe3918602276"
feeding... 76 25
[libvpx @ 0x7efc4403ba00] v1.13.0
[libvpx @ 0x7efc4403ba00] --prefix=/usr --disable-install-docs --disable-install-srcs --disable-unit-tests --enable-pic --enable-postproc --enable-runtime-cpu-detect --enable-shared --enable-vp8 --enable-vp9 --enable-vp9-highbitdepth --enable-vp9-temporal-denoising
[libvpx @ 0x7efc4403ba00] vpx_codec_enc_cfg
[libvpx @ 0x7efc4403ba00] generic settings
g_usage: 0
g_threads: 0
g_profile: 0
g_w: 320
g_h: 240
g_bit_depth: 8
g_input_bit_depth: 8
g_timebase: {1/30}
g_error_resilient: 0
g_pass: 0
g_lag_in_frames: 0
[libvpx @ 0x7efc4403ba00] rate control settings
rc_dropframe_thresh: 0
rc_resize_allowed: 0
rc_resize_up_thresh: 60
rc_resize_down_thresh: 30
rc_end_usage: 0
rc_twopass_stats_in: (nil)(0)
rc_target_bitrate: 256
[libvpx @ 0x7efc4403ba00] quantizer settings
rc_min_quantizer: 4
rc_max_quantizer: 63
[libvpx @ 0x7efc4403ba00] bitrate tolerance
rc_undershoot_pct: 100
rc_overshoot_pct: 100
[libvpx @ 0x7efc4403ba00] temporal layering settings
ts_number_layers: 1
[libvpx @ 0x7efc4403ba00]
ts_target_bitrate: 0 0 0 0 0
[libvpx @ 0x7efc4403ba00]
ts_rate_decimator: 0 0 0 0 0
[libvpx @ 0x7efc4403ba00]
ts_periodicity: 0
[libvpx @ 0x7efc4403ba00]
ts_layer_id: 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
[libvpx @ 0x7efc4403ba00] decoder buffer model
rc_buf_sz: 6000
rc_buf_initial_sz: 4000
rc_buf_optimal_sz: 5000
[libvpx @ 0x7efc4403ba00] 2 pass rate control settings
rc_2pass_vbr_bias_pct: 50
rc_2pass_vbr_minsection_pct: 0
rc_2pass_vbr_maxsection_pct: 400
[libvpx @ 0x7efc4403ba00] rc_2pass_vbr_corpus_complexity:0
[libvpx @ 0x7efc4403ba00] keyframing settings
kf_mode: 1
kf_min_dist: 0
kf_max_dist: 128
[libvpx @ 0x7efc4403ba00]
[libvpx @ 0x7efc4403ba00] vpx_codec_enc_cfg
[libvpx @ 0x7efc4403ba00] generic settings
g_usage: 0
g_threads: 16
g_profile: 0
g_w: 2560
g_h: 1600
g_bit_depth: 8
g_input_bit_depth: 8
g_timebase: {1/1000}
g_error_resilient: 0
g_pass: 0
g_lag_in_frames: 25
[libvpx @ 0x7efc4403ba00] rate control settings
rc_dropframe_thresh: 0
rc_resize_allowed: 0
rc_resize_up_thresh: 60
rc_resize_down_thresh: 30
rc_end_usage: 0
rc_twopass_stats_in: (nil)(0)
rc_target_bitrate: 8192
[libvpx @ 0x7efc4403ba00] quantizer settings
rc_min_quantizer: 4
rc_max_quantizer: 63
[libvpx @ 0x7efc4403ba00] bitrate tolerance
rc_undershoot_pct: 100
rc_overshoot_pct: 100
[libvpx @ 0x7efc4403ba00] temporal layering settings
ts_number_layers: 1
[libvpx @ 0x7efc4403ba00]
ts_target_bitrate: 0 0 0 0 0
[libvpx @ 0x7efc4403ba00]
ts_rate_decimator: 0 0 0 0 0
[libvpx @ 0x7efc4403ba00]
ts_periodicity: 0
[libvpx @ 0x7efc4403ba00]
ts_layer_id: 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
[libvpx @ 0x7efc4403ba00] decoder buffer model
rc_buf_sz: 6000
rc_buf_initial_sz: 4000
rc_buf_optimal_sz: 5000
[libvpx @ 0x7efc4403ba00] 2 pass rate control settings
rc_2pass_vbr_bias_pct: 50
rc_2pass_vbr_minsection_pct: 0
rc_2pass_vbr_maxsection_pct: 400
[libvpx @ 0x7efc4403ba00] rc_2pass_vbr_corpus_complexity:0
[libvpx @ 0x7efc4403ba00] keyframing settings
kf_mode: 1
kf_min_dist: 0
kf_max_dist: 100
[libvpx @ 0x7efc4403ba00]
[libvpx @ 0x7efc4403ba00] vpx_codec_control
[libvpx @ 0x7efc4403ba00] VP8E_SET_CPUUSED: 6
[libvpx @ 0x7efc4403ba00] VP8E_SET_ARNR_MAXFRAMES: 0
[libvpx @ 0x7efc4403ba00] VP8E_SET_ARNR_STRENGTH: 3
[libvpx @ 0x7efc4403ba00] VP8E_SET_ARNR_TYPE: 3
[libvpx @ 0x7efc4403ba00] VP8E_SET_NOISE_SENSITIVITY: 0
[libvpx @ 0x7efc4403ba00] VP8E_SET_TOKEN_PARTITIONS: 0
[libvpx @ 0x7efc4403ba00] VP8E_SET_STATIC_THRESHOLD: 0
[libvpx @ 0x7efc4403ba00] Using deadline: 40
[file @ 0x7efc440c9d80] Setting default whitelist 'file,crypto,data'
[mp4 @ 0x7efc4403b540] Could not find tag for codec vp8 in stream #0, codec not currently supported in container
kpipewire_record_logging: Error occurred when writing header: Invalid argument
I tried this patch to see if I could get it to use libx264
diff --git a/src/pipewirerecord.cpp b/src/pipewirerecord.cpp
index ac8132e..ff3b51b 100644
--- a/src/pipewirerecord.cpp
+++ b/src/pipewirerecord.cpp
@@ -105,7 +105,7 @@ PipeWireRecord::PipeWireRecord(QObject *parent)
: QObject(parent)
, d(new PipeWireRecordPrivate)
{
- d->m_encoder = "libvpx";
+ d->m_encoder = "libx264";
av_log_set_level(AV_LOG_DEBUG);
qRegisterMetaType<std::optional<int>>();
qRegisterMetaType<std::optional<std::chrono::nanoseconds>>();
@@ -251,7 +251,7 @@ void PipeWireRecordProduce::stateChanged(pw_stream_state state)
QString PipeWireRecord::extension()
{
- return QStringLiteral("webm");
+ return QStringLiteral("mp4");
}
QString PipeWireRecord::currentExtension() const
@@ -260,7 +260,7 @@ QString PipeWireRecord::currentExtension() const
{"libx264", QStringLiteral("mp4")},
{"libvpx", QStringLiteral("webm")},
};
- return s_extensions.value(d->m_encoder, QStringLiteral("mkv"));
+ return s_extensions.value(d->m_encoder, QStringLiteral("mp4"));
}
void PipeWireRecordProduce::setupStream()
@@ -270,7 +270,7 @@ void PipeWireRecordProduce::setupStream()
avformat_alloc_output_context2(&m_avFormatContext, nullptr, nullptr, m_output.toUtf8().constData());
if (!m_avFormatContext) {
qCWarning(PIPEWIRERECORD_LOGGING) << "Could not deduce output format from file: using WebM." << m_output;
- avformat_alloc_output_context2(&m_avFormatContext, nullptr, "webm", m_output.toUtf8().constData());
+ avformat_alloc_output_context2(&m_avFormatContext, nullptr, "mp4", m_output.toUtf8().constData());
}
if (!m_avFormatContext) {
qCDebug(PIPEWIRERECORD_LOGGING) << "could not set stream up";
Then I do start to get something. Output of xdp-recordme:
kf.kirigami: Failed to find a Kirigami platform plugin
select sources done "/org/freedesktop/portal/desktop/request/1_519/RecordMe3820604744"
params QMap() 0
started! "/org/freedesktop/portal/desktop/request/1_519/RecordMe3820604744"
feeding... 88 25
kpipewire_logging: PipeWire remote error: -2 unknown resource 2 op:2
[libx264 @ 0x7fe50803b9c0] using mv_range_thread = 40
[libx264 @ 0x7fe50803b9c0] using cpu capabilities: MMX2 SSE2Fast SSSE3 SSE4.2 AVX FMA3 BMI2 AVX2
[libx264 @ 0x7fe50803b9c0] profile High, level 6.2, 4:2:0, 8-bit
[file @ 0x7fe509437540] Setting default whitelist 'file,crypto,data'
kpipewire_dmabuf_logging: eglChooseConfig returned this many configs: 1
[libx264 @ 0x7fe50803b9c0] non-strictly-monotonic PTS
[libx264 @ 0x7fe50803b9c0] frame= 0 QP=48.24 NAL=3 Slice:I Poc:0 I:16000 P:0 SKIP:0 size=14321 bytes
[libx264 @ 0x7fe50803b9c0] frame= 1 QP=50.43 NAL=2 Slice:P Poc:4 I:812 P:481 SKIP:14707 size=4285 bytes
[libx264 @ 0x7fe50803b9c0] frame= 2 QP=51.00 NAL=0 Slice:B Poc:2 I:0 P:280 SKIP:15720 size=405 bytes
[libx264 @ 0x7fe50803b9c0] frame= 3 QP=50.66 NAL=2 Slice:P Poc:8 I:397 P:244 SKIP:15359 size=2094 bytes
[libx264 @ 0x7fe50803b9c0] frame= 4 QP=51.00 NAL=0 Slice:B Poc:6 I:1 P:359 SKIP:15640 size=657 bytes
[libx264 @ 0x7fe50803b9c0] frame= 5 QP=50.94 NAL=2 Slice:P Poc:12 I:7 P:13 SKIP:15980 size=173 bytes
[libx264 @ 0x7fe50803b9c0] frame= 6 QP=51.00 NAL=0 Slice:B Poc:10 I:0 P:4 SKIP:15996 size=132 bytes
[libx264 @ 0x7fe50803b9c0] frame= 7 QP=49.48 NAL=2 Slice:P Poc:16 I:9 P:0 SKIP:15991 size=146 bytes
[libx264 @ 0x7fe50803b9c0] frame= 8 QP=51.00 NAL=0 Slice:B Poc:14 I:0 P:4 SKIP:15996 size=132 bytes
However, no luck playing with mpv:
> mediainfo clementine.mp4
General
Complete name : clementine.mp4
Format : MPEG-4
Format profile : Base Media
Codec ID : isom (isom/iso2/avc1/mp41)
File size : 10.8 MiB
> mpv clementine.mp4
[ffmpeg/demuxer] mov,mp4,m4a,3gp,3g2,mj2: moov atom not found
[lavf] avformat_open_input() failed
[ffmpeg/demuxer] mov,mp4,m4a,3gp,3g2,mj2: moov atom not found
[lavf] avformat_open_input() failed
Failed to recognize file format.
Exiting... (Errors when loading file)
In general I was curious finding this project to see how it works and if it could potentially be used as a pipewire to ffmpeg bridge for other use cases (e.g. stream with mpegts instead of saving to file). Unfortunately I can't use ffmpeg+kmsgrab because of https://trac.ffmpeg.org/ticket/10188