I have a TS-file, which I unfortunately can't share, that contains only one
PID, and that is a 4K HEVC-video stream at around 30Mbps.
This file is from the middle of a broadcast and thus it do not start
cleanly.

ffmpeg is not able to detect that the file is HEVC, and falls back to AAC
(with a score of 1), see [1].
I have tried to increase -probesize, but that does not seem to make any
difference.

After digging around I found that for hevc_probe to detect a stream it must
see at least the following NALs: "VPS", "SPS", "PPS" and "IRAP". My file
does not have thos NALs in the first 2.5 MB of the file, and it seems the
probe gives up after RAW_PACKET_BUFFER_SIZE (2500000) bytes.

Increasing that and recompiling makes ffmpeg work fine.

What is the correct approach for fixing this?



[1]:
ffmpeg version N-69051-ga9d700f Copyright (c) 2000-2015 the FFmpeg developers
  built on Jan 14 2015 17:08:10 with gcc 4.7 (Debian 4.7.2-5)
  configuration:
  libavutil      54. 16.100 / 54. 16.100
  libavcodec     56. 20.100 / 56. 20.100
  libavformat    56. 18.101 / 56. 18.101
  libavdevice    56.  4.100 / 56.  4.100
  libavfilter     5.  7.101 /  5.  7.101
  libswscale      3.  1.101 /  3.  1.101
  libswresample   1.  1.100 /  1.  1.100
