How to figure out what codec is used in an unusual AVI file - audio

I have an *.avi file that media info shows as H.264 video and 0x029A as the audio codec.
The file uses the March Network r5 codec. I also opened the file in hexpad and found that the wFormatTag is 9A 02 01 00
I can't get the file to open in VLC, but I can get windows media player to play the file after installing the codec.
Codec: https://www.marchnetworks.com/support-downloads/downloads/video-players-and-codecs/
I was wondering if there is any way to figure out what the audio codec is. FFprobe didn't work and I can't find a way to extract the audio. I just want to be able to feed it into whisper.cpp without having to rerecord it.
I have opened it in mediainfo and a hex editor. I also found this post showing how a previous "codec" for March Networks was just a mess up hex file where they replaced H263 with T263. I wonder if the same thing is happening here. https://www.kurtzandblum.com/blog/overcoming-hurdles-in-digital-evidence/
I looked up all the wFormatTags and 0x029A isn't on the list. https://github.com/tpn/winsdk-10/blob/master/Include/10.0.14393.0/shared/mmreg.h
I wonder if it really is a proprietary format or just some trick

Related

Incorrect values for song length (duration) in Mp3tag after ffmpeg FLAC to MP3 conversion

The problem
As per this post, I use the following command to convert a flac file to mp3 while keeping all metadata:
ffmpeg -i input.flac -ab 320k -map_metadata 0 -id3v2_version 3 output.mp3
When inspecting the converted mp3 file by right-clicking it, going to properties and then details, everything looks in order. The value for "Length" is correct.
When inspecting the converted mp3 file with Mp3tag, the value for "Length" is different. From my testing, the "Length" value is consistently about 28% of what it is supposed to be.
Normally, this isn't an issue. Most music players I use, read the correct length value, same as Windows. However, I've recently discovered that Spotify Mobile for some reason ignores the length value that can be seen in the Windows panel and uses the one that can be seen in Mp3tag.
I want to figure out what command I should use so that after the flac file has been converted to mp3, Mp3tag shows the correct length, and there by, Spotify Mobile reads the correct length as well.
What I have tried
1.
After converting the file to Mp3, I've tried reencoding the mp3 file into a... mp3 file using the following command:
ffmpeg -i original.mp3 -c:v copy -c:a mp3 -vn -ar 44100 -ac 2 -b:a 320k copy.mp3
As can be seen in the image above, this fixes the issue and the length is showing correctly in Mp3tag and in Spotify Mobile.
Issues with this: Reencoding reduces quality and I don't know how to combine the previous flac conversion command and this one into one line.
2.
I tried https://cloudconvert.com/flac-to-mp3 and it worked. The length is displayed correctly in Mp3tag. (What commands did they use on the server???)
Issues with this: I don't want to rely on a cloud service for conversion, I have a lot of files to convert and I'd prefer it to be done locally.
Some demo files
Here is a folder with a flac file, a bad mp3 file (wrong length) and a good mp3 file. It looks like if you preview the music in google drive, it also plays the wrong length for the bad mp3 (39s not 2m19s), while vlc, groove player, spotify (desktop not mobile) all play the correct full length (2m19s) for the bad mp3 file.
Folder: here's the link
It seems I had an outdated version of ffmpeg... (ffmpeg version git-2020-05-23-26b4509) I updated to the latest version and the issue went away. Learned my lesson the hard way.
Would still appreciate an explanation on why this was happening. I'm curious. Why were there two values for length?

When using youtube-dl with ffmpeg, what merge extension(mkv/mp4) can get best sound quality

I use youtube-dl -F to display all video/audio list, and choose best video/audio source myself.
Then I use youtube-dl -f [video code]+[audio code] to download and automatically merge them.
As question title, when I use --merge-output-format, what output extension should be chosen then I can get a file with best sound quality. Is mkv? Or is most suitable merge extension related to the extension of video/audio source?
By the way, my using player is PotPlayer.
It doesn't really matter
MKV or MP4 can accept all of the video and audio formats currently available on YouTube (H.264 or VP9 or AV1 video, AAC or Opus audio). Exception is if you are using a really old ffmpeg.
youtube-dl is just re-muxing the video and audio with --merge-output-format. Like a copy and paste. There is no re-encoding so there is no generation loss.
If you choose an incompatible output format, then it will fail with ERROR: Stream #1:0 -> #0:1 (copy) or similar.
Use whichever you prefer or works best for your player/device.

What does LAME text does in MP3 file?

I see here http://en.wikipedia.org/wiki/MP3 that MP3 file consists of MP3 headers interchanged with MP3 data. MP3 header consist of few bytes.
But here is my MP3 file dump with ID3 tag cut. Header is highlighted with blue.
You can see that "LAME3.96" text is highlighted with green. What does it does there? Is this a part of MP3 elementary stream? Or this is the part of some headers I didn't tag?
LAME is an MP3 encoder, which is a program that takes an uncompressed audio source and outputs a compressed MP3. That piece of text there just indicates that the file was compressed using the LAME encoder. According to the LAME SourceForge page, the latest version is 3.99, pretty close to what you got inserted into the header of that file.
So don't worry, nobody tried to insult your MP3 file! :P

Record screen and audio then generate to one video file in java.

I am writting a program as http://www.screencast-o-matic.com/. I used applet and import jmf.jar to my project. When I use it, it couldn't get anything capture devices so it couldn't capture audio and video.
I captured screen to video but it hadn't sound. I captured sound but it hadn't video. I use jmf to merger 2 stream to video file. But it error.
Everybody can help me to resol problem. Thanks your help.
You can use Xuggle-Xuggler http://www.javacodegeeks.com/2011/02/introduction-xuggler-video-manipulation.html API which is wrapper of FFmpeg command line tool. Both are open source.

iPhone App Dev - Edited mp3 files are not working in App

In my application there are mp3 files located in the bundle (nothing from the web). Some of the mp3 files are original files and some I had edited using simple sound editing software (the ones where you insert a file, cut a slice of it and save it as a new and shorter mp3 file).
I'm using the AVAudioPlayer [initWithData] method.
All the original files (the ones that I hadn't edited and inserted to the bundle as is) are working perfectly and all the ones that were edited are not working at all.
I used 2 different editing software and the outcome is the same.
Anyone had ever encountered that or have any idea what may I done wrong?
Thanks,
Ohad
Converting the mp3 to caf worked for me
as specified here.
see the following:
How do I convert an audio file to the preferred format for iPhone OS?
The preferred full-quality audio format for iPhone OS is 16-bit, little-endian, linear PCM packaged as a CAF file. To convert an audio file to this format, use the afconvert tool at the command line in Mac OS X, as shown in Listing 5.
Listing 5 Converting an audio file to the preferred format for iPhone OS
/usr/bin/afconvert -f caff -d LEI16 {INPUT} {OUTPUT}
To see all the options available for the afconvert tool, enter afconvert -h at the command line.

Resources