[FFmpeg-user] Ghostly audio stream.
David Niklas
doark at mail.com
Sun Sep 6 19:59:58 EEST 2020
Hi guys,
I was having a problem with a ghost audio stream making it into the video
I was editing. I'm interesting is learning how it got their, and more
importantly, how to avoid this in the future.
% ffmpeg -version
Trailing options were found on the commandline.
ffmpeg version 3.2.15-0+deb9u1 Copyright (c) 2000-2020 the FFmpeg
developers built with gcc 6.3.0 (Debian 6.3.0-18+deb9u1) 20170516
configuration: --prefix=/usr --extra-version=0+deb9u1
--toolchain=hardened --libdir=/usr/lib/x86_64-linux-gnu
--incdir=/usr/include/x86_64-linux-gnu --enable-gpl --disable-stripping
--enable-avresample --enable-avisynth --enable-gnutls --enable-ladspa
--enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca
--enable-libcdio --enable-libebur128 --enable-libflite
--enable-libfontconfig --enable-libfreetype --enable-libfribidi
--enable-libgme --enable-libgsm --enable-libmp3lame --enable-libopenjpeg
--enable-libopenmpt --enable-libopus --enable-libpulse
--enable-librubberband --enable-libshine --enable-libsnappy
--enable-libsoxr --enable-libspeex --enable-libssh --enable-libtheora
--enable-libtwolame --enable-libvorbis --enable-libvpx
--enable-libwavpack --enable-libwebp --enable-libx265 --enable-libxvid
--enable-libzmq --enable-libzvbi --enable-omx --enable-openal
--enable-opengl --enable-sdl2 --enable-libdc1394 --enable-libiec61883
--enable-chromaprint --enable-frei0r --enable-libopencv --enable-libx264
--enable-shared libavutil 55. 34.101 / 55. 34.101 libavcodec 57.
64.101 / 57. 64.101 libavformat 57. 56.101 / 57. 56.101 libavdevice
57. 1.100 / 57. 1.100 libavfilter 6. 65.100 / 6. 65.100
libavresample 3. 1. 0 / 3. 1. 0 libswscale 4. 2.100 / 4.
2.100 libswresample 2. 3.100 / 2. 3.100 libpostproc 54. 1.100 /
54. 1.100
% mpv --version
mpv 0.23.0 (C) 2000-2016 mpv/MPlayer/mplayer2 projects
built on UNKNOWN
ffmpeg library versions:
libavutil 55.34.101
libavcodec 57.64.101
libavformat 57.56.101
libswscale 4.2.100
libavfilter 6.65.100
libswresample 2.3.100
ffmpeg version: 3.2.15-0+deb9u1
I wanted to remove the language from a YT video, so I saved it and edited
it in audacity.
Here's what the 2 streams I'm about to combine look like.
% ffprobe
Ode_2_Noobz_A_Halo_Reach_Noob_Song_Musical_Machinima-UpfteYLilek-2.mp4
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from
'Ode_2_Noobz_A_Halo_Reach_Noob_Song_Musical_Machinima-UpfteYLilek-2.mp4':
Metadata: major_brand : isom minor_version : 512
compatible_brands: isomiso2avc1mp41
encoder : Lavf57.56.101
Duration: 00:04:22.93, start: 0.000000, bitrate: 1651 kb/s
Stream #0:0(und): Video: h264 (Main) (avc1 / 0x31637661), yuv420p(tv,
bt709), 1280x720 [SAR 1:1 DAR 16:9], 1649 kb/s, 29.97 fps, 29.97 tbr, 30k
tbn, 59.94 tbc (default) Metadata: handler_name : VideoHandle
% ffprobe
Ode_2_Noobz_A_Halo_Reach_Noob_Song_Musical_Machinima-UpfteYLilek.flac
Input #0, flac, from 'Ode.flac': Duration: 00:04:22.94, start: 0.000000,
bitrate: 760 kb/s Stream #0:0: Audio: flac, 44100 Hz, stereo, s16
Here's the command I ran:
% ffmpeg -i Ode_2_Noobz_A_Halo_Reach_Noob_Song_Musical_Machinima-UpfteYLilek-2.mp4 -i Ode_2_Noobz_A_Halo_Reach_Noob_Song_Musical_Machinima-UpfteYLilek.flac -map 0:0 -map 1:0 -c:v copy -c:a opus -b:a 132K -to 00:02:56 Ode_2_Noobz_A_Halo_Reach_Noob_Song_Musical_Machinima-UpfteYLilek.mkv Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'Ode_2_Noobz_A_Halo_Reach_Noob_Song_Musical_Machinima-UpfteYLilek-2.mp4': Metadata: major_brand : isom minor_version : 512 compatible_brands: isomiso2avc1mp41
encoder : Lavf57.56.101
Duration: 00:04:22.93, start: 0.000000, bitrate: 1651 kb/s
Stream #0:0(und): Video: h264 (Main) (avc1 / 0x31637661), yuv420p(tv, bt709), 1280x720 [SAR 1:1 DAR 16:9], 1649 kb/s, 29.97 fps, 29.97 tbr, 30k tbn, 59.94 tbc (default)
Metadata:
handler_name : VideoHandler
Input #1, flac, from 'Ode_2_Noobz_A_Halo_Reach_Noob_Song_Musical_Machinima-UpfteYLilek.flac':
Duration: 00:04:22.94, start: 0.000000, bitrate: 760 kb/s
Stream #1:0: Audio: flac, 44100 Hz, stereo, s16
File 'Ode_2_Noobz_A_Halo_Reach_Noob_Song_Musical_Machinima-UpfteYLilek.mkv' already exists. Overwrite ? [y/N] y
Output #0, matroska, to 'Ode_2_Noobz_A_Halo_Reach_Noob_Song_Musical_Machinima-UpfteYLilek.mkv':
Metadata:
major_brand : isom
minor_version : 512
compatible_brands: isomiso2avc1mp41
encoder : Lavf57.56.101
Stream #0:0(und): Video: h264 (Main) (avc1 / 0x31637661), yuv420p(tv, bt709), 1280x720 [SAR 1:1 DAR 16:9], q=2-31, 1649 kb/s, 29.97 fps, 29.97 tbr, 1k tbn, 30k tbc (default)
Metadata:
handler_name : VideoHandler
Stream #0:1: Audio: opus (libopus) ([255][255][255][255] / 0xFFFFFFFF), 48000 Hz, stereo, s16, 132 kb/s
Metadata:
encoder : Lavc57.64.101 libopus
Stream mapping:
Stream #0:0 -> #0:0 (copy)
Stream #1:0 -> #0:1 (flac (native) -> opus (libopus))
Press [q] to stop, [?] for help
frame= 5276 fps=1463 q=-1.0 Lsize= 37356kB time=00:02:56.01 bitrate=1738.6kbits/s speed=48.8x
video:34397kB audio:2855kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 0.278336%
%
The file I got out I opened with mpv. Mpv used what it called an
"external audio track". This was the flac file that had the updated
audio. I switched it to the included internal audio in the file and it
was the original audio track!!!
Eventually, I renamed the new flac audio track to Ode.flac and then fed it
to ffmpeg. This worked in getting exactly one audio track into the file.
Where did the original audio track come from?
I "-map"ed the streams so I shouldn't have more or different tracks then
I requested. Especially because I deleted the original audio track.
How do I prevent this from happening again?
Thanks,
David
More information about the ffmpeg-user
mailing list