Corrupt audio when transcoding uncompressed avi

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

Corrupt audio when transcoding uncompressed avi

Camara Caamaño, Xavier
Dear list,

My institution has transformed an old SD telecine and added a 4K camera with a Decklink capture card.
We are currently capturing Uncompressed avi.
After capture, the file plays correctly (both video and audio).
The problem comes when transcoding with ffmpeg (either transcoding to ffv1 or x264). After transcoding, the file plays incorrectly, with the sound playing only noise.

We realized that if we start the transcoding a few seconds after the beginning, the ouput file comes out well.
So, we are assuming the problem is the original file with a messed up timestamp (?)

The error it gives us is:

Invalid PCM packet, data has size 4 but at least a size of 6 was expected

I've searched the forum but didn't find anything related.

Our command is:



ffmpeg -i N:\CAPTURES\TELECINE\NITRATS-2019\FFMPEG-AUDIO-CRASH-TEST\ffmpeg\Audio-4K-25p.avi N:\CAPTURES\TELECINE\NITRATS-2019\FFMPEG-AUDIO-CRASH-TEST\ffmpeg\Audio-4K-25p.mp4



ffmpeg version N-93083-g8522d219ce Copyright (c) 2000-2019 the FFmpeg developers

  built with gcc 8.2.1 (Rev1, Built by MSYS2 project) 20181214

  configuration:  --disable-autodetect --enable-amf --enable-bzlib --enable-cuda --enable-cuvid --enable-d3d11va --enable-dxva2 --enable-iconv --enable-lzma --enable-nvenc --enable-zlib --enable-sdl2 --disable-debug --enable-ffnvcodec --enable-nvdec --enable-libmp3lame --enable-libopus --enable-libvorbis --enable-libvpx --enable-libx264 --enable-libx265 --enable-libdav1d --enable-fontconfig --enable-libass --enable-libbluray --enable-libfreetype --enable-libmfx --enable-libmysofa --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libtheora --enable-libtwolame --enable-libvidstab --enable-libvo-amrwbenc --enable-libwavpack --enable-libwebp --enable-libxml2 --enable-libzimg --enable-libshine --enable-gpl --enable-avisynth --enable-libxvid --enable-libaom --enable-version3 --enable-chromaprint --enable-decklink --enable-frei0r --enable-libbs2b --enable-libcaca --enable-libcdio --enable-libfdk-aac --enable-libflite --enable-libfribidi --enable-libgme --enable-libgsm --enable-libilbc --enable-libkvazaar --enable-libmodplug --enable-libopenh264 --enable-libopenmpt --enable-librtmp --enable-librubberband --enable-libssh --enable-libtesseract --enable-libxavs --enable-libzmq --enable-libzvbi --enable-opencl --enable-opengl --enable-libvmaf --enable-libcodec2 --enable-libsrt --enable-ladspa --enable-openssl --extra-cflags=-fopenmp --extra-libs=-lgomp --extra-cflags=-DLIBTWOLAME_STATIC --extra-libs=-lstdc++ --extra-cflags=-DLIBSSH_STATIC --extra-ldflags='-Wl,--allow-multiple-definition' --extra-cflags=-DCACA_STATIC --extra-cflags=-DMODPLUG_STATIC --extra-cflags=-DCHROMAPRINT_NODLL --extra-libs=-lstdc++ --extra-cflags=-DZMQ_STATIC --extra-libs=-lpsapi --extra-cflags=-DLIBXML_STATIC --extra-libs=-liconv --disable-w32threads --extra-cflags=-DKVZ_STATIC_LIB --enable-nonfree

  libavutil      56. 26.100 / 56. 26.100

  libavcodec     58. 46.100 / 58. 46.100

  libavformat    58. 26.100 / 58. 26.100

  libavdevice    58.  6.101 / 58.  6.101

  libavfilter     7. 48.100 /  7. 48.100

  libswscale      5.  4.100 /  5.  4.100

  libswresample   3.  4.100 /  3.  4.100

  libpostproc    55.  4.100 / 55.  4.100

[avi @ 000001ba2cae5400] Stream #0: not enough frames to estimate rate; consider increasing probesize

Guessed Channel Layout for Input Stream #0.1 : stereo

Input #0, avi, from 'N:\CAPTURES\TELECINE\NITRATS-2019\FFMPEG-AUDIO-CRASH-TEST\ffmpeg\Audio-4K-25p.avi':

  Duration: 00:00:05.92, start: 0.000000, bitrate: 4427770 kb/s

    Stream #0:0: Video: v210 (v210 / 0x30313276), yuv422p10le, 3840x2160, 25 fps, 25 tbr, 25 tbn, 25 tbc

    Stream #0:1: Audio: pcm_s24le ([1][0][0][0] / 0x0001), 48000 Hz, stereo, s32 (24 bit), 2304 kb/s

