Opened 11 years ago

Closed 8 years ago

#3163 closed defect (worksforme)

Broadcast Wave Metadata not carried over with -codec:a copy

Reported by: Andrew Hunter Owned by:
Priority: normal Component: avformat
Version: git-master Keywords: wav
Cc: Blocked By:
Blocking: Reproduced by developer: no
Analyzed by developer: no

Description (last modified by Carl Eugen Hoyos)

Timecode and Framerate metadata is not carried over when using -codec:a copy from one wav to another. This results in being unable to trim a file and keep the timecode metadata required for post-production.

The metadata is listed in the output section of ffmpeg but not by ffprobe or Davinci Resolve. I have highlighted in bold the differing lines.

Attached are samples of the input and output of the file.

PS D:\Projects\CMU Video\Sound> ffmpeg -i .\COMP20T02.WAV -codec:a copy .\COMP20T02_ffmpeg.WAV
ffmpeg version N-58338-gfb7d70c Copyright (c) 2000-2013 the FFmpeg developers
  built on Nov 21 2013 20:11:19 with gcc 4.8.2 (GCC)
  configuration: --disable-static --enable-shared --enable-gpl --enable-version3 --disable-w32threads --enable-avisynth
--enable-bzlib --enable-fontconfig --enable-frei0r --enable-gnutls --enable-iconv --enable-libass --enable-libbluray --e
nable-libcaca --enable-libfreetype --enable-libgsm --enable-libilbc --enable-libmodplug --enable-libmp3lame --enable-lib
opencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-libopus --enable-librtmp --enable-libschroedinge
r --enable-libsoxr --enable-libspeex --enable-libtheora --enable-libtwolame --enable-libvidstab --enable-libvo-aacenc --
enable-libvo-amrwbenc --enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libx264 --enable-libxavs --enable-
libxvid --enable-zlib
  libavutil      52. 53.100 / 52. 53.100
  libavcodec     55. 44.100 / 55. 44.100
  libavformat    55. 21.100 / 55. 21.100
  libavdevice    55.  5.100 / 55.  5.100
  libavfilter     3. 91.100 /  3. 91.100
  libswscale      2.  5.101 /  2.  5.101
  libswresample   0. 17.104 /  0. 17.104
  libpostproc    52.  3.100 / 52.  3.100
Guessed Channel Layout for  Input Stream #0.0 : stereo
Input #0, wav, from '.\COMP20T02.WAV':
  Metadata:
    comment         : sSPEED=023.976-ND
                    : sTAKE=02
                    : sUBITS=$21111300
                    : sSWVER=1.04.09
                    : sSCENE=COMP20
                    : sFILENAME=COMP20T02.WAV
                    : sTAPE=131121
                    : sCIRCLED=FALSE
                    : sTRK1=MixL
                    : sTRK2=MixR
                    : sNOTE=
                    :
    encoded_by      : Sound Dev: Mix664 S#KA0513012001
    originator_reference: USSDVKA0513012001131121IR6sb  01
    date            : 2013-11-21
    creation_time   : 18:27:12
    time_reference  : 3015876865
    coding_history  : A=PCM,F=48000,W=24,M=stereo,R=48000,T=2Ch
                    :
  Duration: 00:00:57.06, bitrate: 2304 kb/s
    Stream #0:0: Audio: pcm_s24le ([1][0][0][0] / 0x0001), 48000 Hz, stereo, s32, 2304 kb/s
