From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from ffbox0-bg.ffmpeg.org (ffbox0-bg.ffmpeg.org [79.124.17.100]) by master.gitmailbox.com (Postfix) with ESMTPS id 90EB74907E for ; Fri, 15 Aug 2025 22:02:43 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.ffmpeg.org (Postfix) with ESMTP id 799B468D30E; Sat, 16 Aug 2025 01:02:38 +0300 (EEST) Received: from 1e8b7847f7d1 (code.ffmpeg.org [188.245.149.3]) by ffbox0-bg.ffmpeg.org (Postfix) with ESMTPS id F26D568CFD6 for ; Sat, 16 Aug 2025 01:02:35 +0300 (EEST) MIME-Version: 1.0 From: ldm0 To: ffmpeg-devel@ffmpeg.org Subject: [FFmpeg-devel] =?utf-8?q?=5BPATCH=5D_doc/examples/demux=5Fdecode?= =?utf-8?q?=3A_update_ffplay_command_for_audio_and_video_output_=28PR_=232?= =?utf-8?q?0252=29?= X-BeenThere: ffmpeg-devel@ffmpeg.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: FFmpeg development discussions and patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: FFmpeg development discussions and patches Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" Message-Id: <20250815220238.799B468D30E@ffbox0-bg.ffmpeg.org> Date: Sat, 16 Aug 2025 01:02:38 +0300 (EEST) Archived-At: List-Archive: List-Post: PR #20252 opened by ldm0 URL: https://code.ffmpeg.org/FFmpeg/FFmpeg/pulls/20252 Patch URL: https://code.ffmpeg.org/FFmpeg/FFmpeg/pulls/20252.patch Signed-off-by: ldm0 >From 0bb2f5f724d75171a7b87529fc1b1034669924ea Mon Sep 17 00:00:00 2001 From: ldm0 Date: Sat, 16 Aug 2025 06:01:26 +0800 Subject: [PATCH] doc/examples/demux_decode: update ffplay command for audio and video output Signed-off-by: ldm0 --- doc/examples/demux_decode.c | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/doc/examples/demux_decode.c b/doc/examples/demux_decode.c index 64f5547bc4..e1dd7fa5df 100644 --- a/doc/examples/demux_decode.c +++ b/doc/examples/demux_decode.c @@ -336,15 +336,16 @@ int main (int argc, char **argv) if (video_stream) { printf("Play the output video file with the command:\n" - "ffplay -f rawvideo -pix_fmt %s -video_size %dx%d %s\n", + "ffplay -f rawvideo -vf format=%s -video_size %dx%d %s\n", av_get_pix_fmt_name(pix_fmt), width, height, video_dst_filename); } if (audio_stream) { enum AVSampleFormat sfmt = audio_dec_ctx->sample_fmt; - int n_channels = audio_dec_ctx->ch_layout.nb_channels; + AVChannelLayout *ch_layout = &audio_dec_ctx->ch_layout; const char *fmt; + char buf[64]; if (av_sample_fmt_is_planar(sfmt)) { const char *packed = av_get_sample_fmt_name(sfmt); @@ -352,15 +353,18 @@ int main (int argc, char **argv) "(%s). This example will output the first channel only.\n", packed ? packed : "?"); sfmt = av_get_packed_sample_fmt(sfmt); - n_channels = 1; + ch_layout = &(AVChannelLayout)AV_CHANNEL_LAYOUT_MONO; } if ((ret = get_format_from_sample_fmt(&fmt, sfmt)) < 0) goto end; + if ((ret = av_channel_layout_describe(ch_layout, buf, sizeof(buf))) < 0) + goto end; + printf("Play the output audio file with the command:\n" - "ffplay -f %s -ac %d -ar %d %s\n", - fmt, n_channels, audio_dec_ctx->sample_rate, + "ffplay -f %s -ch_layout %s -ar %d %s\n", + fmt, buf, audio_dec_ctx->sample_rate, audio_dst_filename); } -- 2.49.1 _______________________________________________ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".