Splitting the commandline.
Reading option '-y' ... matched as option 'y' (overwrite output files) with 
argument '1'.
Reading option '-an' ... matched as option 'an' (disable audio) with argument 
'1'.
Reading option '-probesize' ... matched as AVOption 'probesize' with argument 
'500000000000'.
Reading option '-i' ... matched as input file with argument 'fail.ts'.
Reading option '-vframes' ... matched as option 'vframes' (set the number of 
video frames to output) with argument '1'.
Reading option 'tt0.jpg' ... matched as output file.
Reading option '-v' ... matched as option 'v' (set logging level) with argument 
'repeat+48'.
Finished splitting the commandline.
Parsing a group of options: global .
Applying option y (overwrite output files) with argument 1.
Applying option v (set logging level) with argument repeat+48.
Successfully parsed a group of options.
Parsing a group of options: input file fail.ts.
Applying option an (disable audio) with argument 1.
Successfully parsed a group of options.
Opening an input file: fail.ts.
[mpegts @ 0x3338200] Format mpegts probed with size=2048 and score=100
[mpegts @ 0x3338200] Before avformat_find_stream_info() pos: 0 bytes 
read:7470556 seeks:1
[mpegts @ 0x3338200] stream=0 stream_type=0 pid=1e1 prog_reg_desc=
[mpegts @ 0x3338200] probing stream 0 pp:2500
[mpegts @ 0x3338200] Probe with size=92601, packets=1 detected aac with score=1
[mpegts @ 0x3338200] probing stream 0 pp:2499
[mpegts @ 0x3338200] probing stream 0 pp:2498
[mpegts @ 0x3338200] probing stream 0 pp:2497
[mpegts @ 0x3338200] probing stream 0 pp:2496
[mpegts @ 0x3338200] probing stream 0 pp:2495
[mpegts @ 0x3338200] probing stream 0 pp:2494
[mpegts @ 0x3338200] Probe with size=579503, packets=7 detected aac with score=1
[mpegts @ 0x3338200] probing stream 0 pp:2493
[mpegts @ 0x3338200] probing stream 0 pp:2492
[mpegts @ 0x3338200] probing stream 0 pp:2491
[mpegts @ 0x3338200] probing stream 0 pp:2490
[mpegts @ 0x3338200] probing stream 0 pp:2489
[mpegts @ 0x3338200] probing stream 0 pp:2488
[mpegts @ 0x3338200] Probe with size=1051138, packets=13 detected aac with 
score=1
[mpegts @ 0x3338200] probing stream 0 pp:2487
[mpegts @ 0x3338200] probing stream 0 pp:2486
[mpegts @ 0x3338200] probing stream 0 pp:2485
[mpegts @ 0x3338200] probing stream 0 pp:2484
[mpegts @ 0x3338200] probing stream 0 pp:2483
[mpegts @ 0x3338200] probing stream 0 pp:2482
[mpegts @ 0x3338200] probing stream 0 pp:2481
[mpegts @ 0x3338200] probing stream 0 pp:2480
[mpegts @ 0x3338200] probing stream 0 pp:2479
[mpegts @ 0x3338200] probing stream 0 pp:2478
[mpegts @ 0x3338200] probing stream 0 pp:2477
[mpegts @ 0x3338200] probing stream 0 pp:2476
[mpegts @ 0x3338200] probing stream 0 pp:2475
[mpegts @ 0x3338200] probing stream 0 pp:2474
[mpegts @ 0x3338200] probing stream 0 pp:2473
[mpegts @ 0x3338200] probing stream 0 pp:2472
[mpegts @ 0x3338200] probing stream 0 pp:2471
[mpegts @ 0x3338200] probing stream 0 pp:2470
[mpegts @ 0x3338200] probing stream 0 pp:2469
[mpegts @ 0x3338200] probing stream 0 pp:2468
[mpegts @ 0x3338200] probing stream 0 pp:2467
[mpegts @ 0x3338200] Probe with size=2577822, packets=34 detected aac with 
score=1
[mpegts @ 0x3338200] probed stream 0
[aac @ 0x333afc0] channel element 0.0 is not allocated
[aac @ 0x333afc0] channel element 2.12 is not allocated
[aac @ 0x333afc0] Prediction is not allowed in AAC-LC.
[aac @ 0x333afc0] More than one AAC RDB per ADTS frame 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 @ 0x333afc0] Assuming an incorrectly encoded 7.1 channel layout instead of 
a spec-compliant 7.1(wide) layout, use -strict 1 to decode according to the 
specification instead.
[aac @ 0x333afc0] channel element 2.12 is not allocated
[aac @ 0x333afc0] channel element 1.15 is not allocated
[aac @ 0x333afc0] channel element 1.4 is not allocated
[aac @ 0x333afc0] channel element 2.13 is not allocated
[aac @ 0x333afc0] Assuming an incorrectly encoded 7.1 channel layout instead of 
a spec-compliant 7.1(wide) layout, use -strict 1 to decode according to the 
specification instead.
[aac @ 0x333afc0] ChannelElement 3.0 missing
[aac @ 0x333afc0] ChannelElement 1.1 missing
[aac @ 0x333afc0] ChannelElement 1.2 missing
[aac @ 0x333afc0] ChannelElement 0.0 missing
[aac @ 0x333afc0] channel element 3.10 is not allocated
[aac @ 0x333afc0] Reserved bit set.
[aac @ 0x333afc0] channel element 1.9 is not allocated
.... snipped out tons of aac-errors, which are useless.
[aac @ 0x333afc0] channel element 2.12 is not allocated
[aac @ 0x333afc0] Reserved bit set.
[aac @ 0x333afc0] channel element 2.8 is not allocated
[mpegts @ 0x3338200] decoding for stream 0 failed
[mpegts @ 0x3338200] Could not find codec parameters for stream 0 (Audio: aac 
(SSR), mono, fltp, 576 kb/s): unspecified sample rate
Consider increasing the value for the 'analyzeduration' and 'probesize' options
[mpegts @ 0x3338200] After avformat_find_stream_info() pos: 0 bytes 
read:15191112 seeks:3 frames:1957
fail.ts: could not find codec parameters
Input #0, mpegts, from 'fail.ts':
  Duration: 00:00:01.84, start: 247.081333, bitrate: 32480 kb/s
    Stream #0:0[0x1e1], 1957, 1/90000: Audio: aac (SSR), mono, fltp, 576 kb/s
Successfully opened the file.
Parsing a group of options: output file tt0.jpg.
Applying option vframes (set the number of video frames to output) with 
argument 1.
Successfully parsed a group of options.
Opening an output file: tt0.jpg.
Successfully opened the file.
Output #0, image2, to 'tt0.jpg':
Output file #0 does not contain any stream
[AVIOContext @ 0x3337b20] Statistics: 15191112 bytes read, 3 seeks

-- 
Ståle Kristoffersen
_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel

Reply via email to