Stream mapping:

  Stream #0:0 -> #0:0 (v210 (native) -> h264 (libx264))

  Stream #0:1 -> #0:1 (pcm_s24le (native) -> aac (native))

Press [q] to stop, [?] for help

[libx264 @ 000001ba2cb02f00] using cpu capabilities: MMX2 SSE2Fast SSSE3 SSE4.2 AVX FMA3 BMI2 AVX2

[libx264 @ 000001ba2cb02f00] profile High 4:2:2, level 5.1, 4:2:2, 10-bit

[libx264 @ 000001ba2cb02f00] 264 - core 157 r2935 545de2f - H.264/MPEG-4 AVC codec - Copyleft 2003-2018 - http://www.videolan.org/x264.html - options: cabac=1 ref=3 deblock=1:0:0 analyse=0x3:0x113 me=hex subme=7 psy=1 psy_rd=1.00:0.00 mixed_ref=1 me_range=16 chroma_me=1 trellis=1 8x8dct=1 cqm=0 deadzone=21,11 fast_pskip=1 chroma_qp_offset=-2 threads=60 lookahead_threads=10 sliced_threads=0 nr=0 decimate=1 interlaced=0 bluray_compat=0 constrained_intra=0 bframes=3 b_pyramid=2 b_adapt=1 b_bias=0 direct=1 weightb=1 open_gop=0 weightp=2 keyint=250 keyint_min=25 scenecut=40 intra_refresh=0 rc_lookahead=40 rc=crf mbtree=1 crf=23.0 qcomp=0.60 qpmin=0 qpmax=81 qpstep=4 ip_ratio=1.40 aq=1:1.00

Output #0, mp4, to 'N:\CAPTURES\TELECINE\NITRATS-2019\FFMPEG-AUDIO-CRASH-TEST\ffmpeg\Audio-4K-25p.mp4':

  Metadata:

    encoder         : Lavf58.26.100

    Stream #0:0: Video: h264 (libx264) (avc1 / 0x31637661), yuv422p10le(progressive), 3840x2160, q=-1--1, 25 fps, 12800 tbn, 25 tbc

    Metadata:

      encoder         : Lavc58.46.100 libx264

    Side data:

      cpb: bitrate max/min/avg: 0/0/0 buffer size: 0 vbv_delay: -1

    Stream #0:1: Audio: aac (LC) (mp4a / 0x6134706D), 48000 Hz, stereo, fltp (24 bit), 128 kb/s

    Metadata:

      encoder         : Lavc58.46.100 aac

[pcm_s24le @ 000001ba2cb13b00] Multiple frames in a packet.bitrate= 122.6kbits/s speed=  26x

[pcm_s24le @ 000001ba2cb13b00] Invalid PCM packet, data has size 4 but at least a size of 6 was expected

Error while decoding stream #0:1: Invalid data found when processing input

[avi @ 000001ba2cae5400] Switching to NI mode, due to poor interleaving

frame=  148 fps=6.0 q=-1.0 Lsize=   13680kB time=00:04:09.89 bitrate= 448.4kbits/s speed=10.1x

video:9715kB audio:3916kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 0.359518%

[libx264 @ 000001ba2cb02f00] frame I:4     Avg QP:34.57  size:142338

[libx264 @ 000001ba2cb02f00] frame P:40    Avg QP:37.03  size: 81535

[libx264 @ 000001ba2cb02f00] frame B:104   Avg QP:37.50  size: 58813

[libx264 @ 000001ba2cb02f00] consecutive B-frames:  5.4%  1.4%  4.1% 89.2%

[libx264 @ 000001ba2cb02f00] mb I  I16..4: 26.7% 65.2%  8.1%

[libx264 @ 000001ba2cb02f00] mb P  I16..4:  8.4% 18.6%  1.3%  P16..4: 27.4%  7.5%  2.6%  0.0%  0.0%    skip:34.3%

[libx264 @ 000001ba2cb02f00] mb B  I16..4:  4.1%  4.3%  0.1%  B16..8: 38.7%  6.4%  0.7%  direct: 3.4%  skip:42.4%  L0:50.4% L1:48.5% BI: 1.1%

[libx264 @ 000001ba2cb02f00] 8x8 transform intra:60.5% inter:87.4%

[libx264 @ 000001ba2cb02f00] coded y,uvDC,uvAC intra: 38.7% 0.0% 0.0% inter: 19.9% 0.0% 0.0%

[libx264 @ 000001ba2cb02f00] i16 v,h,dc,p: 15% 62%  2% 21%

