Author Topic: Sony XAVC S audio problem  (Read 2459 times)

MikeHarding

  • Newbie
  • *
  • Posts: 18
Sony XAVC S audio problem
« on: January 05, 2017, 01:07:57 AM »
First: *Thank You* to the author and all contributors for producing such an excellent piece of software AND making it freely available - your efforts are appreciated by a great many people.

I have recently purchased a new camcorder, a Sony HDR-CX405 (excellent device for the money btw) which, at its top quality setting, produces files in XAVC S format and MP4 and whilst these files load into Avidemux and their video is playable their audio is seemingly not recognised by the codec and a random series of electronic noises produced instead.

I'm running Windows 7 Pro, 32 bit and Avidemux V2.6.16 (15 did the same).

MH

mean

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 10902
Re: Sony XAVC S audio problem
« Reply #1 on: January 05, 2017, 05:11:51 AM »
a 10 sec sample would help

MikeHarding

  • Newbie
  • *
  • Posts: 18
Re: Sony XAVC S audio problem
« Reply #2 on: January 05, 2017, 10:40:15 PM »
>a 10 sec sample would help

No problem :)

17 seconds of Sony HDR-CX405 XAVC S video/audio (C0001.mp4 - 108MB):

http://bit.ly/2igHAJc

MH



eumagga0x2a

  • Hero Member
  • *****
  • Posts: 1179
Re: Sony XAVC S audio problem
« Reply #3 on: January 05, 2017, 11:33:41 PM »
big-endian PCM, again.

MikeHarding

  • Newbie
  • *
  • Posts: 18
Re: Sony XAVC S audio problem
« Reply #4 on: January 06, 2017, 01:45:10 AM »
>big-endian PCM, again.

My guess is not. If it were I would expect to hear audio throughout the track, albeit garbled, but after a few seconds of rubbish things go silent.

Additionally; VLC, WMP and Potplayer all play the file correctly - could be luck of course...?

mean

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 10902
Re: Sony XAVC S audio problem
« Reply #5 on: January 06, 2017, 07:50:47 AM »
It seems only half the audio is seen, hence it stops when reaching mid course

Jan Gruuthuse

  • Hero Member
  • *****
  • Posts: 5337
Re: Sony XAVC S audio problem
« Reply #6 on: January 06, 2017, 08:25:06 AM »
Plays correctly on VLC, interesting VLC reports the audio as: Pcm s16 be (twos) codec <= Google docs info on this codec
« Last Edit: January 06, 2017, 11:56:21 AM by Jan Gruuthuse »

eumagga0x2a

  • Hero Member
  • *****
  • Posts: 1179
Re: Sony XAVC S audio problem
« Reply #7 on: January 06, 2017, 05:43:26 PM »
Convert audio with ffmpeg losslessly to little-endian and remux it into a MKV (neither ffmpeg nor Avidemux would mux LPCM into MP4)

Code: [Select]
ffmpeg -i C0001.mp4 -c:v copy -c:a pcm_s16le C0001-s16le.mkv
and Avidemux will gladly play the audio in C0001-s16le.mkv. Remux the sample video with ffmpeg in copy mode into MKV (keeping it big-endian) and Avidemux will fail to play the audio while flooding the console with errors similar to

Code: [Select]
[getPCMPacket] 16:28:15-726  [Composer::getPCMPacket] Track 0:392c1a0 : codec failed failed
  [fillIncomingBuffer] 16:28:15-726  [Bridge] End of stream

I'm pretty sure this is the same old issue with big-endian LPCM.


MikeHarding

  • Newbie
  • *
  • Posts: 18
Re: Sony XAVC S audio problem
« Reply #8 on: January 07, 2017, 02:46:35 AM »
>and Avidemux will gladly play the audio in C0001-s16le.mkv

Not on my system.

Using the latest version of FFMPEG and your command line I can produce a mkv file which plays correctly in both VLC and Potplayer. However in Avidemux the audio is correct for the first 10 seconds but is then muted for the remainder of the video, whereas I actually talk for 16 seconds of the 17 second video.

Currently 38C (100F) here in Melbourne, Australia - phew!

dosdan

  • Newbie
  • *
  • Posts: 45
Re: Sony XAVC S audio problem
« Reply #9 on: January 07, 2017, 06:11:26 AM »
>and Avidemux will gladly play the audio in C0001-s16le.mkv

Not on my system.

Using the latest version of FFMPEG and your command line I can produce a mkv file which plays correctly in both VLC and Potplayer. However in Avidemux the audio is correct for the first 10 seconds but is then muted for the remainder of the video, whereas I actually talk for 16 seconds of the 17 second video.


Mike, works here on Win10 - sound for the full duration of the file. Using my recent (yesterday) build of FFMPEG and ADM 2.6.18 64-bit.

Try playing my converted MKV in ADM. Hopefully, it will work for you. R-click and save:

https://dl.dropboxusercontent.com/s/4ugj6pi2dgz5b37/C0001.mkv


