2
I'm trying to denoise the audio in a video. I've determined that this isn't really possible in ffmpeg, so I've extracted the audio from the video this way.
$ ffmpeg -i found1-1.mp4 audio.mp3
$ ffmpeg -i found1-1.mp4 -an -c:v copy videomute.mp4
I then cleaned up the audio in an external program and I'd like to now recombine it with the video file. This is where things break down for me. WHen I recombine the audio with the video with the following command, the audio is not present (nor is the volume slider) in quicktime. It IS however present when I play the movie with VLC ffplay.
ffmpeg -i clean_audio.mp3 -i videomute.mp4 -acodec copy -vcodec copy output.mp4
I thought it might be something with the audio file but it turns out the original audio doesn't work either in quicktime.
ffmpeg -i orig_audio.mp3 -i videomute.mp4 -acodec copy -vcodec copy output.mp4
What's going on? My concern is that something is wrong with the encoding of the video, and that since I make a comercial product, some of my users will not be able to hear the audio properly in some players. What am I doing wrong?
Some additional cli info that might be useful:
my_user@bens.local 09:40 AM /Volumes/ben_lib_red_external_drive/storage/idance/resources_master/lessons/raw_source/skippy_blair/tmp >
$ ffprobe found1-1.mp4
ffprobe version 2.2.1 Copyright (c) 2007-2014 the FFmpeg developers
built on Jun 5 2014 19:48:42 with Apple LLVM version 5.1 (clang-503.0.38) (based on LLVM 3.4svn)
configuration: --prefix=/usr/local/Cellar/ffmpeg/2.2.1 --enable-shared --enable-pthreads --enable-gpl --enable-version3 --enable-nonfree --enable-hardcoded-tables --enable-avresample --enable-vda --cc=clang --host-cflags= --host-ldflags= --enable-libx264 --enable-libfaac --enable-libmp3lame --enable-libxvid --enable-libfreetype --enable-libtheora --enable-libvorbis --enable-libass --enable-ffplay
libavutil 52. 66.100 / 52. 66.100
libavcodec 55. 52.102 / 55. 52.102
libavformat 55. 33.100 / 55. 33.100
libavdevice 55. 10.100 / 55. 10.100
libavfilter 4. 2.100 / 4. 2.100
libavresample 1. 2. 0 / 1. 2. 0
libswscale 2. 5.102 / 2. 5.102
libswresample 0. 18.100 / 0. 18.100
libpostproc 52. 3.100 / 52. 3.100
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'found1-1.mp4':
Metadata:
major_brand : mp42
minor_version : 0
compatible_brands: mp42isomavc1
creation_time : 2014-09-15 18:23:44
encoder : HandBrake 0.9.9 2013052900
Duration: 00:59:36.47, start: 0.000000, bitrate: 876 kb/s
Stream #0:0(und): Video: h264 (Main) (avc1 / 0x31637661), yuv420p(tv, smpte170m), 720x544, 725 kb/s, 29.97 fps, 29.97 tbr, 90k tbn, 180k tbc (default)
Metadata:
creation_time : 2014-09-15 18:23:44
Stream #0:1(und): Audio: aac (mp4a / 0x6134706D), 48000 Hz, stereo, fltp, 145 kb/s (default)
Metadata:
creation_time : 2014-09-15 18:23:44
my_user@bens.local 09:40 AM /Volumes/ben_lib_red_external_drive/storage/idance/resources_master/lessons/raw_source/skippy_blair/tmp >
$ ffmpeg -i found1-1.mp4 audio.mp3
ffmpeg version 2.2.1 Copyright (c) 2000-2014 the FFmpeg developers
built on Jun 5 2014 19:48:42 with Apple LLVM version 5.1 (clang-503.0.38) (based on LLVM 3.4svn)
configuration: --prefix=/usr/local/Cellar/ffmpeg/2.2.1 --enable-shared --enable-pthreads --enable-gpl --enable-version3 --enable-nonfree --enable-hardcoded-tables --enable-avresample --enable-vda --cc=clang --host-cflags= --host-ldflags= --enable-libx264 --enable-libfaac --enable-libmp3lame --enable-libxvid --enable-libfreetype --enable-libtheora --enable-libvorbis --enable-libass --enable-ffplay
libavutil 52. 66.100 / 52. 66.100
libavcodec 55. 52.102 / 55. 52.102
libavformat 55. 33.100 / 55. 33.100
libavdevice 55. 10.100 / 55. 10.100
libavfilter 4. 2.100 / 4. 2.100
libavresample 1. 2. 0 / 1. 2. 0
libswscale 2. 5.102 / 2. 5.102
libswresample 0. 18.100 / 0. 18.100
libpostproc 52. 3.100 / 52. 3.100
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'found1-1.mp4':
Metadata:
major_brand : mp42
minor_version : 0
compatible_brands: mp42isomavc1
creation_time : 2014-09-15 18:23:44
encoder : HandBrake 0.9.9 2013052900
Duration: 00:59:36.47, start: 0.000000, bitrate: 876 kb/s
Stream #0:0(und): Video: h264 (Main) (avc1 / 0x31637661), yuv420p(tv, smpte170m), 720x544, 725 kb/s, 29.97 fps, 29.97 tbr, 90k tbn, 180k tbc (default)
Metadata:
creation_time : 2014-09-15 18:23:44
Stream #0:1(und): Audio: aac (mp4a / 0x6134706D), 48000 Hz, stereo, fltp, 145 kb/s (default)
Metadata:
creation_time : 2014-09-15 18:23:44
File 'audio.mp3' already exists. Overwrite ? [y/N] y
Output #0, mp3, to 'audio.mp3':
Metadata:
major_brand : mp42
minor_version : 0
compatible_brands: mp42isomavc1
TSSE : Lavf55.33.100
Stream #0:0(und): Audio: mp3 (libmp3lame), 48000 Hz, stereo, fltp (default)
Metadata:
creation_time : 2014-09-15 18:23:44
Stream mapping:
Stream #0:1 -> #0:0 (aac -> libmp3lame)
Press [q] to stop, [?] for help
size= 55880kB time=00:59:36.28 bitrate= 128.0kbits/s
video:0kB audio:55880kB subtitle:0 data:0 global headers:0kB muxing overhead 0.000584%
my_user@bens.local 09:46 AM /Volumes/ben_lib_red_external_drive/storage/idance/resources_master/lessons/raw_source/skippy_blair/tmp >
$ ffmpeg -i audio.mp3 -i videomute.mp4 -acodec copy -vcodec copy output.mp4
ffmpeg version 2.2.1 Copyright (c) 2000-2014 the FFmpeg developers
built on Jun 5 2014 19:48:42 with Apple LLVM version 5.1 (clang-503.0.38) (based on LLVM 3.4svn)
configuration: --prefix=/usr/local/Cellar/ffmpeg/2.2.1 --enable-shared --enable-pthreads --enable-gpl --enable-version3 --enable-nonfree --enable-hardcoded-tables --enable-avresample --enable-vda --cc=clang --host-cflags= --host-ldflags= --enable-libx264 --enable-libfaac --enable-libmp3lame --enable-libxvid --enable-libfreetype --enable-libtheora --enable-libvorbis --enable-libass --enable-ffplay
libavutil 52. 66.100 / 52. 66.100
libavcodec 55. 52.102 / 55. 52.102
libavformat 55. 33.100 / 55. 33.100
libavdevice 55. 10.100 / 55. 10.100
libavfilter 4. 2.100 / 4. 2.100
libavresample 1. 2. 0 / 1. 2. 0
libswscale 2. 5.102 / 2. 5.102
libswresample 0. 18.100 / 0. 18.100
libpostproc 52. 3.100 / 52. 3.100
Input #0, mp3, from 'audio.mp3':
Metadata:
major_brand : mp42
minor_version : 0
compatible_brands: mp42isomavc1
encoder : Lavf55.33.100
Duration: 00:59:36.29, start: 0.023021, bitrate: 128 kb/s
Stream #0:0: Audio: mp3, 48000 Hz, stereo, s16p, 128 kb/s
Input #1, mov,mp4,m4a,3gp,3g2,mj2, from 'videomute.mp4':
Metadata:
major_brand : isom
minor_version : 512
compatible_brands: isomiso2avc1mp41
encoder : Lavf55.33.100
Duration: 00:59:36.47, start: 0.000000, bitrate: 728 kb/s
Stream #1:0(und): Video: h264 (Main) (avc1 / 0x31637661), yuv420p(tv, smpte170m), 720x544, 725 kb/s, 29.97 fps, 29.97 tbr, 90k tbn, 180k tbc (default)
Metadata:
handler_name : VideoHandler
Output #0, mp4, to 'output.mp4':
Metadata:
major_brand : mp42
minor_version : 0
compatible_brands: mp42isomavc1
encoder : Lavf55.33.100
Stream #0:0(und): Video: h264 ([33][0][0][0] / 0x0021), yuv420p, 720x544, q=2-31, 725 kb/s, 29.97 fps, 90k tbn, 90k tbc (default)
Metadata:
handler_name : VideoHandler
Stream #0:1: Audio: mp3 (i[0][0][0] / 0x0069), 48000 Hz, stereo, 128 kb/s
Stream mapping:
Stream #1:0 -> #0:0 (copy)
Stream #0:0 -> #0:1 (copy)
Press [q] to stop, [?] for help
frame=107183 fps=10105 q=-1.0 Lsize= 375652kB time=00:59:36.30 bitrate= 860.5kbits/s
video:316698kB audio:55880kB subtitle:0 data:0 global headers:0kB muxing overhead 0.825099%
my_user@bens.local 09:48 AM /Volumes/ben_lib_red_external_drive/storage/idance/resources_master/lessons/raw_source/skippy_blair/tmp >
$ ffprobe output.mp4
ffprobe version 2.2.1 Copyright (c) 2007-2014 the FFmpeg developers
built on Jun 5 2014 19:48:42 with Apple LLVM version 5.1 (clang-503.0.38) (based on LLVM 3.4svn)
configuration: --prefix=/usr/local/Cellar/ffmpeg/2.2.1 --enable-shared --enable-pthreads --enable-gpl --enable-version3 --enable-nonfree --enable-hardcoded-tables --enable-avresample --enable-vda --cc=clang --host-cflags= --host-ldflags= --enable-libx264 --enable-libfaac --enable-libmp3lame --enable-libxvid --enable-libfreetype --enable-libtheora --enable-libvorbis --enable-libass --enable-ffplay
libavutil 52. 66.100 / 52. 66.100
libavcodec 55. 52.102 / 55. 52.102
libavformat 55. 33.100 / 55. 33.100
libavdevice 55. 10.100 / 55. 10.100
libavfilter 4. 2.100 / 4. 2.100
libavresample 1. 2. 0 / 1. 2. 0
libswscale 2. 5.102 / 2. 5.102
libswresample 0. 18.100 / 0. 18.100
libpostproc 52. 3.100 / 52. 3.100
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'output.mp4':
Metadata:
major_brand : isom
minor_version : 512
compatible_brands: isomiso2avc1mp41
encoder : Lavf55.33.100
Duration: 00:59:36.47, start: 0.023021, bitrate: 860 kb/s
Stream #0:0(und): Video: h264 (Main) (avc1 / 0x31637661), yuv420p(tv, smpte170m), 720x544, 725 kb/s, 29.97 fps, 29.97 tbr, 90k tbn, 180k tbc (default)
Metadata:
handler_name : VideoHandler
Stream #0:1(und): Audio: mp3 (mp4a / 0x6134706D), 48000 Hz, stereo, s16p, 128 kb/s (default)
Metadata:
handler_name : SoundHandler
ockquote>
"it turns out the original audio doesn't work either in quicktime." If the original audio file doesn't play in QuickTime, how should muxing with
– llogan – 2014-09-22T21:38:26.400ffmpeg
provide a playable output?Your reading is not quite what is meant. If you look at the following command, it's clear that I meant that re-combining the original audio (not the cleaned audio) doesn't result in a playable file either. – pixelearth – 2014-09-22T22:35:13.630
Do you have any MP4 files that contain MP3 audio that work in QuickTime? – llogan – 2014-09-22T22:51:18.277