diff mbox series

[FFmpeg-devel] Request: consider use codec id "sowt" instead of "ipcm" for LPCM_S16LE in mp4 muxer

Message ID 39118c1b-50b2-7d8b-4df8-ca7619ef3878@josephcz.xyz
State New
Headers show
Series [FFmpeg-devel] Request: consider use codec id "sowt" instead of "ipcm" for LPCM_S16LE in mp4 muxer | expand

Checks

Context Check Description
andriy/configure_x86 warning Failed to apply patch

Commit Message

Joseph Chris May 24, 2023, 12:45 a.m. UTC
Hello,

I am writing this mail for request consider use codec id "sowt" instead 
of "ipcm" for AV_CODEC_ID_PCM_S16LE in mp4 muxer, and 
AV_CODEC_ID_PCM_S16BE accordingly. This only needs a minor change on code:



Many players like VLC and potplayer, can recognize "sowt", but they can 
not recognize "ipcm" or "lpcm" (lpcm is defined on mp4ra). Even ffmpeg 
it self (current git master, d81558) can't recognize it. So this change 
can improve compatibility and interoperability of ffmpeg.

This change is related to #9219 and #10185.

This change fails fate-mov-mp4-pcm but passes all other tests. 
fate-mov-mp4-pcm checks the MD5 of output file, as the codec id changes 
also makes the MD5 change. So we have to rewrite the test while changing 
the code.

Comments

Zhao Zhili May 24, 2023, 2:17 a.m. UTC | #1
> On May 24, 2023, at 08:45, Joseph Chris <joseph@josephcz.xyz> wrote:
> 
> Hello,
> 
> I am writing this mail for request consider use codec id "sowt" instead of "ipcm" for AV_CODEC_ID_PCM_S16LE in mp4 muxer, and AV_CODEC_ID_PCM_S16BE accordingly. This only needs a minor change on code:
> 
> diff --git a/libavformat/movenc.c b/libavformat/movenc.c
> index a9c8e104f0..2b984789f5 100644
> --- a/libavformat/movenc.c
> +++ b/libavformat/movenc.c
> @@ -7816,6 +7816,9 @@ static const AVCodecTag codec_mp4_tags[] = {
>      { AV_CODEC_ID_TTML,            MOV_MP4_TTML_TAG          },
>      { AV_CODEC_ID_TTML,            MOV_ISMV_TTML_TAG         },
> 
> +    // To improve compatibility
> +    { AV_CODEC_ID_PCM_S16BE,       MKTAG('t', 'w', 'o', 's') },
> +    { AV_CODEC_ID_PCM_S16LE,       MKTAG('s', 'o', 'w', 't') },
>      /* ISO/IEC 23003-5 integer formats */
>      { AV_CODEC_ID_PCM_S16BE,       MOV_MP4_IPCM_TAG          },
>      { AV_CODEC_ID_PCM_S16LE,       MOV_MP4_IPCM_TAG          },
> 

Nope, they are tags of quicktime format, not ISO base media file format.

> 
> Many players like VLC and potplayer, can recognize "sowt", but they can not recognize "ipcm" or "lpcm" (lpcm is defined on mp4ra). Even ffmpeg it self (current git master, d81558) can't recognize it. So this change can improve compatibility and interoperability of ffmpeg.

I can’t find d81558.

> 
> This change is related to #9219 and #10185.

They have been fixed. I will update the status.

> 
> This change fails fate-mov-mp4-pcm but passes all other tests. fate-mov-mp4-pcm checks the MD5 of output file, as the codec id changes also makes the MD5 change. So we have to rewrite the test while changing the code.
> _______________________________________________
> 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".
diff mbox series

Patch

diff --git a/libavformat/movenc.c b/libavformat/movenc.c
index a9c8e104f0..2b984789f5 100644
--- a/libavformat/movenc.c
+++ b/libavformat/movenc.c
@@ -7816,6 +7816,9 @@  static const AVCodecTag codec_mp4_tags[] = {
      { AV_CODEC_ID_TTML,            MOV_MP4_TTML_TAG          },
      { AV_CODEC_ID_TTML,            MOV_ISMV_TTML_TAG         },

+    // To improve compatibility
+    { AV_CODEC_ID_PCM_S16BE,       MKTAG('t', 'w', 'o', 's') },
+    { AV_CODEC_ID_PCM_S16LE,       MKTAG('s', 'o', 'w', 't') },
      /* ISO/IEC 23003-5 integer formats */
      { AV_CODEC_ID_PCM_S16BE,       MOV_MP4_IPCM_TAG          },
      { AV_CODEC_ID_PCM_S16LE,       MOV_MP4_IPCM_TAG          },