Output #0, wav, to '.\COMP20T02_ffmpeg.WAV':
  Metadata:
    ICMT            : sSPEED=023.976-ND
                    : sTAKE=02
                    : sUBITS=$21111300
                    : sSWVER=1.04.09
                    : sSCENE=COMP20
                    : sFILENAME=COMP20T02.WAV
                    : sTAPE=131121
                    : sCIRCLED=FALSE
                    : sTRK1=MixL
                    : sTRK2=MixR
                    : sNOTE=
                    :
    ITCH            : Sound Dev: Mix664 S#KA0513012001
    originator_reference: USSDVKA0513012001131121IR6sb  01
    ICRD            : 2013-11-21
    coding_history  : A=PCM,F=48000,W=24,M=stereo,R=48000,T=2 Ch
                    :
    time_reference  : 3015876865
    ISFT            : Lavf55.21.100
    Stream #0:0: Audio: pcm_s24le ([1][0][0][0] / 0x0001), 48000 Hz, stereo, 2304 kb/s
Stream mapping:
  Stream #0:0 -> #0:0 (copy)
Press [q] to stop, [?] for help
size=   16048kB time=00:00:57.05 bitrate=2304.0kbits/s
video:0kB audio:16047kB subtitle:0 global headers:0kB muxing overhead 0.002057%
PS D:\Projects\CMU Video\Sound> ffmpeg -i .\COMP20T02.WAV -t 10 -codec:a copy .\COMP20T02_ffmpeg_trim.WAV
ffmpeg version N-58338-gfb7d70c Copyright (c) 2000-2013 the FFmpeg developers
  built on Nov 21 2013 20:11:19 with gcc 4.8.2 (GCC)
  configuration: --disable-static --enable-shared --enable-gpl --enable-version3 --disable-w32threads --enable-avisynth
--enable-bzlib --enable-fontconfig --enable-frei0r --enable-gnutls --enable-iconv --enable-libass --enable-libbluray --e
nable-libcaca --enable-libfreetype --enable-libgsm --enable-libilbc --enable-libmodplug --enable-libmp3lame --enable-lib
opencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-libopus --enable-librtmp --enable-libschroedinge
r --enable-libsoxr --enable-libspeex --enable-libtheora --enable-libtwolame --enable-libvidstab --enable-libvo-aacenc --
enable-libvo-amrwbenc --enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libx264 --enable-libxavs --enable-
libxvid --enable-zlib
  libavutil      52. 53.100 / 52. 53.100
  libavcodec     55. 44.100 / 55. 44.100
  libavformat    55. 21.100 / 55. 21.100
  libavdevice    55.  5.100 / 55.  5.100
  libavfilter     3. 91.100 /  3. 91.100
  libswscale      2.  5.101 /  2.  5.101
  libswresample   0. 17.104 /  0. 17.104
  libpostproc    52.  3.100 / 52.  3.100
Guessed Channel Layout for  Input Stream #0.0 : stereo
Input #0, wav, from '.\COMP20T02.WAV':
  Metadata:
    comment         : sSPEED=023.976-ND
                    : sTAKE=02
                    : sUBITS=$21111300
                    : sSWVER=1.04.09
                    : sSCENE=COMP20
                    : sFILENAME=COMP20T02.WAV
                    : sTAPE=131121
                    : sCIRCLED=FALSE
                    : sTRK1=MixL
                    : sTRK2=MixR
                    : sNOTE=
                    :
    encoded_by      : Sound Dev: Mix664 S#KA0513012001
    originator_reference: USSDVKA0513012001131121IR6sb  01
    date            : 2013-11-21
    creation_time   : 18:27:12
    time_reference  : 3015876865
    coding_history  : A=PCM,F=48000,W=24,M=stereo,R=48000,T=2 Ch
                    :
  Duration: 00:00:57.06, bitrate: 2304 kb/s
    Stream #0:0: Audio: pcm_s24le ([1][0][0][0] / 0x0001), 48000 Hz, stereo, s32, 2304 kb/s