[libx264 @ 000001ba2cb02f00] i8 v,h,dc,ddl,ddr,vr,hd,vl,hu: 17% 16% 13%  7% 10% 11% 10%  8%  8%

[libx264 @ 000001ba2cb02f00] i4 v,h,dc,ddl,ddr,vr,hd,vl,hu: 25% 17% 10%  8% 11% 11%  7%  6%  4%

[libx264 @ 000001ba2cb02f00] i8c dc,h,v,p: 100%  0%  0%  0%

[libx264 @ 000001ba2cb02f00] Weighted P-Frames: Y:0.0% UV:0.0%

[libx264 @ 000001ba2cb02f00] ref P L0: 56.6% 24.5% 18.9%

[libx264 @ 000001ba2cb02f00] ref B L0: 72.6% 20.7%  6.8%


We have uploaded a sample file:
https://drive.google.com/file/d/1HirBRHUcqLB_HLtadzp2mbRNZhXsWGit/view?usp=sharing
I apologize the file is 3GB (for only 10 seconds! As it's an uncompressed 4K file) but we didn't want to modify the file for testing purposes.

We tried using ffmpeg to directly capture from the Decklink using our preferred archival codec (ffv1) but at 4K it was mission impossible, too many drops even by increasing the buffer).

Regards

Xavi

Xavier Càmara
Centre de Conservació i Restauració
[cid:image001.png@01D50662.1B4A8D50]
Carretera BV-1274 Km.1   Tel. 93 693 26 54 Ext. 15905
08225 Terrassa                    Email: [hidden email]<mailto:[hidden email]>


_______________________________________________
ffmpeg-user mailing list
[hidden email]
https://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
[hidden email] with subject "unsubscribe".

image001.png (11K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Corrupt audio when transcoding uncompressed avi

Carl Eugen Hoyos-2
Am Fr., 10. Mai 2019 um 09:20 Uhr schrieb Camara Caamaño, Xavier
<[hidden email]>:

> My institution has transformed an old SD telecine and added a 4K camera with a Decklink capture card.
> We are currently capturing Uncompressed avi.

What writes the uncompressed avi file?
The avi file is badly interleaved, while it is a bug in FFmpeg that it
mishandles the bad
interleaving, avi was not intended to write uncompressed 4k files...

> After capture, the file plays correctly (both video and audio).

What application did you test playback with?

> The problem comes when transcoding with ffmpeg (either transcoding to ffv1 or x264). After transcoding,
> the file plays incorrectly, with the sound playing only noise.

> We realized that if we start the transcoding a few seconds after the beginning, the ouput file comes out well.

Do you mean it works when seeking?

> So, we are assuming the problem is the original file with a messed up timestamp (?)

No, if you compare the console output of older and newer FFmpeg, you see the
difference: Old versions correctly detected the bad interleaving and handled it
accordingly.

> The error it gives us is:
>
> Invalid PCM packet, data has size 4 but at least a size of 6 was expected

That is an additional regression on top of the interleaving detection:
Some FFmpeg versions do not create white noise, just eat a part of the output.

[...]

>   configuration:  --disable-autodetect ...

Just curious: Why do you need nvenc, openh264 and x264?
(Or where did you find this binary?)

Carl Eugen
_______________________________________________
ffmpeg-user mailing list
[hidden email]
https://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
[hidden email] with subject "unsubscribe".
Reply | Threaded
Open this post in threaded view
|

Re: Corrupt audio when transcoding uncompressed avi

Carl Eugen Hoyos-2
In reply to this post by Camara Caamaño, Xavier
Am Fr., 10. Mai 2019 um 09:20 Uhr schrieb Camara Caamaño, Xavier
<[hidden email]>:

> My institution has transformed an old SD telecine and added a 4K camera with a Decklink capture card.
> We are currently capturing Uncompressed avi.
> After capture, the file plays correctly (both video and audio).
> The problem comes when transcoding with ffmpeg (either transcoding to ffv1 or x264). After
> transcoding, the file plays incorrectly, with the sound playing only noise.

Should be fixed in ab648f79, thank you for the useful report!

I am still curious where you get your binaries from...

Carl Eugen
_______________________________________________
ffmpeg-user mailing list
[hidden email]
https://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
[hidden email] with subject "unsubscribe".
Reply | Threaded
Open this post in threaded view
|

Re: Corrupt audio when transcoding uncompressed avi

Moritz Barsnick
On Fri, May 10, 2019 at 11:01:34 +0200, Carl Eugen Hoyos wrote:
> I am still curious where you get your binaries from...

It looks very much like something which was created by this build
script:
https://github.com/jb-alvarado/media-autobuild_suite

Moritz
_______________________________________________
ffmpeg-user mailing list
[hidden email]
https://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
[hidden email] with subject "unsubscribe".