[FFmpeg-user] Replacing audio track failing

JULIAN GARDNER joolzg at btinternet.com
Mon Dec 3 17:17:44 CET 2012


Im trying to fix the audio levels of my video files using sox to normalize but im having a few problems, in 3 steaps

Script
                $FFMPEG -i "$file" -vn -y extracted.wav
                echo Now Normalizing the audio
                $SOX extracted.wav normal.wav -V3
                echo Now converting "$file" to "$tsfile"
               
 $FFMPEG -threads 0 -i "$file" -i normal.wav -map 0:0 -map 1 -vcodec 
libx264 -preset superfast -x264opts keyint=75 -x264opts vbv-maxrate=900 
-vf scale=720:288 -bufsize 2M -r 25 -acodec libfaac -ab 128k -ar 32k -ac
 2 -async 1 -f mpegts "$DEST_DIR/$tsfile"

Step 1
Now extracting audio from /mnt/media1/Jukebox_upload/Front 242 - Headhunter.mpg
ffmpeg version N-44994-gf077e1f Copyright (c) 2000-2012 the FFmpeg developers
  built on Oct  3 2012 00:15:57 with gcc 4.6.1 (Ubuntu/Linaro 4.6.1-9ubuntu3)
  configuration: --enable-gpl --enable-version3 --enable-nonfree --enable-postproc --enable-libfaac --enable-libmp3lame --enable-libx264
  libavutil      51. 73.101 / 51. 73.101
  libavcodec     54. 63.100 / 54. 63.100
  libavformat    54. 29.105 / 54. 29.105
  libavdevice    54.  3.100 / 54.  3.100
  libavfilter     3. 19.102 /  3. 19.102
  libswscale      2.  1.101 /  2.  1.101
  libswresample   0. 16.100 /  0. 16.100
  libpostproc    52.  1.100 / 52.  1.100
[mpeg @ 0x30fb240] max_analyze_duration 5000000 reached at 5005000
Input #0, mpeg, from '/mnt/media1/Jukebox_upload/Front 242 - Headhunter.mpg':
  Duration: 00:03:21.03, start: 0.659989, bitrate: 1394 kb/s
    Stream #0:0[0x1e0]: Video: mpeg1video, yuv420p, 352x240 [SAR 200:219 DAR 880:657], 1150 kb/s, 29.97 fps, 29.97 tbr, 90k tbn, 29.97 tbc
    Stream #0:1[0x1c0]: Audio: mp2, 44100 Hz, stereo, s16, 224 kb/s
Output #0, wav, to 'extracted.wav':
  Metadata:
    encoder         : Lavf54.29.105
    Stream #0:0: Audio: pcm_s16le ([1][0][0][0] / 0x0001), 44100 Hz, stereo, s16, 1411 kb/s
Stream mapping:
  Stream #0:1 -> #0:0 (mp2 -> pcm_s16le)
Press [q] to stop, [?] for help
incomplete frametime=00:02:36.21 bitrate=1409.6kbits/s
Error while decoding stream #0:1: Invalid data found when processing input
size=   34547kB time=00:03:20.54 bitrate=1411.2kbits/s
video:0kB audio:34546kB subtitle:0 global headers:0kB muxing overhead 0.000130%

Step 2
/usr/bin/sox: SoX v14.3.1
/usr/bin/sox INFO formats: detected file format type `wav'

Input File     : 'extracted.wav'
Channels       : 2
Sample Rate    : 44100
Precision      : 16-bit
Duration       : 00:03:20.54 = 8843904 samples = 15040.7 CDDA sectors
File Size      : 35.4M
Bit Rate       : 1.41M
Sample Encoding: 16-bit Signed Integer PCM
Endian Type    : little
Reverse Nibbles: no
Reverse Bits   : no

/usr/bin/sox INFO sox: Overwriting `normal.wav'

Output File    : 'normal.wav'
Channels       : 2
Sample Rate    : 44100
Precision      : 16-bit
Duration       : 00:03:20.54 = 8843904 samples = 15040.7 CDDA sectors
Sample Encoding: 16-bit Signed Integer PCM
Endian Type    : little
Reverse Nibbles: no
Reverse Bits   : no
Comment        : 'Processed by SoX'

/usr/bin/sox INFO sox: effects chain: input      44100Hz 2 channels
/usr/bin/sox INFO sox: effects chain: output     44100Hz 2 channels

Step 3
Now converting /mnt/media1/Jukebox_upload/Front 242 - Headhunter.mpg to Front 242 - Headhunter.ts
ffmpeg version N-44994-gf077e1f Copyright (c) 2000-2012 the FFmpeg developers
  built on Oct  3 2012 00:15:57 with gcc 4.6.1 (Ubuntu/Linaro 4.6.1-9ubuntu3)
  configuration: --enable-gpl --enable-version3 --enable-nonfree --enable-postproc --enable-libfaac --enable-libmp3lame --enable-libx264
  libavutil      51. 73.101 / 51. 73.101
  libavcodec     54. 63.100 / 54. 63.100
  libavformat    54. 29.105 / 54. 29.105
  libavdevice    54.  3.100 / 54.  3.100
  libavfilter     3. 19.102 /  3. 19.102
  libswscale      2.  1.101 /  2.  1.101
  libswresample   0. 16.100 /  0. 16.100
  libpostproc    52.  1.100 / 52.  1.100
[mpeg @ 0x19ed340] max_analyze_duration 5000000 reached at 5005000
Input #0, mpeg, from '/mnt/media1/Jukebox_upload/Front 242 - Headhunter.mpg':
  Duration: 00:03:21.03, start: 0.659989, bitrate: 1394 kb/s
    Stream #0:0[0x1e0]: Video: mpeg1video, yuv420p, 352x240 [SAR 200:219 DAR 880:657], 1150 kb/s, 29.97 fps, 29.97 tbr, 90k tbn, 29.97 tbc
    Stream #0:1[0x1c0]: Audio: mp2, 44100 Hz, stereo, s16, 224 kb/s
[wav @ 0x19f4400] max_analyze_duration 5000000 reached at 5015510
Guessed Channel Layout for  Input Stream #1.0 : stereo
Input #1, wav, from 'normal.wav':
  Duration: 00:03:20.54, bitrate: 1411 kb/s
    Stream #1:0: Audio: pcm_s16le ([1][0][0][0] / 0x0001), 44100 Hz, stereo, s16, 1411 kb/s
Unknown decoder 'libx264'

Ive tried the "-i normal.wav" at the begining and after the video parameters, but seem to get this error every time, any ideas why it seems the audio as a 2 channel wav and wants to decode it?

joolz


More information about the ffmpeg-user mailing list