Yet Another MP4 import screechy sound issue

Hi I’m a newbie here. I’ve been using Audacity and raelly like it. However I can’t seem to get it to import/open MP4 files correctly.
I know this has been posted many times before and apparently has
been working correctly for some people but I’m having a problem.

I’ve downloaded “FFmpeg for Audacity” and the MP4 file does open
however the audio is just a continuous screech.

I can use FFmpeg.exe standalone to extract the audio first and then open
it in Audacity but was hoping for a simpler solution.

I did document the following:
windows version: 8.1 64 bit
Audacity version: 2.2.2
FFmpeg for audacity: Files dated 4/4/2011 at 10:07 AM
Below I’ve pasted in the output from FFmpeg command-line on the test file.

When I open the test MP4 file in Audacity it doesn’t seem to fully detect
the audio information.
The Sample rate is listed as
“16-bit” - ok
“12000” - Should be 44100

Either playing it at the detected rate of “12000” or after setting it
tp “44100” both sound nothing but screecting.

Also after manually setting the sample rate to “44100” in the track menu pulldown, the “Project rate” on the lower status bar remains at 12000.
I’ve tried various combinations of setting the rate either/or the
menu-pull down or the “Project Rate” on the status bar nothing seemed to help.

I’ve read that it’s nearly impossible task to keep Audacity updated to
the latest and greatest FFmpeg - I totally understand! (I was a software developer in a past life).

However would it be possible to provide an option to use FFmpeg from the command line?



Here’s the output from FFmpeg.exe command linethe test MP4 file generates the following:

//*******************************************************************
//*******************************************************************
//*******************************************************************
//*******************************************************************
//*******************************************************************
G:\zz zz zz Dot Net Audio\TestWavFiles>ffmpeg.exe -i "Dog Paddle-SAM_2104.mp4"
ffmpeg version N-91024-g293a6e8332 Copyright (c) 2000-2018 the FFmpeg developers

  built with gcc 7.3.0 (GCC)
  configuration: --enable-gpl --enable-version3 --enable-sdl2 --enable-bzlib --e
nable-fontconfig --enable-gnutls --enable-iconv --enable-libass --enable-libblur
ay --enable-libfreetype --enable-libmp3lame --enable-libopencore-amrnb --enable-
libopencore-amrwb --enable-libopenjpeg --enable-libopus --enable-libshine --enab
le-libsnappy --enable-libsoxr --enable-libtheora --enable-libtwolame --enable-li
bvpx --enable-libwavpack --enable-libwebp --enable-libx264 --enable-libx265 --en
able-libxml2 --enable-libzimg --enable-lzma --enable-zlib --enable-gmp --enable-
libvidstab --enable-libvorbis --enable-libvo-amrwbenc --enable-libmysofa --enabl
e-libspeex --enable-libxvid --enable-libaom --enable-libmfx --enable-amf --enabl
e-ffnvcodec --enable-cuvid --enable-d3d11va --enable-nvenc --enable-nvdec --enab
le-dxva2 --enable-avisynth
  libavutil      56. 18.100 / 56. 18.100
  libavcodec     58. 19.101 / 58. 19.101
  libavformat    58. 13.102 / 58. 13.102
  libavdevice    58.  4.100 / 58.  4.100
  libavfilter     7. 21.100 /  7. 21.100
  libswscale      5.  2.100 /  5.  2.100
  libswresample   3.  2.100 /  3.  2.100
  libpostproc    55.  2.100 / 55.  2.100
[mov,mp4,m4a,3gp,3g2,mj2 @ 000000781941a1c0] st: 0 edit list: 1 Missing key fram
e while searching for timestamp: 1001
[mov,mp4,m4a,3gp,3g2,mj2 @ 000000781941a1c0] st: 0 edit list 1 Cannot find an in
dex entry before timestamp: 1001.
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'Dog Paddle-SAM_2104.mp4':
  Metadata:
    major_brand     : mp42
    minor_version   : 0
    compatible_brands: mp42avc1
    creation_time   : 2018-05-17T12:42:10.000000Z
  Duration: 00:00:45.05, start: 0.000000, bitrate: 14638 kb/s
    Stream #0:0(und): Video: h264 (High) (avc1 / 0x31637661), yuv420p, 1920x1080
 [SAR 1:1 DAR 16:9], 14416 kb/s, 29.97 fps, 29.97 tbr, 30k tbn, 59.94 tbc (defau
lt)
    Metadata:
      rotate          : 90
      creation_time   : 2018-05-17T12:42:10.000000Z
      handler_name    : SF M7MU SPEAR NX3000 Video Handler
      encoder         : AVC Coding
    Side data:
      displaymatrix: rotation of -90.00 degrees
    Stream #0:1(und): Audio: aac (LC) (mp4a / 0x6134706D), 44100 Hz, stereo, flt