BTW, the FFMPEG command line mentioned does not preserve either the internal metadata (e.g. creation date as shown in MediaInfo) or the external date/time as shown by Windows  Here's a FFMPEG batchfile that you can put on your Windows desktop and drag-and-drop 1 or more XAVC S MP4s onto.  It will create a "Converted" subdirectory under the directory where the XAVC S files are located.  It also preserves both the inner and the outer date/time, but I had to use a free 3rd party Windows version of touch:  http://www.binarez.com/touch_dot_exe/

Convert_XAVC_S_to_MKV.bat
Code: [Select]
@echo off

cls
set filename=""

:FILES_LOOP
for %%F in (%1) do (
set filename=%%F 
echo Processing %%~fF to %%~dpFconverted\%%~nF.mkv
if not exist "%%~dpFconverted\" md "%%~dpFconverted\"
ffmpeg.exe -i %%F -c:v copy -c:a pcm_s16le  -y -hide_banner -loglevel error -map_metadata 0 "%%~dpFconverted\%%~nF.mkv
if errorlevel 1 goto ERROR_OCCURRED
rem Next line sets the MKV's file date/time to the same as the original MP4 file
touch.exe -r "%%~fF" "%%~dpFconverted\%%~nF.mkv"
rem Next line shows the MKV after it has been created, so with
        rem multiple MP4s it acts as a sort of progress indicator.
dir "%%~dpFconverted\%%~nF.mkv" | find "/"
rem Remove REM from the start of the next line if you wish to
rem delete the original file if no error occurred in the conversion.
REM del %%F
echo.
shift
)
if not "%1"=="" goto FILES_LOOP
goto FINISHED

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

:FINISHED
echo.
echo.
pause

Conversion run on 3 MP4 files, all created from C0001.MP4, but I've touched C0003.MP4 so it has a different date/time:

Code: [Select]
Processing D:\test1\C0001.MP4 to  D:\test1\converted\C0001.mkv
06/01/2017  04:37 PM       112,934,391 C0001.mkv

Processing D:\test1\C0002.MP4 to  D:\test1\converted\C0002.mkv
06/01/2017  04:37 PM       112,934,391 C0002.mkv

Processing D:\test1\C0003.MP4 to  D:\test1\converted\C0003.mkv
07/01/2017  03:05 PM       112,934,391 C0003.mkv



Press any key to continue . . .

Dan, from Brisbane.


« Last Edit: January 07, 2017, 07:51:26 AM by dosdan »

MikeHarding

  • Newbie
  • *
  • Posts: 18
Re: Sony XAVC S audio problem
« Reply #10 on: January 07, 2017, 07:20:08 AM »
Hi Dan

Thank you for taking the time to do that.

>Try playing my converted MKV in ADM

I did and with the same result; the audio died at about 10s - odd.

Something to do with the 32/64 bit compiles maybe? When I can work up the energy I shall reformat this system to Win 7/64 - the disk is glaring at me from my desk... but you know the deal, it's not the Windows upgrade which is the issue it's all the utilities et al one uses :(

6.20pm - Temperature has now plummeted to 37C - I'll need to put a jumper on soon! :)

Aspirant

  • Newbie
  • *
  • Posts: 3
Re: Sony XAVC S audio problem
« Reply #11 on: January 11, 2017, 05:25:43 PM »
Hello,

I am experiencing the same audio playback problem with XAVC-S from a Sony RX100 V digital camera.
I am a beginner, with very small experience with video editing/codecs, but I'm able to learn ;) I was previously able to read out the "Pcm s16 be (twos) codec" from VLC, but that was it for me...

For my own file the "ffmpeg -i C0001.mp4 -c:v copy -c:a pcm_s16le C0001-s16le.mkv" did the job for correct audio playback in Avidemux (windows 8, 64bit). It seems to play correct for the whole 27 minutes.
eumagga0x2a - thank you :)
I will look for the dosdan's solution in the future too (thanks again).

I am now able to cut the C0001-s16le.mkv file without loosing the audio; "copy" is still not supported, but a try with first chosen audio codec mp3 (lame) worked perfect.
I took the mp4v2 Muxer with default settings, hope this is correct for my XAVC-S files.

Could you please advise, give a recommendation, for good Audio-Codec option for my further reco(r)dings/ trims?
 
I will use my files for general Windows playback and I'm going to video-edit the files in the future, so I am looking for a tip for a good general purpose audio codec.


PS As we are speaking of temperatures: as I recorded my home trip last weekend, there was -14.5C in Poland. Now it's comfy +1C in Germany.
« Last Edit: January 11, 2017, 05:31:43 PM by Aspirant »

mean

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 10902
Re: Sony XAVC S audio problem
« Reply #12 on: January 11, 2017, 08:35:39 PM »
It's not an endianness issue
It's a timestamp issue

The clock is advancing at 2x the normal pace, and it swallows half of the audio track

mean

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 10902
Re: Sony XAVC S audio problem
« Reply #13 on: January 12, 2017, 06:47:02 AM »
Should be okay now
The win64 nightly is being built

dosdan

  • Newbie
  • *
  • Posts: 45
Re: Sony XAVC S audio problem
« Reply #14 on: January 12, 2017, 08:20:55 AM »
The clock is advancing at 2x the normal pace, and it swallows half of the audio track

Mean, what was causing the 2x clock speed with an XAVC S MP4 file, but not with other MP4s?

Dan.