TransWikia.com

Fix mp3float Header missing without re-encode

Video Production Asked by malat on January 27, 2021

I’d like to fix some old AVI files without re-encoding them. I was hoping ffmpeg would do the job, but for some reason I cannot find the right command to fix the MP3 header.

Steps:

% ffprobe  -hide_banner -i input.avi
[mp3float @ 0x56498fcfa740] Header missing
Input #0, avi, from 'input.avi':
  Metadata:
    encoder         : Lavf58.20.100
  Duration: 01:19:44.96, start: 0.000000, bitrate: 1211 kb/s
    Stream #0:0: Video: mpeg4 (DX50 / 0x30355844), yuv420p, 512x408 [SAR 1:1 DAR 64:51], 1071 kb/s, 25 fps, 25 tbr, 25 tbn, 30k tbc
    Stream #0:1: Audio: mp3 (U[0][0][0] / 0x0055), 44100 Hz, stereo, fltp, 128 kb/s

If I now try:

$ ffmpeg -i input.avi -c copy output.avi

This results in:

% ffprobe  -hide_banner -i output.avi 
[mp3float @ 0x56369d7ff740] Header missing
Input #0, avi, from 'output.avi':
  Metadata:
    encoder         : Lavf58.20.100
  Duration: 01:19:44.96, start: 0.000000, bitrate: 1211 kb/s
    Stream #0:0: Video: mpeg4 (DX50 / 0x30355844), yuv420p, 512x408 [SAR 1:1 DAR 64:51], 1071 kb/s, 25 fps, 25 tbr, 25 tbn, 30k tbc
    Stream #0:1: Audio: mp3 (U[0][0][0] / 0x0055), 44100 Hz, stereo, fltp, 128 kb/s

Is there a way to fix this error [mp3float @ 0x56369d7ff740] Header missing using ffmpeg without re-encoding the mp3 file ?

One Answer

Right now the only solution I found is a two steps process:

Extract the mp3 stream:

$ ffmpeg -i input.avi -c:a copy input.mp3

Combine it back into the original AVI container:

$ ffmpeg -i input.avi -i input.mp3 -c:v copy -c:a copy -map 0:v:0 -map 1:a:0 output.avi

Leads to:

% ffprobe -hide_banner -i output.avi
Input #0, avi, from 'output.avi':
  Metadata:
    encoder         : Lavf58.20.100
  Duration: 01:19:44.96, start: 0.000000, bitrate: 1211 kb/s
    Stream #0:0: Video: mpeg4 (DX50 / 0x30355844), yuv420p, 512x408 [SAR 1:1 DAR 64:51], 1071 kb/s, 25 fps, 25 tbr, 25 tbn, 30k tbc
    Stream #0:1: Audio: mp3 (U[0][0][0] / 0x0055), 44100 Hz, stereo, fltp, 128 kb/s

Correct answer by malat on January 27, 2021

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP