У меня проблемы с кодированием файла "mp42" в mp4 (H264) с параметрами кодирования:

-vcodec libx264 -bufsize 32M -b:v 2800k -maxrate 3800k -g 63 -vf "scale=1280:720" -acodec aac -ab 192k -ar 44100 -ac 2 -strict experimental -profile:v baseline -level 3.1 -pix_fmt yuv420p"

Информация о видеофайле:

Metadata:
    major_brand     : mp42
    minor_version   : 0
    compatible_brands: mp42mp41
    creation_time   : 2017-09-15T15:25:16.000000Z
  Duration: 01:28:40.00, start: 0.000000, bitrate: 1479 kb/s
    Stream #0:0(eng): Video: h264 (Main) (avc1 / 0x31637661), yuv420p(tv, bt709), 1280x720, 2996 kb/s, 25 fps, 25 tbr, 25k tbn, 50 tbc (default)
    Metadata:
      creation_time   : 2017-09-15T15:25:16.000000Z
      handler_name    : Alias Data Handler
      encoder         : AVC Coding
    Stream #0:1(eng): Audio: aac (LC) (mp4a / 0x6134706D), 48000 Hz, stereo, fltp, 189 kb/s (default)

Вывод кодировки FFMPEG вставлен ниже. По разным причинам я не могу перейти на более новую установку ffmpeg вручную, но я использую версию пакета Debian (Debian OS 9.1) с довольно свежим ffmpeg.

Знают ли люди, с чем связана эта проблема, и была ли она решена в более свежих версиях ffmpeg?