Output #0, wav, to '.\COMP20T02_ffmpeg_trim.WAV':
  Metadata:
    ICMT            : sSPEED=023.976-ND
                    : sTAKE=02
                    : sUBITS=$21111300
                    : sSWVER=1.04.09
                    : sSCENE=COMP20
                    : sFILENAME=COMP20T02.WAV
                    : sTAPE=131121
                    : sCIRCLED=FALSE
                    : sTRK1=MixL
                    : sTRK2=MixR
                    : sNOTE=
                    :
    ITCH            : Sound Dev: Mix664 S#KA0513012001
    originator_reference: USSDVKA0513012001131121IR6sb  01
    ICRD            : 2013-11-21
    coding_history  : A=PCM,F=48000,W=24,M=stereo,R=48000,T=2 Ch
                    :
    time_reference  : 3015876865
    ISFT            : Lavf55.21.100
    Stream #0:0: Audio: pcm_s24le ([1][0][0][0] / 0x0001), 48000 Hz, stereo, 2304 kb/s
Stream mapping:
  Stream #0:0 -> #0:0 (copy)
Press [q] to stop, [?] for help
size=    2814kB time=00:00:10.00 bitrate=2304.3kbits/s
video:0kB audio:2813kB subtitle:0 global headers:0kB muxing overhead 0.011733%


PS D:\Projects\CMU Video\FFMPEG_Trim_test> ffprobe .\COMP20T02_ffmpeg.WAV
ffprobe version N-58338-gfb7d70c Copyright (c) 2007-2013 the FFmpeg developers
  built on Nov 21 2013 20:11:19 with gcc 4.8.2 (GCC)
  configuration: --disable-static --enable-shared --enable-gpl --enable-version3 --disable-w32threads --enable-avisynth
--enable-bzlib --enable-fontconfig --enable-frei0r --enable-gnutls --enable-iconv --enable-libass --enable-libbluray --e
nable-libcaca --enable-libfreetype --enable-libgsm --enable-libilbc --enable-libmodplug --enable-libmp3lame --enable-lib
opencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-libopus --enable-librtmp --enable-libschroedinge
r --enable-libsoxr --enable-libspeex --enable-libtheora --enable-libtwolame --enable-libvidstab --enable-libvo-aacenc --
enable-libvo-amrwbenc --enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libx264 --enable-libxavs --enable-
libxvid --enable-zlib
  libavutil      52. 53.100 / 52. 53.100
  libavcodec     55. 44.100 / 55. 44.100
  libavformat    55. 21.100 / 55. 21.100
  libavdevice    55.  5.100 / 55.  5.100
  libavfilter     3. 91.100 /  3. 91.100
  libswscale      2.  5.101 /  2.  5.101
  libswresample   0. 17.104 /  0. 17.104
  libpostproc    52.  3.100 / 52.  3.100
Input #0, wav, from '.\COMP20T02_ffmpeg.WAV':
  Metadata:
    comment         : sSPEED=023.976-ND
                    : sTAKE=02
                    : sUBITS=$21111300
                    : sSWVER=1.04.09
                    : sSCENE=COMP20
                    : sFILENAME=COMP20T02.WAV
                    : sTAPE=131121
                    : sCIRCLED=FALSE
                    : sTRK1=MixL
                    : sTRK2=MixR
                    : sNOTE=
                    :
    date            : 2013-11-21
    encoder         : Lavf55.21.100
    encoded_by      : Sound Dev: Mix664 S#KA0513012001
  Duration: 00:00:57.06, bitrate: 2304 kb/s
    Stream #0:0: Audio: pcm_s24le ([1][0][0][0] / 0x0001), 48000 Hz, stereo, s32, 2304 kb/s

PS D:\Projects\CMU Video\FFMPEG_Trim_test> ffprobe .\COMP2T02.WAV
ffprobe version N-58338-gfb7d70c Copyright (c) 2007-2013 the FFmpeg developers
  built on Nov 21 2013 20:11:19 with gcc 4.8.2 (GCC)
  configuration: --disable-static --enable-shared --enable-gpl --enable-version3 --disable-w32threads --enable-avisynth
