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] avformat/nsvdec: add support for STARDIVA format
@ 2023-01-09  1:05 Paul B Mahol
  0 siblings, 0 replies; only message in thread
From: Paul B Mahol @ 2023-01-09  1:05 UTC (permalink / raw)
  To: FFmpeg development discussions and patches

[-- Attachment #1: Type: text/plain, Size: 91 bytes --]

Hi,

patch attached.

Apparently the AAC PCE data and sample rate are not stored in files.

[-- Attachment #2: 0001-avformat-nsvdec-add-support-for-STARDIVA-format.patch --]
[-- Type: text/x-patch, Size: 2397 bytes --]

From c612389d5a19bd41bc7d4c58ed6a0c6722064d44 Mon Sep 17 00:00:00 2001
From: Paul B Mahol <onemda@gmail.com>
Date: Mon, 9 Jan 2023 01:57:29 +0100
Subject: [PATCH] avformat/nsvdec: add support for STARDIVA format

Signed-off-by: Paul B Mahol <onemda@gmail.com>
---
 libavformat/nsvdec.c | 18 ++++++++++++++++++
 1 file changed, 18 insertions(+)

diff --git a/libavformat/nsvdec.c b/libavformat/nsvdec.c
index 852e6194b0..b28576ea11 100644
--- a/libavformat/nsvdec.c
+++ b/libavformat/nsvdec.c
@@ -195,6 +195,7 @@ static const AVCodecTag nsv_codec_video_tags[] = {
     { AV_CODEC_ID_VP4, MKTAG('V', 'P', '4', '0') },
 */
     { AV_CODEC_ID_MPEG4, MKTAG('X', 'V', 'I', 'D') }, /* cf sample xvid decoder from nsv_codec_sdk.zip */
+    { AV_CODEC_ID_H264,  MKTAG('H', '2', '6', '4') },
     { AV_CODEC_ID_RAWVIDEO, MKTAG('R', 'G', 'B', '3') },
     { AV_CODEC_ID_NONE, 0 },
 };
@@ -203,6 +204,7 @@ static const AVCodecTag nsv_codec_audio_tags[] = {
     { AV_CODEC_ID_MP3,       MKTAG('M', 'P', '3', ' ') },
     { AV_CODEC_ID_AAC,       MKTAG('A', 'A', 'C', ' ') },
     { AV_CODEC_ID_AAC,       MKTAG('A', 'A', 'C', 'P') },
+    { AV_CODEC_ID_AAC,       MKTAG('A', 'A', 'V', ' ') },
     { AV_CODEC_ID_AAC,       MKTAG('V', 'L', 'B', ' ') },
     { AV_CODEC_ID_SPEEX,     MKTAG('S', 'P', 'X', ' ') },
     { AV_CODEC_ID_PCM_U16LE, MKTAG('P', 'C', 'M', ' ') },
@@ -461,6 +463,22 @@ static int nsv_parse_NSVs_header(AVFormatContext *s)
             st->codecpar->codec_tag = atag;
             st->codecpar->codec_id = ff_codec_get_id(nsv_codec_audio_tags, atag);
 
+            if (atag == MKTAG('A', 'A', 'V', ' ')) {
+                static const uint8_t aav_pce[] = {
+                    0x12, 0x00, 0x05, 0x08, 0x48, 0x00,
+                    0x20, 0x00, 0xC6, 0x40, 0x04, 0x4C,
+                    0x61, 0x76, 0x63, 0x56, 0xE5, 0x00,
+                    0x00, 0x00,
+                };
+                int ret;
+
+                if ((ret = ff_alloc_extradata(st->codecpar, sizeof(aav_pce))) < 0)
+                    return ret;
+
+                st->codecpar->sample_rate = 44100;
+                memcpy(st->codecpar->extradata, aav_pce, sizeof(aav_pce));
+            }
+
             ffstream(st)->need_parsing = AVSTREAM_PARSE_FULL; /* for PCM we will read a chunk later and put correct info */
 
             /* set timebase to common denominator of ms and framerate */
-- 
2.37.2


[-- Attachment #3: Type: text/plain, Size: 251 bytes --]

_______________________________________________
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] only message in thread

only message in thread, other threads:[~2023-01-09  1:06 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-01-09  1:05 [FFmpeg-devel] [PATCH] avformat/nsvdec: add support for STARDIVA format Paul B Mahol

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