Git Inbox Mirror of the ffmpeg-devel mailing list - see https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
 help / color / mirror / Atom feed
* [FFmpeg-devel] [PATCH 1/2] lavf/daudenc: clarify error messages
@ 2024-01-20 14:11 Stefano Sabatini
  2024-01-20 14:11 ` [FFmpeg-devel] [PATCH 2/2] doc/muxers: add daud Stefano Sabatini
  0 siblings, 1 reply; 2+ messages in thread
From: Stefano Sabatini @ 2024-01-20 14:11 UTC (permalink / raw)
  To: FFmpeg development discussions and patches; +Cc: Stefano Sabatini

---
 libavformat/daudenc.c | 18 ++++++++++++++++--
 1 file changed, 16 insertions(+), 2 deletions(-)

diff --git a/libavformat/daudenc.c b/libavformat/daudenc.c
index 2d84b16650..8e8bce8be3 100644
--- a/libavformat/daudenc.c
+++ b/libavformat/daudenc.c
@@ -25,8 +25,21 @@
 static int daud_init(struct AVFormatContext *s)
 {
     AVCodecParameters *par = s->streams[0]->codecpar;
-    if (par->ch_layout.nb_channels != 6 || par->sample_rate != 96000)
+
+    if (par->ch_layout.nb_channels != 6) {
+        av_log(s, AV_LOG_ERROR,
+               "Invalid number of channels %d, must be exactly 6\n",
+               par->ch_layout.nb_channels);
+        return AVERROR(EINVAL);
+    }
+
+    if (par->sample_rate != 96000) {
+        av_log(s, AV_LOG_ERROR,
+               "Invalid sample rate %d, must be 96000\n",
+               par->sample_rate);
         return AVERROR(EINVAL);
+    }
+
     return 0;
 }
 
@@ -34,7 +47,8 @@ static int daud_write_packet(struct AVFormatContext *s, AVPacket *pkt)
 {
     if (pkt->size > 65535) {
         av_log(s, AV_LOG_ERROR,
-               "Packet size too large for s302m. (%d > 65535)\n", pkt->size);
+               "Packet size %d too large for s302m, must be <= 65535)\n",
+               pkt->size);
         return AVERROR_INVALIDDATA;
     }
     avio_wb16(s->pb, pkt->size);
-- 
2.34.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".

^ permalink raw reply	[flat|nested] 2+ messages in thread

* [FFmpeg-devel] [PATCH 2/2] doc/muxers: add daud
  2024-01-20 14:11 [FFmpeg-devel] [PATCH 1/2] lavf/daudenc: clarify error messages Stefano Sabatini
@ 2024-01-20 14:11 ` Stefano Sabatini
  0 siblings, 0 replies; 2+ messages in thread
From: Stefano Sabatini @ 2024-01-20 14:11 UTC (permalink / raw)
  To: FFmpeg development discussions and patches; +Cc: Stefano Sabatini

---
 doc/muxers.texi | 26 ++++++++++++++++++++++++++
 1 file changed, 26 insertions(+)

diff --git a/doc/muxers.texi b/doc/muxers.texi
index a49853daf2..a9f2f6fe17 100644
--- a/doc/muxers.texi
+++ b/doc/muxers.texi
@@ -1312,6 +1312,32 @@ ffmpeg -re -i <input> -map 0 -map 0 -c:a libfdk_aac -c:v libx264 \
 -f dash /path/to/out.mpd
 @end example
 
+@section daud
+D-Cinema audio muxer.
+
+It accepts a single 6-channels audio stream resampled at 96000 Hz
+encoded with the @samp{pcm_24daud} codec.
+
+In addition, each muxed packet size must not be greater than 65535 bytes.
+
+@subsection Example
+Use @command{ffmpeg} to mux audio.
+
+The command convert the input audio to a @samp{5.1} channel layout
+resampled at 96000Hz:
+@example
+ffmpeg -i INPUT -af aresample=96000,pan=5.1,asetnsamples=3640 slow.302
+@end example
+
+The @samp{asetnsamples} filter is used to reduce the number of samples
+of each audio packet, with a size computed according to the formula:
+@example
+65535 / (@var{channels} * @var{encoded_sample_size}) = 655535 / (6 * 3) = 3640
+@end example
+
+The @var{encoded_sample_size} = 3 factor is due to sample size of the
+@samp{pcm_24daud} encoder.
+
 @anchor{fifo}
 @section fifo
 
-- 
2.34.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".

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2024-01-20 14:11 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-01-20 14:11 [FFmpeg-devel] [PATCH 1/2] lavf/daudenc: clarify error messages Stefano Sabatini
2024-01-20 14:11 ` [FFmpeg-devel] [PATCH 2/2] doc/muxers: add daud Stefano Sabatini

Git Inbox Mirror of the ffmpeg-devel mailing list - see https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

This inbox may be cloned and mirrored by anyone:

	git clone --mirror https://master.gitmailbox.com/ffmpegdev/0 ffmpegdev/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 ffmpegdev ffmpegdev/ https://master.gitmailbox.com/ffmpegdev \
		ffmpegdev@gitmailbox.com
	public-inbox-index ffmpegdev

Example config snippet for mirrors.


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git