Useful sequence of commands for extracting audio from a screencast (so you can denoise it in Audacity) and putting it back together again:
To simply view metadata for a video/audio file (e.g., so you can see what codecs it's using): ffmpeg -i somefile.mp4
To extract the audio track from a video file: ffmpeg -i inputfile.mp4 -vn -acodec copy outputfile.mp3 (-vn: option meaning no video track in output; -acodec copy: option meaning use the same audio codec as was already there; presumably when using this command, you'll want to specify an output file type, such as .mp3 in this case, that matches the codec of the audio track, which you can find out by using the command in the previous bullet point; another common option is AAC audio, in which case you can use the .m4a extension for the output)
To extract the video track from a video file (and have a video with no audio): ffmpeg -i inputfile.mp4 -an -vcodec copy outputfile.mp4 (-an: option meaning no audio track in output; -vcodec copy: option meaning use the same video codec as was already there; in most cases, the output file extension can be the same as the input file's extension)
- (At this point, if you're denoising a video, you'll probably want to do that with the extracted audio track in Audacity and save the denoised version in some lossless file format like WAV or AIFF.)
To reunite the denoised audio track with the video track (assuming you extracted the video track, which is probably the easiest way to do this) -- we will assume for now that your output video will be in an MPEG-4 container (.mp4 or .m4v extension, or sometimes .mov although .mov can mean lots of things), which does not appear to support any lossless audio formats. So we'll have to convert the audio to a high-quality lossy format like so: ffmpeg -i videotrack.mp4 -i audiotrack.wav -acodec aac -b:a 256k -strict -2 -vcodec copy outputfile.mp4 (Here, videotrack.mp4 and audiotrack.wav will be whatever filenames you have used for your video-only and denoised audio-only tracks; -acodec aac: option meaning to use AAC audio, which works well with MP4 video containers; -b:a 256k: option meaning the bitrate of the audiotrack should be 256 kbits/second, which is pretty high quality with AAC audio; -strict -2: a necessary option to include if you are using AAC audio, which basically enables the "experimental" AAC audio option that is not formally supported by ffmpeg, even though it always works fine; -vcodec copy: option meaning, as before, to use the same video codec as was already there)
Not actually ffmpeg, but will stick in here too -- the afconvert command on a Mac can also be useful for converting audio files, e.g. to Apple Lossless (alac) or AAC. Some example usages:
afconvert inputfile.wav -d alac outputfile.m4a (converts WAV file to Apple Lossless)
afconvert inputfile.wav -d aac -b 256000 outputfile.m4a (converts WAV file to AAC audio with a bitrate of 256 kbits/sec)