Author Topic: Problem with LPCM audio from Sony FDR-AX53 video camera  (Read 485 times)

Kiel

  • Newbie
  • *
  • Posts: 3
Problem with LPCM audio from Sony FDR-AX53 video camera
« on: September 14, 2016, 11:08:20 PM »
Avidemux 2.6.13 plays the audio track to fast and with interruptions (Windows 7 and Windows 10).

Here is a short sample file (filmed from the PC screen):
https://1drv.ms/v/s!AnlM-zzX3IMVgQKqNy12DnBCgkrZ

Windows Media player and Handbrake don't have problems to play the audio track correct.

Does anyone have an idea how Avidemux could handle the file correct?
« Last Edit: September 14, 2016, 11:10:01 PM by Kiel »

eumagga0x2a

  • Hero Member
  • *****
  • Posts: 829
Re: Problem with LPCM audio from Sony FDR-AX53 video camera
« Reply #1 on: September 14, 2016, 11:42:01 PM »
Here is a short sample file (filmed from the PC screen):
https://1drv.ms/v/s!AnlM-zzX3IMVgQKqNy12DnBCgkrZ

Actually, PCM in MP4 is illegal, but the main problem seems to be the big endian format (pcm_s16be) of the audio. Once converted to pcm_s16le (and preferably remuxed as MKV), Avidemux plays gladly the resulting LPCM_audio_test-le.mkv:

Code: [Select]
ffmpeg -i LPCM_audio_test.mp4 -c:v copy -c:a pcm_s16le LPCM_audio_test-le.mkv

Kiel

  • Newbie
  • *
  • Posts: 3
Re: Problem with LPCM audio from Sony FDR-AX53 video camera
« Reply #2 on: September 15, 2016, 10:45:18 PM »
Thank you very much for your info.
With the above ffmeg command I can convert the files so that Avidemux can handle it.
It would be nice if Avidemux could process the files sometime directly.

dosdan

  • Newbie
  • *
  • Posts: 39
Re: Problem with LPCM audio from Sony FDR-AX53 video camera
« Reply #3 on: September 16, 2016, 07:59:09 AM »
Code: [Select]
ffmpeg -i LPCM_audio_test.mp4 -c:v copy -c:a pcm_s16le LPCM_audio_test-le.mkv

Kiel, I'm a bit rusty with batch files, but if you need to fix a lot of MP4s and do it from within Windows Explorer, I suggest you create a batch file, place it on your desktop and drag-and-drop 1 or more MP4s on to this icon.

CONVERT.BAT
Code: [Select]
@echo off
cls
set filename=""

:FILES_LOOP
for %%F in (%1) do (
set filename=%%F
echo ffmpeg -i %%F -c:v copy -c:a pcm_s16le %%~nF.mkv 
        if errorlevel 1 goto ERROR_OCCURRED
)
shift
if not "%1"=="" goto FILES_LOOP
goto FINISHED

:ERROR_OCCURRED
echo.
echo An error occured when trying to process %filename%
echo Aborting...

:FINISHED
echo.
pause

At the moment the "echo" in "echo ffmpeg -i %%F -c:v copy -c:a pcm_s16le %%~nF.mkv" will just show you the command line that would be executed, but not actually run FFMPEG. So if you drop 3 MP4s on to the CONVERT.BAT icon you should see 3 command lines.  To activate it, remove this particular ECHO and re-save the batch file.

BTW, if FFMPEG is not in your path list, you can hardwire its full path into the batch file. To get the full path of a file in Windows Explorer, rather than just r.clicking on FFMPEG, instead shift-r.click on it. This will show an extra option: "Copy as path".

Dan.
« Last Edit: September 16, 2016, 08:14:30 AM by dosdan »

Kiel

  • Newbie
  • *
  • Posts: 3
Re: Problem with LPCM audio from Sony FDR-AX53 video camera
« Reply #4 on: September 18, 2016, 10:22:11 PM »
Thank you dosdan - the batch file is also a good idea that can help me.

eumagga0x2a

  • Hero Member
  • *****
  • Posts: 829
Re: Problem with LPCM audio from Sony FDR-AX53 video camera
« Reply #5 on: September 18, 2016, 10:58:07 PM »
It would be interesting to know if Avidemux not handling big-endian PCM audio is a conscious design decision or sort of a bug?

Pretty amazing batch scripting and great sense of understatement  :)

mean

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 10766
Re: Problem with LPCM audio from Sony FDR-AX53 video camera
« Reply #6 on: September 19, 2016, 04:11:55 AM »
In mov/mp4, "twos" is normally LPCM

eumagga0x2a

  • Hero Member
  • *****
  • Posts: 829
Re: Problem with LPCM audio from Sony FDR-AX53 video camera
« Reply #7 on: September 19, 2016, 09:27:30 AM »
In mov/mp4, "twos" is normally LPCM

Sure, but are Sony breaking the specs using MP4 instead of MOV container here, aren't they? Still, when remuxed as a true QuickTime video (or Matroska), Avidemux struggles with the big-endian LPCM audio like "twos".

(I don't want to imply that this should have any priority for 2.6.15 or later, just being curious)

mean

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 10766
Re: Problem with LPCM audio from Sony FDR-AX53 video camera
« Reply #8 on: September 19, 2016, 05:30:14 PM »
I did a quick check, there is no obvious way to know if it is big or little endian
In mov/mp4 it should be big