p, 126 kb/s (default)
    Metadata:
      rotate          : 90
      creation_time   : 2018-05-17T12:42:10.000000Z
      handler_name    : SF M7MU SPEAR NX3000 Audio Handler
At least one output file must be specified


//*******************************************************************
//*******************************************************************
//*******************************************************************
//*******************************************************************
//*******************************************************************

DSC00001.jpg

When I open the test MP4 file in Audacity

Audacity doesn’t have Clip INFO, so you can’t use it to tell you what you have. The add-on program Media INFO is recommended and be sure and get the program, not the installer.

Windows insists on hiding the filename extensions. Just because it says it’s an MP4 doesn’t mean is actually is. From your experience, I’d assume it’s some variant that’s throwing Audacity off.

I’ve read that it’s nearly impossible task to keep Audacity updated to the latest and greatest FFmpeg

Where did you read that? It should be possible to use the latest posted Audacity and latest posted FFMpeg and get good results.

I can’t seem to get it to import/open MP4 files

Can I guess from one place? What is that place?

Koz

Thanks for your response.

You mentioned: “Just because it says it’s an MP4 doesn’t mean is actually is. From your experience, I’d assume it’s some variant that’s throwing Audacity off.”

It sure seems to be a MP4 file. Both FFmpeg and VLC have no issues processing it. Also I included the output from FFmpeg, which should give details of the MP4 file information. I’ve also pasted in the MediaInfo information. Or am I missing something?

I just re-downloaded the FFmpeg and Lame files, I’ve attached screen images of them, which displays their creation dates. These should be the correct versions?

If the issue is my test files are the “wrong variant” of MP4, is there a different MP4 file you could point me to that should work? Maybe a known test file would help me resolve this.

Thanks

//******************************** output from MediaInfo on my test file
//********************************
General
Complete name : G:\zz zz zz Dot Net Audio\TestWavFiles\Dog Paddle-SAM_2104.MP4
Format : MPEG-4
Format profile : Base Media / Version 2
Codec ID : mp42 (mp42/avc1)
File size : 78.6 MiB
Duration : 45 s 45 ms
Overall bit rate : 14.6 Mb/s
Encoded date : UTC 2018-05-17 12:42:10
Tagged date : UTC 2018-05-17 12:42:10
@sec : UNG

Video
ID : 1
Format : AVC
Format/Info : Advanced Video Codec
Format profile : High@L4
Format settings : CABAC / 2 Ref Frames
Format settings, CABAC : Yes
Format settings, RefFrames : 2 frames
Format settings, GOP : M=3, N=15
Codec ID : avc1
Codec ID/Info : Advanced Video Coding
Duration : 45 s 45 ms
Bit rate : 14.4 Mb/s
Width : 1 920 pixels
Height : 1 080 pixels
Display aspect ratio : 16:9
Rotation : 90°
Frame rate mode : Constant
Frame rate : 29.970 (30000/1001) FPS
Color space : YUV
Chroma subsampling : 4:2:0
Bit depth : 8 bits
Scan type : Progressive
Bits/(Pixel*Frame) : 0.232
Stream size : 77.4 MiB (98%)
Encoded date : UTC 2018-05-17 12:42:10
Tagged date : UTC 2018-05-17 12:42:10

Audio
ID : 2
Format : AAC
Format/Info : Advanced Audio Codec
Format profile : LC
Codec ID : mp4a-40-2
Duration : 45 s 23 ms
Bit rate mode : Constant
Bit rate : 128 kb/s
Channel(s) : 2 channels
Channel positions : Front: L R
Sampling rate : 44.1 kHz
Frame rate : 43.066 FPS (1024 SPF)
Compression mode : Lossy
Stream size : 694 KiB (1%)
Encoded date : UTC 2018-05-17 12:42:10
Audacity -Lame.jpg
Audacity -FFmpeg.jpg

I’m just doing first level possibilities. The Audacity update version only outran the FFMpeg version once or twice. In all cases, getting a matching set from the download page solves the issue. I know if you get stuck with one of these crosses it can seem like it happens all the time, but as far as I know, that’s not the case.

The Project Rate in the lower left of the Audacity Window should have resolved it. That’s why I think there may be something special about the show file.

We should let one of the senior elves pick this up.

Koz

A note: The INFO suggests the sound is Dolby Surround with only the front two channels expressed: Front Left and Front Right with no plain PCM. So the sound is really two layers of encoding deep.

I’m fuzzier on this one, but the sound frame rate is different from the video rate. That would lead me to guess at a badly formed show and the other players are better at catching errors.

If Audacity can’t figure out what to do, it plays the sound as uncompressed. That’s where the screech comes from.

Koz

Both FFmpeg and VLC have no issues processing it.