ffmpeg version 3.2.7-1~deb9u1 Copyright (c) 2000-2017 the FFmpeg developers
built with gcc 6.3.0 (Debian 6.3.0-18) 20170516
configuration: --prefix=/usr --extra-version='1~deb9u1' --toolchain=hardened --libdir=/usr/lib/x86_64-linux-gnu --incdir=/usr/include/x86_64-linux-gnu --enable-gpl --disable-stripping --enable-avresample --enable-avisynth --enable-gnutls --enable-ladspa --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libcdio --enable-libebur128 --enable-libflite --enable-libfontconfig --enable-libfreetype --enable-libfribidi --enable-libgme --enable-libgsm --enable-libmp3lame --enable-libopenjpeg --enable-libopenmpt --enable-libopus --enable-libpulse --enable-librubberband --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libssh --enable-libtheora --enable-libtwolame --enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx265 --enable-libxvid --enable-libzmq --enable-libzvbi --enable-omx --enable-openal --enable-opengl --enable-sdl2 --enable-libdc1394 --enable-libiec61883 --enable-chromaprint --enable-frei0r --enable-libopencv --enable-libx264 --enable-shared
libavutil 55. 34.101 / 55. 34.101
libavcodec 57. 64.101 / 57. 64.101
libavformat 57. 56.101 / 57. 56.101
libavdevice 57. 1.100 / 57. 1.100
libavfilter 6. 65.100 / 6. 65.100
libavresample 3. 1. 0 / 3. 1. 0
libswscale 4. 2.100 / 4. 2.100
libswresample 2. 3.100 / 2. 3.100
libpostproc 54. 1.100 / 54. 1.100
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from '/usr/local/shellscripte/markly/download-robert_k.mp4-1506570833-1506568923/robert_k.mp4':
Metadata:
major_brand : mp42
minor_version : 0
compatible_brands: mp42mp41
creation_time : 2017-09-15T15:25:16.000000Z
Duration: 01:28:40.00, start: 0.000000, bitrate: 3206 kb/s
Stream #0:0(eng): Video: h264 (Main) (avc1 / 0x31637661), yuv420p(tv, bt709), 1280x720, 2996 kb/s, 25 fps, 25 tbr, 25k tbn, 50 tbc (default)
Metadata:
creation_time : 2017-09-15T15:25:16.000000Z
handler_name : Alias Data Handler
encoder : AVC Coding
Stream #0:1(eng): Audio: aac (LC) (mp4a / 0x6134706D), 48000 Hz, stereo, fltp, 189 kb/s (default)
Metadata:
creation_time : 2017-09-15T15:25:16.000000Z
handler_name : Alias Data Handler
[libx264 @ 0x5620b118ec60] VBV buffer (32000) > level limit (14000)
[libx264 @ 0x5620b118ec60] using cpu capabilities: MMX2 SSE2Fast SSSE3 SSE4.2 AVX FMA3 AVX2 LZCNT BMI2
[libx264 @ 0x5620b118ec60] profile Constrained Baseline, level 3.1
[libx264 @ 0x5620b118ec60] 264 - core 148 r2748 97eaef2 - H.264/MPEG-4 AVC codec - Copyleft 2003-2016 - http://www.videolan.org/x264.html - options: cabac=0 ref=1 deblock=1:0:0 analyse=0x1:0 me=dia subme=2 psy=1 psy_rd=1.00:0.00 mixed_ref=0 me_range=16 chroma_me=1 trellis=0 8x8dct=0 cqm=0 deadzone=21,11 fast_pskip=1 chroma_qp_offset=0 threads=22 lookahead_threads=5 sliced_threads=0 nr=0 decimate=1 interlaced=0 bluray_compat=0 constrained_intra=0 bframes=0 weightp=0 keyint=63 keyint_min=6 scenecut=40 intra_refresh=0 rc_lookahead=40 rc=abr mbtree=1 bitrate=2800 ratetol=1.0 qcomp=0.60 qpmin=0 qpmax=69 qpstep=4 vbv_maxrate=3800 vbv_bufsize=32000 nal_hrd=none filler=0 ip_ratio=1.40 aq=1:1.00
Output #0, mp4, to '/usr/local/shellscripte/markly/output-robert_k.mp4-1506570833-1506568923/robert_k_720p.mp4':
Metadata:
major_brand : mp42
minor_version : 0
compatible_brands: mp42mp41
encoder : Lavf57.56.101
Stream #0:0(eng): Video: h264 (libx264) ([33][0][0][0] / 0x0021), yuv420p, 1280x720, q=-1--1, 2800 kb/s, 25 fps, 12800 tbn, 25 tbc (default)
Metadata:
creation_time : 2017-09-15T15:25:16.000000Z
handler_name : Alias Data Handler
encoder : Lavc57.64.101 libx264
Side data:
cpb: bitrate max/min/avg: 3800000/0/2800000 buffer size: 32000000 vbv_delay: -1
Stream #0:1(eng): Audio: aac (LC) ([64][0][0][0] / 0x0040), 44100 Hz, stereo, fltp, 192 kb/s (default)
Metadata:
creation_time : 2017-09-15T15:25:16.000000Z
handler_name : Alias Data Handler
encoder : Lavc57.64.101 aac
Stream mapping:
Stream #0:0 -> #0:0 (h264 (native) -> h264 (libx264))
Stream #0:1 -> #0:1 (aac (native) -> aac (native))
Press [q] to stop, [?] for help
frame= 124 fps=0.0 q=3.0 size= 205kB time=00:00:05.52 bitrate= 303.6kbits/s speed= 11x 
frame= 237 fps=237 q=24.0 size= 2801kB time=00:00:09.93 bitrate=2308.9kbits/s speed=9.94x 
frame= 356 fps=237 q=28.0 size= 4978kB time=00:00:14.74 bitrate=2765.9kbits/s speed=9.83x
......
......
......
frame=36564 fps=167 q=26.0 size= 534254kB time=00:24:23.13 bitrate=2991.3kbits/s speed=6.67x 
[h264 @ 0x5620b0bcdf80] Reference 3 >= 3
[h264 @ 0x5620b0bcdf80] error while decoding MB 38 33, bytestream 3005
[h264 @ 0x5620b0bcdf80] concealing 971 DC, 971 AC, 971 MV errors in B frame
[h264 @ 0x5620b08a2200] Invalid nal size 930990328
[h264 @ 0x5620b08a2200] Error splitting the input into NAL units.
[h264 @ 0x5620b09490e0] Invalid nal size 1837326039
[h264 @ 0x5620b09490e0] Error splitting the input into NAL units.
[h264 @ 0x5620b0957020] Invalid nal size 187446698
[h264 @ 0x5620b0957020] Error splitting the input into NAL units.
[h264 @ 0x5620b0aecf80] Invalid nal size 145353988
[h264 @ 0x5620b0aecf80] Error splitting the input into NAL units.
[h264 @ 0x5620b0b08ae0] Invalid nal size -1036350434
[h264 @ 0x5620b0b08ae0] Error splitting the input into NAL units.
[h264 @ 0x5620b0dad3c0] Invalid nal size -1622171000
[h264 @ 0x5620b0dad3c0] Error splitting the input into NAL units.
[aac @ 0x5620b118fa20] Multiple frames in a packet.
[aac @ 0x5620b118fa20] channel element 2.13 is not allocated
Error while decoding stream #0:1: Invalid data found when processing input
[aac @ 0x5620b118fa20] channel element 3.12 is not allocated
Error while decoding stream #0:1: Invalid data found when processing input
[aac @ 0x5620b118fa20] Reserved bit set.
[aac @ 0x5620b118fa20] Prediction is not allowed in AAC-LC.
Error while decoding stream #0:1: Invalid data found when processing input
[aac @ 0x5620b118fa20] Number of bands (14) exceeds limit (5).
Error while decoding stream #0:1: Invalid data found when processing input
[aac @ 0x5620b118fa20] Reserved bit set.
[aac @ 0x5620b118fa20] Sample rate index in program config element does not match the sample rate index configured by the container.
[aac @ 0x5620b118fa20] Inconsistent channel configuration.
[aac @ 0x5620b118fa20] get_buffer() failed
Error while decoding stream #0:1: Invalid argument
[aac @ 0x5620b118fa20] Reserved bit set.
[aac @ 0x5620b118fa20] Number of scalefactor bands in group (57) exceeds limit (49).
Error while decoding stream #0:1: Invalid data found when processing input
[aac @ 0x5620b118fa20] Reserved bit set.
[aac @ 0x5620b118fa20] Prediction is not allowed in AAC-LC.
Error while decoding stream #0:1: Invalid data found when processing input
[aac @ 0x5620b118fa20] Sample rate index in program config element does not match the sample rate index configured by the container.
[aac @ 0x5620b118fa20] Remapped id too large
[aac @ 0x5620b118fa20] is not implemented. Update your FFmpeg version to the newest one from Git. If the problem still occurs, it means that your file has a feature which has not been implemented.
[aac @ 0x5620b118fa20] If you want to help, upload a sample of this file to ftp://upload.ffmpeg.org/incoming/ and contact the ffmpeg-devel mailing list. (ffmpeg-devel@ffmpeg.org)
Error while decoding stream #0:1: Not yet implemented in FFmpeg, patches welcome
[aac @ 0x5620b118fa20] Number of bands (3) exceeds limit (2).
Error while decoding stream #0:1: Invalid data found when processing input
[aac @ 0x5620b118fa20] channel element 3.8 is not allocated
Error while decoding stream #0:1: Invalid data found when processing input
[aac @ 0x5620b118fa20] Sample rate index in program config element does not match the sample rate index configured by the container.
[aac @ 0x5620b118fa20] Inconsistent channel configuration.
[aac @ 0x5620b118fa20] get_buffer() failed
Error while decoding stream #0:1: Invalid argument
[aac @ 0x5620b118fa20] Sample rate index in program config element does not match the sample rate index configured by the container.
[aac @ 0x5620b118fa20] Remapped id too large
[aac @ 0x5620b118fa20] is not implemented. Update your FFmpeg version to the newest one from Git. If the problem still occurs, it means that your file has a feature which has not been implemented.
[aac @ 0x5620b118fa20] If you want to help, upload a sample of this file to ftp: //upload.ffmpeg.org/incoming/ and contact the ffmpeg-devel mailing list. (ffmpeg-devel@ffmpeg.org)
Error while decoding stream #0:1: Not yet implemented in FFmpeg, patches welcome

2 ответа2

0

Так как выходные данные показывают ошибки декодирования, начиная с 24 минут, вы можете иметь некоторые повреждения в потоке. Я видел это раньше, когда потоки просто соединялись вместе с разными кодеками.

Вы можете быть в состоянии декодировать первые 24 минуты, ограничивая время декодирования с указанием длительности для ввода.

ffmpeg -t 24:23.13 -i <input> -vcodec libx264 -bufsize 32M -b:v 2800k -maxrate 3800k -g 63 -vf "scale=1280:720" -acodec aac -ab 192k -ar 44100 -ac 2 -strict experimental -profile:v baseline -level 3.1 -pix_fmt yuv420p"
0

Это похоже на регрессию Unable для декодирования некоторых чересстрочных потоков H.264

Я скачал 20180223 ночной сборки и файл примера в баге. Я вижу те же ошибки NAL :(

Всё ещё ищете ответ? Посмотрите другие вопросы с метками .