Change audio track of a video without codec

1

I have some AVI files of an old Win 3.11 game, where I want to change the audio track, without touching the video part.

I have a (propertiary) codec as *.drv file (VfW; works in Win95), but it is 16-bit, and is probably only a decompressor. But since I only want to touch the audio part, I shouldn't need the video codec.

However, I cannot open the AVI file in VirtualDub, because the video codec is missing.

Daniel Marschall

Posted 2015-01-24T00:58:09.593

Reputation: 217

Answers

1

I didn't found an answer for the original question, whereas the video codec is unknown, but I found a technique to solve my problem:

The Win98 machine has the 16-bit video codec (special transparency codec of a video game) installed. So, I can play the video. I installed VirtualDub on Win98, and so I could replace the audio track, and for the video part, I could do "direct stream copy".

Technically, it should also be possible to do direct stream copy without the video codec, but VirtualDub rejects to open a video where the video codec is not installed.

Daniel Marschall

Posted 2015-01-24T00:58:09.593

Reputation: 217

0

That's quite easy: Use ffmpeg:

ffmpeg -i yourfile.avi -c:v copy -c:a mp3 yournewfile.avi

will e.g. create a new file, where the video track is simply copied, while the audio track is converted to MP3.

ffmpeg -i yourfile.avi -vn -c:a mp3 yournewfile.mp3

will extract the audio track only in MP3 format.

EDIT

A possible workflow for replacing the soundtrack would be

  • Use something like ffmpeg -i yourfile.avi -vn -c:a copy yournewfile.wav to extract the soundtrack
  • Manipulate the soundtrack at your will
  • Use something like ffmpeg -i yourfile.avi -i manipulatedsound.wav -map '0:V' -map '1:A' -c copy finalfile.avi to combine the original image with the new sound

Eugen Rieck

Posted 2015-01-24T00:58:09.593

Reputation: 15 128

Thank you for your answer. This solves one part of my problem. But how do I overwrite the audio track of an AVI file; removing the audio track (it is PCM), and then replacing it with a new audio track? Will there be severe problems if the audio track is not 100% of the length of the video? – Daniel Marschall – 2015-01-24T10:04:27.963

@rinntech See my edit! – Eugen Rieck – 2015-01-24T11:50:24.770

Thank you very much :-) I do understand the syntax of ffmpeg now, but alas there seems to be still a problem. The stream seems to be copied, but the video cannot be opened in Win98: "Codec is missing" (the 16bit codec is installed). The original video has the same FourCC code as the new video (I also checked it with GSpot). The old video can be opened without problems. Here is my ffmpeg output: http://pastebin.com/FuPCKy0K . I do not know if the warning "max_analyze_duration reached" has something to do with it - but even -analyzeduration 100000000000000 does not help.

– Daniel Marschall – 2015-01-24T15:37:03.530

I think this might be a case of audio codec missing! Can you play the audio file on Win98? BTW: ffmpeg seems to know your video codec - you might want to try and convert it to a more modern codec. – Eugen Rieck – 2015-01-24T17:42:39.863

Yes, I can hear audio. I will try if I can get ffmpeg run on Win98 (where the 16bit codec exists). I do not want to convert it into a modern codec. I would like that the game is able to read the modified video, and it uses a special "transparent AVI" codec. ffmpeg cannot know my codec. It is a codec which was only used in this old game, and I had run ffmpeg on a separate linux machine, where I want to batch process all AVI files of the game. – Daniel Marschall – 2015-01-24T18:15:03.783