Does that mean you can convert it to WAV with FFmpeg (from the command line)? Problem solved?

VLC should also be able to extract/convert the audio to WAV, but I’ve never used VLC for that so you’d have to research how to do it.

You can also try [u]TAudioConverter[/u] or [u]XMediaRecode[/u].

What’s the show? Is this a commercial conversion like from a DVD-Video or other production? Or something you downloaded and you have no idea what the heritage is?

This Dolby thing is a valid way to produce videos. We used to do that if there wasn’t room to include all the different versions of sound. I used to know what the order was. The player checks for Dolby first, then PCM Stereo and then “other.” Something like that. But if the producer drops the ball anywhere in the process, it can produce a damaged video.

And nobody wrote it has to be only one problem…

Koz

Thanks for the responses

Just to be clarify:

  1. The MP4 files I normally work with are generated by my camera, which is the Samsung NX3000.

  2. VLC correctly opens and plays the MP4 files

  3. FFmpeg from the command-line can open the MP4 files, extract the audio WAV files, and place new WAV files into the MP4 file

  4. The YouTube download file was only meant as a test. Since it didn’t work I don’t have a known MP4 file to test my Audacity installation against

  5. If someone could point me to a known working MP4 file I’d be happy to test against it

  6. This isn’t a show-stopper for my workflow needs, as I can use FFmpeg from the command line. This just limits how I can use Audacity in my workflow

Thanks

Or, alternately, you can post an under 2MB MP4 file and we’ll see if we can open it. Stand in front of the camera and count to five? I don’t have a feel for the file sizes.

Scroll down from a forum text window > Upload Attachment.

Koz

Sorry, I gave it several tries but couldn’t capture a small enough MP4 file. The camera is capturing over 2 Meg a second but it debounces the record button so I can’t get the button presses fast enough. The smallest I got was just under 5 Meg - and that was pointing it at a white wall.

I could use a video editor to cut it down, but I’m doubtful that what went into the editor would be exactly the same format as came out.

If you don’t have a known working test video on YouTube, maybe you could email me a short clip? It’d be nice to know there isn’t something quirky about my audacity/windows installation.

I don’t do anything in MP4. We’ll need to wait for a different forum elf.

Koz

Here’s a 10 second test file:

This is what MediaInfo says about it:

Format                                   : MPEG-4
Format profile                           : Apple audio with iTunes info
Codec ID                                 : M4A  (isom/iso2)
File size                                : 243 KiB
Duration                                 : 10s 37ms
Overall bit rate mode                    : Constant
Overall bit rate                         : 198 Kbps
Encoded date                             : UTC 1904-01-01 00:00:00
Tagged date                              : UTC 1904-01-01 00:00:00
Writing application                      : Lavf56.40.101

Audio
ID                                       : 1
Format                                   : AAC
Format/Info                              : Advanced Audio Codec
Format profile                           : LC
Codec ID                                 : 40
Duration                                 : 10s 37ms
Duration_LastFrame                       : -18ms
Bit rate mode                            : Constant
Bit rate                                 : 196 Kbps
Channel(s)                               : 2 channels
Channel positions                        : Front: L R
Sampling rate                            : 44.1 KHz
Frame rate                               : 43.066 fps (1024 spf)
Compression mode                         : Lossy
Stream size                              : 240 KiB (99%)
Default                                  : Yes
Alternate group                          : 1
Encoded date                             : UTC 1904-01-01 00:00:00
Tagged date                              : UTC 1904-01-01 00:00:00

ok I did some more experimenting. I downloaded some more YouTube videos and none of them worked.
I took some videos with my YI 4K (not plus) and they also didn’t work.

All of them were too big to upload here. So I tried the following:

  1. Used Audacity to generate a know tone (500hz). Took a video of it with my YI 4K (non plus). That didn’t work with Audacity either. So I tried using FFmpeg with various settings to see if I could compress it down to a small enough file size so I could upload it here. To my surprise I came up with two files, one worked, one doesn’t. I’m uploading them here.

For clarity: both of these MP4 files were compressed by FFmpeg from an original YI 4K video of Audacity playing a generated tone. 500hz

ffmpeg -i ydxj0020.mp4 -vf scale=-1:1080 -crf 21 -preset slow -c:a copy smaller-21.mp4 // doesn’t work
ffmpeg -i ydxj0020.mp4 -vf scale=-1:1080 -crf 22 -preset slow -c:a copy smaller7-22.mp4 // Works

MediaPro gives the following information from the original YI 4K MP4 file:

General
Complete name                            : G:\zz zz zz YI 4K- test\Test Batch 3\YDXJ0020.MP4
Format                                   : MPEG-4
Format profile                           : JVT
Codec ID                                 : avc1 (avc1/isom)
File size                                : 3.41 MiB
Duration                                 : 792 ms
Overall bit rate mode                    : Variable
Overall bit rate                         : 36.1 Mb/s
Encoded date                             : UTC 2014-01-01 19:21:42
Tagged date                              : UTC 2014-01-01 19:21:42