--enable-bzlib --enable-fontconfig --enable-frei0r --enable-gnutls --enable-iconv --enable-libass --enable-libbluray --e
nable-libcaca --enable-libfreetype --enable-libgsm --enable-libilbc --enable-libmodplug --enable-libmp3lame --enable-lib
opencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-libopus --enable-librtmp --enable-libschroedinge
r --enable-libsoxr --enable-libspeex --enable-libtheora --enable-libtwolame --enable-libvidstab --enable-libvo-aacenc --
enable-libvo-amrwbenc --enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libx264 --enable-libxavs --enable-
libxvid --enable-zlib
  libavutil      52. 53.100 / 52. 53.100
  libavcodec     55. 44.100 / 55. 44.100
  libavformat    55. 21.100 / 55. 21.100
  libavdevice    55.  5.100 / 55.  5.100
  libavfilter     3. 91.100 /  3. 91.100
  libswscale      2.  5.101 /  2.  5.101
  libswresample   0. 17.104 /  0. 17.104
  libpostproc    52.  3.100 / 52.  3.100
Input #0, wav, from '.\COMP2T02.WAV':
  Metadata:
    comment         : sSPEED=023.976-ND
                    : sTAKE=02
                    : sUBITS=$00000000
                    : sSWVER=1.04.09
                    : sSCENE=COMP2
                    : sFILENAME=COMP2T02.WAV
                    : sTAPE=131121
                    : sCIRCLED=FALSE
                    : sTRK1=MixL
                    : sTRK2=MixR
                    : sTRK3=Boom
                    : sTRK5=LAV2
                    : sNOTE=ROOMTONE
                    :
    encoded_by      : Sound Dev: Mix664 S#KA0513012001
    originator_reference: USSDVKA0513012001131121AaKs8  01
    date            : 2013-11-21
    creation_time   : 10:36:40
    time_reference  : 47663617
    coding_history  : A=PCM,F=48000,W=24,M=multi,R=48000,T=4 Ch
                    :
  Duration: 00:00:28.03, bitrate: 4609 kb/s
    Stream #0:0: Audio: pcm_s24le ([1][0][0][0] / 0x0001), 48000 Hz, 4 channels, s32, 4608 kb/s

Change History (7)

comment:1 by Andrew Hunter, 11 years ago

Sample files available here: http://files.aehunter.net/FFmpeg%20BWF/

comment:2 by Carl Eugen Hoyos, 11 years ago

Component: FFmpegavformat
Description: modified (diff)
Keywords: wav added; timecode BWF audio removed

[18:46] <rexbron> what is the ffmpeg ftp server for samples?

Where did you search for an answer? How did you find out about this bug tracker?

Is the problem not reproducible with 1MB wav files?

comment:3 by Andrew Hunter, 11 years ago

Hi cehoyos,

I found the address and a link to the tracker on the ffmpeg site but but the ftp client complained that files with the same name already existed. It's very likely something on my end but I can't be bothered to mess around and figure it out, hence why samples were uploaded to servers I have.

I do not have access to the recorder, the files were provided to me from a documentary shoot and I uploaded the smallest sample I have. I would expect it to be reproduce able with 1Mb files.

comment:4 by Carl Eugen Hoyos, 11 years ago

Yes, you had uploaded fragments of the original files.

Do you know which parts of the metadata are missing in the output files or are you just guessing that the different metadata in the output of ffmpeg -i is the reason that the output files cannot be used for post-production?

comment:5 by Andrew Hunter, 11 years ago

The metadata sections that I hilighted are an educated guess, as both FFprobe and Davinci Resolve see frame rate and timecode metadata in the recorder originals and not in files processed by ffmpeg.

It is crucial that the timecode in the BWF is maintained.

comment:6 by Elon Musk, 8 years ago

Should be

ffmpeg -i COMP2T02.WAV -c:a copy -write_bext 1 out.wav

comment:7 by Elon Musk, 8 years ago

Resolution: worksforme
Status: newclosed

Feel free to reopen if above command does not work.

Note: See TracTickets for help on using tickets.