News:

--

Main Menu

Sony XAVC S audio problem

Started by MikeHarding, January 05, 2017, 01:07:57 AM

Previous topic - Next topic

MikeHarding

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


MikeHarding

>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


MikeHarding

>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

It seems only half the audio is seen, hence it stops when reaching mid course

Jan Gruuthuse

#6
Plays correctly on VLC, interesting VLC reports the audio as: Pcm s16 be (twos) codec <= Google docs info on this codec

eumagga0x2a

Convert audio with ffmpeg losslessly to little-endian and remux it into a MKV (neither ffmpeg nor Avidemux would mux LPCM into MP4)

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

[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

>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

#9
Quote from: MikeHarding 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.


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
@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:

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.



MikeHarding

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

#11
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.

mean

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

Should be okay now
The win64 nightly is being built

dosdan

Quote from: mean on January 11, 2017, 08:35:39 PM
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.