Video
ID                                       : 1
Format                                   : AVC
Format/Info                              : Advanced Video Codec
Format profile                           : Main@L5.1
Format settings                          : CABAC / 1 Ref Frames
Format settings, CABAC                   : Yes
Format settings, RefFrames               : 1 frame
Codec ID                                 : avc1
Codec ID/Info                            : Advanced Video Coding
Duration                                 : 792 ms
Bit rate mode                            : Variable
Bit rate                                 : 36.0 Mb/s
Maximum bit rate                         : 24.0 Mb/s
Width                                    : 1 920 pixels
Height                                   : 1 080 pixels
Display aspect ratio                     : 16:9
Frame rate mode                          : Constant
Frame rate                               : 23.976 (24000/1001) FPS
Standard                                 : Component
Color space                              : YUV
Chroma subsampling                       : 4:2:0
Bit depth                                : 8 bits
Scan type                                : Progressive
Bits/(Pixel*Frame)                       : 0.723
Stream size                              : 3.40 MiB (100%)
Title                                    : XiaoYi AVC   
Language                                 : English
Encoded date                             : UTC 2014-01-01 19:21:42
Tagged date                              : UTC 2014-01-01 19:21:42
Color range                              : Full
Color primaries                          : BT.709
Transfer characteristics                 : BT.709
Matrix coefficients                      : BT.709

Audio
ID                                       : 2
Format                                   : AAC
Format/Info                              : Advanced Audio Codec
Format profile                           : LC
Codec ID                                 : mp4a-40-2
Duration                                 : 789 ms
Bit rate mode                            : Constant
Bit rate                                 : 132 kb/s
Nominal bit rate                         : 48.0 kb/s
Channel(s)                               : 2 channels
Channel positions                        : Front: L R
Sampling rate                            : 48.0 kHz
Frame rate                               : 46.875 FPS (1024 SPF)
Compression mode                         : Lossy
Stream size                              : 12.9 KiB (0%)
Title                                    : XiaoYi AAC   
Language                                 : English
Encoded date                             : UTC 2014-01-01 19:21:42
Tagged date                              : UTC 2014-01-01 19:21:42


Thanks!

I downloaded the test file and it works ok in Audacity.
It plays ok in VLC but didn’t have any video. I assume that’s as intended.

I should have made this more clear in my last post.
Looking at the different FFmpeg command line parameters it appears that the key difference is in the
compression specifier.

The two different command lines were:
ffmpeg -i ydxj0020.mp4 -vf scale=-1:1080 -crf 21 -preset slow -c:a copy smaller7-21.mp4 // doesn’t work
ffmpeg -i ydxj0020.mp4 -vf scale=-1:1080 -crf 22 -preset slow -c:a copy smaller7-22.mp4 // Works

-------------------------------------------------------^^---------------------------------------^^--------------------
ie the “-crf” parameter “21” didn’t work
“22” Works

Not sure what this means but it seems like a good clue

Thanks!

Documentation for FFmpeg is here: https://ffmpeg.org/ffmpeg.html

Thanks, I had already googled to that link

What I meant was, I don’t know why such a small difference in the value (“21” vs “22”) would
cause the issue (Audacity not loading audio from MP4 file correctly)

Before I made the post I had experimented with various compression specifiers. So far, it appears that
on my test file:
any value <= 21 fails
any value >= 22 works

FFmpeg uses a default value of “23” (according to my reading of the documentation).

Apparently there’s more involved than just the compression specifier, since I haven’t found
a YouTube video that works (yet).

Here’s a non-working example from YouTube. I
“The Good- the Bad and the Ugly Theme”
https://www.youtube.com/watch?v=h1PfrmCGFnk

If someone has a link to a working YouTube video, I’d be happy to test in on my system

Thanks

I downloaded The Good, The Bad, and The Ugly with [u]ClipGrab[/u] and it opened fine in Audacity (with the default FFmpeg installation).

Worked fine for me with 1-Click YouTube Video Download.

Thanks for posting!

Yes indeed I used ClipGrab and the MP4 file doesn’t work on my installation! So somehow I screwed up the installation of Audacity/FFmepg…that’s progress, 1,001 failures (apparently on my part) at a time!

Thanks again everybody for their responses, now that I have a known test case, that works for other ppl but not me, I can try various installation permutations until I to can have success…

Thanks again, having a know test case that works is very important, now I can spin my wheels trying to find out what I did wrong…

I assume Windows 8.1 is good for this? I’d hate to chase boogies that work on win 10 but not on win 8.1…

thanks again