12:41
I,ve tried to do a resampling with ffmpeg, but i found issues all the time in my code.
firt, i tried to get the imput channel layout but av_channel_layout_default(&layout, audio_codecpar->nb_channels) tells me, "there´s not nb_channels menber.
so i put the resampling code manually cause I know is stereo.
av_opt_set_sample_fmt(swr_ctx, "in_sample_fmt", codec_ctx->sample_fmt, 0);
av_opt_set_int(swr_ctx, "in_channel_layout", AV_CH_LAYOUT_STEREO, 0);
av_opt_set_int(swr_ctx, "in_sample_rate", codec_ctx->sample_rate, 0);
av_opt_set_sample_fmt(swr_ctx, (...)
10:35
I need to record a h265 4K RTSP stream into 1/2h segments. I'm using this command:
ffmpeg \\
-i "rtsp://..." \\
-vcodec copy \\
-segment_list /path/to/segments_2025-03-31_09-18-45.153_1.txt \\
-f segment -reset_timestamps 1 -segment_time 1800 -strftime 1 \\
"/path/to/segment_%y%m%d%H%M%S.mp4"
It works but:
the recorded files show some artifact
these warnings are print in the console when starting recording:
[segment ⓐ 0x6171d02eeac0] Timestamps are unset in a packet for stream 0. This is deprecated and will stop working in the (...)