[FFmpeg-user] problem of transcoding HD DVB-T program

Soundwin / Andy andy.cheng at soundwin.com
Wed Jun 25 13:15:08 CEST 2014


Thank you very much!

Our system is responsible for transcoding the DVB-T streams(generated by
dvblast) into HLS format, users can access our system to watch videos via
smart phones

I have tried to modify the parameters which you hint, and it seems that it
is much more stable than before.

The transcoding server is with the Intel Core i7 4770, and it runs two
ffmpeg instances, one dvblast instance.

Therefore, ffmpeg can use the slow preset because the cpu loading is not
very heavy.

  PID USER      PR  NI    VIRT    RES    SHR S  %CPU %MEM     TIME+ COMMAND
 1130 root       0 -20 1042296 207644   3760 S 243.0  2.6 110:43.29 ffmpeg
11101 root       0 -20 1173340 206592   3788 S  59.1  2.6  31:58.05 ffmpeg
 1117 root      -2   0   12352   2592    956 S   6.6  0.0   1:37.03 dvblast

However, it stops to transcode sometimes in random.
In addition, it sometimes outputs " Non-monotonous DTS in output stream", "
Delay between the first packet and last packet", " no picture" and the
ffmpeg should be restarted to return to normal.
It's not big problem because the shell script will rerun it automatically,
but I still desire to solve these problem.

Now, I try to record the udp stream generated by dvblast to a file.
Second, that file will be transcoded by ffmpeg in same parameters to
determine these strange phenomenon will not happen again


The final command and output is in the below.

/home/andy/ffmpeg -re -f mpegts -i udp://127.0.0.1:50000 -c:v libx264
-preset slow -deinterlace -crf 23 -pix_fmt yuv420p -g 150 -acodec libfdk_aac
-b:a 128k -ac 2 -ar 44100 -loglevel debug -threads 0 -hls_time 5
-hls_list_size 24 -hls_wrap 100 -f hls /mnt/video/1/E139091DC956.m3u8

And, the below output is ffmpeg stops to transcode.

ffmpeg version 2.2.git Copyright (c) 2000-2014 the FFmpeg developers
  built on Jun 19 2014 13:29:19 with gcc 4.8 (Ubuntu 4.8.2-19ubuntu1)
  configuration: --prefix=/root/ffmpeg_build --enable-static
--extra-cflags='-I/root/ffmpeg_build/include -static'
--extra-ldflags='-L/root/ffmpeg_build/lib -static' --bindir=/root/bin
--extra-libs=-ldl --enable-gpl --enable-libfdk-aac --enable-libmp3lame
--enable-libopus --enable-libtheora --enable-libvorbis --enable-libvpx
--enable-libx264 --enable-nonfree --disable-shared --enable-bzlib
--enable-zlib --enable-postproc --enable-runtime-cpudetect --enable-gray
--enable-libopenjpeg --enable-libspeex --enable-libvo-aacenc
--enable-libvo-amrwbenc --enable-version3 --enable-libfdk_aac
  libavutil      52. 89.100 / 52. 89.100
  libavcodec     55. 67.100 / 55. 67.100
  libavformat    55. 43.100 / 55. 43.100
  libavdevice    55. 13.101 / 55. 13.101
  libavfilter     4.  8.100 /  4.  8.100
  libswscale      2.  6.100 /  2.  6.100
  libswresample   0. 19.100 /  0. 19.100
  libpostproc    52.  3.100 / 52.  3.100
Splitting the commandline.
Reading option '-re' ... matched as option 're' (read input at native frame
rate) with argument '1'.
Reading option '-f' ... matched as option 'f' (force format) with argument
'mpegts'.
Reading option '-i' ... matched as input file with argument
'udp://127.0.0.1:50001'.
Reading option '-c:v' ... matched as option 'c' (codec name) with argument
'libx264'.
Reading option '-preset' ... matched as AVOption 'preset' with argument
'slow'.
Reading option '-deinterlace' ... matched as option 'deinterlace' (this
option is deprecated, use the yadif filter instead) with argument '1'.
Reading option '-crf' ... matched as AVOption 'crf' with argument '23'.
Reading option '-pix_fmt' ... matched as option 'pix_fmt' (set pixel format)
with argument 'yuv420p'.
Reading option '-g' ... matched as AVOption 'g' with argument '150'.
Reading option '-acodec' ... matched as option 'acodec' (force audio codec
('copy' to copy stream)) with argument 'libfdk_aac'.
Reading option '-b:a' ... matched as option 'b' (video bitrate (please use
-b:v)) with argument '128k'.
Reading option '-ac' ... matched as option 'ac' (set number of audio
channels) with argument '2'.
Reading option '-ar' ... matched as option 'ar' (set audio sampling rate (in
Hz)) with argument '44100'.
Reading option '-loglevel' ... matched as option 'loglevel' (set logging
level) with argument 'debug'.
Reading option '-threads' ... matched as AVOption 'threads' with argument
'0'.
Reading option '-hls_time' ... matched as AVOption 'hls_time' with argument
'5'.
Reading option '-hls_list_size' ... matched as AVOption 'hls_list_size' with
argument '24'.
Reading option '-hls_wrap' ... matched as AVOption 'hls_wrap' with argument
'100'.
Reading option '-f' ... matched as option 'f' (force format) with argument
'hls'.
Reading option '/mnt/video/2/9A8E018C008D.m3u8' ... matched as output file.
Finished splitting the commandline.
Parsing a group of options: global .
Applying option deinterlace (this option is deprecated, use the yadif filter
instead) with argument 1.
Applying option loglevel (set logging level) with argument debug.
Successfully parsed a group of options.
Parsing a group of options: input file udp://127.0.0.1:50001.
Applying option re (read input at native frame rate) with argument 1.
Applying option f (force format) with argument mpegts.
Successfully parsed a group of options.
Opening an input file: udp://127.0.0.1:50001.
[udp @ 0x3f4d100] end receive buffer size reported is 131072
[mpegts @ 0x3f4d920] stream=0 stream_type=2 pid=3f3 prog_reg_desc=
[mpegts @ 0x3f4d920] stream=1 stream_type=3 pid=3f4 prog_reg_desc=
[mpegts @ 0x3f4d920] Before avformat_find_stream_info() pos: 0 bytes
read:38164 seeks:0
[mpegts @ 0x3f4d920] All programs have pmt, headers found
[mpeg2video @ 0x3f61880] Invalid frame dimensions 0x0.
    Last message repeated 10 times
[mpegts @ 0x3f4d920] All info found
[mpegts @ 0x3f4d920] After avformat_find_stream_info() pos: 140248 bytes
read:140812 seeks:0 frames:45
Input #0, mpegts, from 'udp://127.0.0.1:50001':
  Duration: N/A, start: 73759.666922, bitrate: 122 kb/s
  Program 101
    Stream #0:0[0x3f3], 21, 1/90000: Video: mpeg2video (Main) ([2][0][0][0]
/ 0x0002), yuv420p(tv), 704x480 [SAR 10:11 DAR 4:3], 1001/60000, max. 15000
kb/s, 29.97 fps, 29.97 tbr, 90k tbn, 59.94 tbc
    Stream #0:1[0x3f4], 24, 1/90000: Audio: mp2 ([3][0][0][0] / 0x0003),
48000 Hz, stereo, s16p, 122 kb/s
Successfully opened the file.
Parsing a group of options: output file /mnt/video/2/9A8E018C008D.m3u8.
Applying option c:v (codec name) with argument libx264.
Applying option pix_fmt (set pixel format) with argument yuv420p.
Applying option acodec (force audio codec ('copy' to copy stream)) with
argument libfdk_aac.
Applying option b:a (video bitrate (please use -b:v)) with argument 128k.
Applying option ac (set number of audio channels) with argument 2.
Applying option ar (set audio sampling rate (in Hz)) with argument 44100.
Applying option f (force format) with argument hls.
Successfully parsed a group of options.
Opening an output file: /mnt/video/2/9A8E018C008D.m3u8.
Successfully opened the file.
detected 8 logical cores
[graph 0 input from stream 0:0 @ 0x3f3ce00] Setting 'video_size' to value
'704x480'
[graph 0 input from stream 0:0 @ 0x3f3ce00] Setting 'pix_fmt' to value '0'
[graph 0 input from stream 0:0 @ 0x3f3ce00] Setting 'time_base' to value
'1/90000'
[graph 0 input from stream 0:0 @ 0x3f3ce00] Setting 'pixel_aspect' to value
'10/11'
[graph 0 input from stream 0:0 @ 0x3f3ce00] Setting 'sws_param' to value
'flags=2'
[graph 0 input from stream 0:0 @ 0x3f3ce00] Setting 'frame_rate' to value
'30000/1001'
[graph 0 input from stream 0:0 @ 0x3f3ce00] w:704 h:480 pixfmt:yuv420p
tb:1/90000 fr:30000/1001 sar:10/11 sws_param:flags=2
[format @ 0x3f82820] compat: called with args=[yuv420p]
[format @ 0x3f82820] Setting 'pix_fmts' to value 'yuv420p'
[AVFilterGraph @ 0x3f3c980] query_formats: 5 queried, 4 merged, 0 already
done, 0 delayed
[graph 1 input from stream 0:1 @ 0x3f82740] Setting 'time_base' to value
'1/48000'
[graph 1 input from stream 0:1 @ 0x3f82740] Setting 'sample_rate' to value
'48000'
[graph 1 input from stream 0:1 @ 0x3f82740] Setting 'sample_fmt' to value
's16p'
[graph 1 input from stream 0:1 @ 0x3f82740] Setting 'channel_layout' to
value '0x3'
[graph 1 input from stream 0:1 @ 0x3f82740] tb:1/48000 samplefmt:s16p
samplerate:48000 chlayout:0x3
[audio format for output stream 0:1 @ 0x3f84b20] Setting 'sample_fmts' to
value 's16'
[audio format for output stream 0:1 @ 0x3f84b20] Setting 'sample_rates' to
value '44100'
[audio format for output stream 0:1 @ 0x3f84b20] Setting 'channel_layouts'
to value '0x3'
[audio format for output stream 0:1 @ 0x3f84b20] auto-inserting filter
'auto-inserted resampler 0' between the filter 'Parsed_anull_0' and the
filter 'audio format for output stream 0:1'
[AVFilterGraph @ 0x3f84900] query_formats: 4 queried, 6 merged, 3 already
done, 0 delayed
[auto-inserted resampler 0 @ 0x3f35740] ch:2 chl:stereo fmt:s16p r:48000Hz
-> ch:2 chl:stereo fmt:s16 r:44100Hz
[libx264 @ 0x3f80b00] using mv_range_thread = 24
[libx264 @ 0x3f80b00] using SAR=10/11
[libx264 @ 0x3f80b00] using cpu capabilities: MMX2 SSE2Fast SSSE3 SSE4.2 AVX
AVX2 FMA3 LZCNT BMI2
[libx264 @ 0x3f80b00] profile High, level 3.0
[mpegts @ 0x4613480] muxrate VBR, pcr every 2 pkts, sdt every 200, pat/pmt
every 40 pkts
Output #0, hls, to '/mnt/video/2/9A8E018C008D.m3u8':
  Metadata:
    encoder         : Lavf55.43.100
    Stream #0:0, 0, 1/90000: Video: h264 (libx264), yuv420p, 704x480 [SAR
10:11 DAR 4:3], 1001/30000, q=-1--1, 29.97 fps, 90k tbn, 29.97 tbc
    Metadata:
      encoder         : Lavc55.67.100 libx264
    Stream #0:1, 0, 1/90000: Audio: aac (libfdk_aac), 44100 Hz, stereo, s16,
128 kb/s
    Metadata:
      encoder         : Lavc55.67.100 libfdk_aac
Stream mapping:
  Stream #0:0 -> #0:0 (mpeg2video (native) -> h264 (libx264))
  Stream #0:1 -> #0:1 (mp2 (native) -> aac (libfdk_aac))
Press [q] to stop, [?] for help
*** 21 dup!
frame=   24 fps=0.0 q=0.0 size=N/A time=00:00:00.51 bitrate=N/A dup=21
drop=0    ^Mframe=   39 fps= 38 q=0.0 size=N/A time=00:00:00.65 bitrate=N/A
dup=21 drop=0    ^Mframe=   54 fps= 36 q=0.0 size=N/A time=00:00:01.23
bitrate=N/A dup=21 drop=0    ^M[libx264 @ 0x3f80b00] frame=   0 QP=19.22
NAL=3 Slice:I Poc:0   I:1320 P:0    SKIP:0    size=44296 bytes
[libx264 @ 0x3f80b00] frame=   1 QP=19.48 NAL=2 Slice:P Poc:8   I:5    P:125
SKIP:1190 size=449 bytes
[libx264 @ 0x3f80b00] frame=   2 QP=22.81 NAL=2 Slice:B Poc:4   I:0    P:62
SKIP:1258 size=88 bytes
[libx264 @ 0x3f80b00] frame=   3 QP=25.17 NAL=0 Slice:B Poc:2   I:0    P:66
SKIP:1254 size=95 bytes
frame=   70 fps= 35 q=29.0 size=N/A time=00:00:01.81 bitrate=N/A dup=21
drop=0    ^M[libx264 @ 0x3f80b00] frame=   4 QP=30.93 NAL=0 Slice:B Poc:6
I:0    P:17   SKIP:1303 size=41 bytes
[libx264 @ 0x3f80b00] frame=   5 QP=18.01 NAL=2 Slice:P Poc:16  I:0    P:54
SKIP:1266 size=162 bytes
[libx264 @ 0x3f80b00] frame=   6 QP=25.39 NAL=2 Slice:B Poc:12  I:0    P:21
SKIP:1299 size=51 bytes
[libx264 @ 0x3f80b00] frame=   7 QP=26.39 NAL=0 Slice:B Poc:10  I:0    P:31
SKIP:1289 size=61 bytes
[libx264 @ 0x3f80b00] frame=   8 QP=25.44 NAL=0 Slice:B Poc:14  I:0    P:23
SKIP:1297 size=45 bytes
[libx264 @ 0x3f80b00] frame=   9 QP=17.64 NAL=2 Slice:P Poc:24  I:0    P:25
SKIP:1295 size=95 bytes
[libx264 @ 0x3f80b00] frame=  10 QP=34.00 NAL=2 Slice:B Poc:20  I:0    P:19
SKIP:1301 size=46 bytes
[libx264 @ 0x3f80b00] frame=  11 QP=30.93 NAL=0 Slice:B Poc:18  I:0    P:24
SKIP:1296 size=50 bytes
[libx264 @ 0x3f80b00] frame=  12 QP=30.93 NAL=0 Slice:B Poc:22  I:0    P:15
SKIP:1305 size=40 bytes
[libx264 @ 0x3f80b00] frame=  13 QP=19.36 NAL=2 Slice:P Poc:32  I:1    P:27
SKIP:1292 size=100 bytes
[libx264 @ 0x3f80b00] frame=  14 QP=34.00 NAL=2 Slice:B Poc:28  I:0    P:19
SKIP:1301 size=46 bytes
[libx264 @ 0x3f80b00] frame=  15 QP=35.00 NAL=0 Slice:B Poc:26  I:0    P:6
SKIP:1314 size=27 bytes
[libx264 @ 0x3f80b00] frame=  16 QP=30.93 NAL=0 Slice:B Poc:30  I:0    P:15
SKIP:1305 size=38 bytes
[libx264 @ 0x3f80b00] frame=  17 QP=18.47 NAL=2 Slice:P Poc:40  I:3    P:28
SKIP:1289 size=128 bytes
[libx264 @ 0x3f80b00] frame=  18 QP=23.41 NAL=2 Slice:B Poc:36  I:0    P:21
SKIP:1299 size=52 bytes
frame=   85 fps= 34 q=29.0 size=N/A time=00:00:02.11 bitrate=N/A dup=21
drop=0    ^M[libx264 @ 0x3f80b00] frame=  19 QP=35.00 NAL=0 Slice:B Poc:34
I:0    P:11   SKIP:1309 size=32 bytes
[libx264 @ 0x3f80b00] frame=  20 QP=35.00 NAL=0 Slice:B Poc:38  I:0    P:10
SKIP:1310 size=30 bytes
[libx264 @ 0x3f80b00] frame=  21 QP=16.90 NAL=2 Slice:P Poc:42  I:0    P:21
SKIP:1299 size=86 bytes
[libx264 @ 0x3f80b00] frame=  22 QP=22.28 NAL=2 Slice:P Poc:50  I:90   P:687
SKIP:543  size=8388 bytes
[libx264 @ 0x3f80b00] frame=  23 QP=29.47 NAL=2 Slice:B Poc:46  I:3    P:449
SKIP:841  size=1977 bytes
[libx264 @ 0x3f80b00] frame=  24 QP=29.87 NAL=0 Slice:B Poc:44  I:1    P:291
SKIP:1018 size=908 bytes
[libx264 @ 0x3f80b00] frame=  25 QP=30.56 NAL=0 Slice:B Poc:48  I:0    P:292
SKIP:1018 size=803 bytes
[libx264 @ 0x3f80b00] frame=  26 QP=23.58 NAL=2 Slice:P Poc:58  I:34   P:485
SKIP:801  size=5750 bytes
[libx264 @ 0x3f80b00] frame=  27 QP=29.71 NAL=2 Slice:B Poc:54  I:1    P:336
SKIP:962  size=1774 bytes

....ignore due to amount of frames is too large

[mpegts @ 0x3f4d920] PES packet size mismatch
[mpeg2video @ 0x3f8c0e0] ac-tex damaged at 42 17
[mpeg2video @ 0x3f8c0e0] Warning MVs not available
[mpeg2video @ 0x3f8c0e0] concealing 572 DC, 572 AC, 572 MV errors in P frame
[libx264 @ 0x3f80b00] frame=140637 QP=27.61 NAL=2 Slice:B Poc:106 I:0
P:138  SKIP:1179 size=287 bytes
[mp2 @ 0x3f8c560] incomplete frame
Error while decoding stream #0:1: Invalid data found when processing input
udp://127.0.0.1:50001: Input/output error
[libx264 @ 0x3f80b00] frame=140638 QP=30.21 NAL=0 Slice:B Poc:104 I:0
P:122  SKIP:1198 size=224 bytes
[libx264 @ 0x3f80b00] frame=140639 QP=25.62 NAL=2 Slice:P Poc:112 I:29
P:428  SKIP:863  size=2915 bytes
[output stream 0:0 @ 0x3f8aa40] EOF on sink link output stream 0:0:default.
[output stream 0:1 @ 0x3f85b80] EOF on sink link output stream 0:1:default.
No more output streams to write to, finishing.
[libx264 @ 0x3f80b00] frame=140640 QP=29.28 NAL=0 Slice:B Poc:110 I:1
P:230  SKIP:1087 size=433 bytes
[libx264 @ 0x3f80b00] frame=140641 QP=20.42 NAL=3 Slice:I Poc:0   I:1320 P:0
SKIP:0    size=68555 bytes
[libx264 @ 0x3f80b00] frame=140642 QP=23.02 NAL=2 Slice:P Poc:8   I:120
P:958  SKIP:242  size=24444 bytes
[libx264 @ 0x3f80b00] frame=140643 QP=30.11 NAL=2 Slice:B Poc:4   I:1
P:446  SKIP:852  size=1474 bytes
[libx264 @ 0x3f80b00] frame=140644 QP=31.95 NAL=0 Slice:B Poc:2   I:0
P:404  SKIP:907  size=507 bytes
[libx264 @ 0x3f80b00] frame=140645 QP=32.91 NAL=0 Slice:B Poc:6   I:0
P:216  SKIP:1090 size=1211 bytes
[libx264 @ 0x3f80b00] frame=140646 QP=22.83 NAL=2 Slice:P Poc:14  I:30
P:973  SKIP:317  size=14101 bytes
[libx264 @ 0x3f80b00] frame=140647 QP=31.92 NAL=2 Slice:B Poc:12  I:0
P:344  SKIP:964  size=474 bytes
[libx264 @ 0x3f80b00] frame=140648 QP=31.53 NAL=0 Slice:B Poc:10  I:0
P:261  SKIP:1056 size=370 bytes
[libx264 @ 0x3f80b00] frame=140649 QP=22.94 NAL=2 Slice:P Poc:22  I:26
P:785  SKIP:509  size=10801 bytes
[libx264 @ 0x3f80b00] frame=140650 QP=29.47 NAL=2 Slice:B Poc:18  I:2
P:454  SKIP:859  size=897 bytes
[libx264 @ 0x3f80b00] frame=140651 QP=32.40 NAL=0 Slice:B Poc:16  I:0
P:216  SKIP:1102 size=324 bytes
[libx264 @ 0x3f80b00] frame=140652 QP=31.15 NAL=0 Slice:B Poc:20  I:0
P:205  SKIP:1113 size=305 bytes
[libx264 @ 0x3f80b00] frame=140653 QP=22.82 NAL=2 Slice:P Poc:30  I:26
P:896  SKIP:398  size=12322 bytes
[libx264 @ 0x3f80b00] frame=140654 QP=28.42 NAL=2 Slice:B Poc:26  I:2
P:330  SKIP:982  size=693 bytes
[libx264 @ 0x3f80b00] frame=140655 QP=31.68 NAL=0 Slice:B Poc:24  I:0
P:361  SKIP:953  size=431 bytes
[libx264 @ 0x3f80b00] frame=140656 QP=32.22 NAL=0 Slice:B Poc:28  I:0
P:324  SKIP:993  size=351 bytes
[libx264 @ 0x3f80b00] frame=140657 QP=23.28 NAL=2 Slice:P Poc:38  I:6
P:668  SKIP:646  size=6939 bytes
[libx264 @ 0x3f80b00] frame=140658 QP=29.01 NAL=2 Slice:B Poc:34  I:0
P:396  SKIP:919  size=592 bytes
[libx264 @ 0x3f80b00] frame=140659 QP=31.61 NAL=0 Slice:B Poc:32  I:1
P:240  SKIP:1078 size=270 bytes
[libx264 @ 0x3f80b00] frame=140660 QP=31.19 NAL=0 Slice:B Poc:36  I:0
P:154  SKIP:1164 size=222 bytes
[libx264 @ 0x3f80b00] frame=140661 QP=23.10 NAL=2 Slice:P Poc:44  I:7
P:731  SKIP:582  size=6597 bytes
[libx264 @ 0x3f80b00] frame=140662 QP=31.97 NAL=2 Slice:B Poc:42  I:0
P:274  SKIP:1044 size=354 bytes
[libx264 @ 0x3f80b00] frame=140663 QP=32.04 NAL=0 Slice:B Poc:40  I:0
P:229  SKIP:1089 size=282 bytes
[libx264 @ 0x3f80b00] frame=140664 QP=22.71 NAL=2 Slice:P Poc:52  I:70
P:1109 SKIP:141  size=17625 bytes
[libx264 @ 0x3f80b00] frame=140665 QP=28.09 NAL=2 Slice:B Poc:48  I:0
P:371  SKIP:945  size=569 bytes
[libx264 @ 0x3f80b00] frame=140666 QP=30.66 NAL=0 Slice:B Poc:46  I:0
P:368  SKIP:952  size=341 bytes
[libx264 @ 0x3f80b00] frame=140667 QP=27.19 NAL=0 Slice:B Poc:50  I:1
P:158  SKIP:1161 size=213 bytes
[libx264 @ 0x3f80b00] frame=140668 QP=23.17 NAL=2 Slice:P Poc:58  I:15
P:538  SKIP:767  size=4897 bytes
[libx264 @ 0x3f80b00] frame=140669 QP=28.77 NAL=2 Slice:B Poc:56  I:0
P:232  SKIP:1086 size=272 bytes
[libx264 @ 0x3f80b00] frame=140670 QP=26.82 NAL=0 Slice:B Poc:54  I:1
P:141  SKIP:1178 size=201 bytes
[libx264 @ 0x3f80b00] frame=140671 QP=23.38 NAL=2 Slice:P Poc:64  I:19
P:503  SKIP:798  size=4726 bytes
[libx264 @ 0x3f80b00] frame=140672 QP=32.97 NAL=2 Slice:B Poc:62  I:0
P:230  SKIP:1088 size=268 bytes
[libx264 @ 0x3f80b00] frame=140673 QP=29.74 NAL=0 Slice:B Poc:60  I:0
P:182  SKIP:1136 size=236 bytes
[libx264 @ 0x3f80b00] frame=140674 QP=23.51 NAL=2 Slice:P Poc:70  I:11
P:523  SKIP:786  size=4653 bytes
[libx264 @ 0x3f80b00] frame=140675 QP=32.58 NAL=2 Slice:B Poc:68  I:0
P:263  SKIP:1056 size=274 bytes
[libx264 @ 0x3f80b00] frame=140676 QP=31.07 NAL=0 Slice:B Poc:66  I:0
P:225  SKIP:1093 size=269 bytes
[libx264 @ 0x3f80b00] frame=140677 QP=23.74 NAL=2 Slice:P Poc:74  I:49
P:560  SKIP:711  size=8857 bytes
[libx264 @ 0x3f80b00] frame=140678 QP=34.00 NAL=0 Slice:B Poc:72  I:0
P:330  SKIP:974  size=1354 bytes
[libx264 @ 0x3f80b00] frame=140679 QP=24.28 NAL=2 Slice:P Poc:82  I:3
P:561  SKIP:756  size=7256 bytes
[libx264 @ 0x3f80b00] frame=140680 QP=27.32 NAL=2 Slice:B Poc:78  I:3
P:253  SKIP:1062 size=459 bytes
[libx264 @ 0x3f80b00] frame=140681 QP=33.81 NAL=0 Slice:B Poc:76  I:0
P:140  SKIP:1179 size=186 bytes
[libx264 @ 0x3f80b00] frame=140682 QP=30.98 NAL=0 Slice:B Poc:80  I:0
P:172  SKIP:1148 size=243 bytes
[libx264 @ 0x3f80b00] frame=140683 QP=24.84 NAL=2 Slice:P Poc:88  I:4
P:522  SKIP:794  size=4303 bytes
[libx264 @ 0x3f80b00] frame=140684 QP=29.15 NAL=2 Slice:B Poc:86  I:0
P:248  SKIP:1068 size=318 bytes
[libx264 @ 0x3f80b00] frame=140685 QP=30.47 NAL=0 Slice:B Poc:84  I:0
P:223  SKIP:1096 size=320 bytes
[libx264 @ 0x3f80b00] frame=140686 QP=24.13 NAL=2 Slice:P Poc:94  I:76
P:912  SKIP:332  size=11202 bytes
[libx264 @ 0x3f80b00] frame=140687 QP=29.78 NAL=2 Slice:B Poc:92  I:3
P:298  SKIP:1013 size=466 bytes
[libx264 @ 0x3f80b00] frame=140688 QP=31.52 NAL=0 Slice:B Poc:90  I:0
P:403  SKIP:916  size=480 bytes
[libx264 @ 0x3f80b00] frame=140689 QP=24.58 NAL=2 Slice:P Poc:98  I:36
P:592  SKIP:692  size=6330 bytes
[libx264 @ 0x3f80b00] frame=140690 QP=32.47 NAL=0 Slice:B Poc:96  I:1
P:343  SKIP:966  size=448 bytes
[libx264 @ 0x3f80b00] frame=140691 QP=25.08 NAL=2 Slice:P Poc:106 I:20
P:524  SKIP:776  size=4720 bytes
[libx264 @ 0x3f80b00] frame=140692 QP=30.20 NAL=2 Slice:B Poc:102 I:3
P:259  SKIP:1048 size=893 bytes
[libx264 @ 0x3f80b00] frame=140693 QP=32.31 NAL=0 Slice:B Poc:100 I:1
P:141  SKIP:1175 size=424 bytes
[libx264 @ 0x3f80b00] frame=140694 QP=33.09 NAL=0 Slice:B Poc:104 I:0
P:214  SKIP:1105 size=399 bytes
[libx264 @ 0x3f80b00] frame=140695 QP=25.73 NAL=2 Slice:P Poc:108 I:7
P:402  SKIP:911  size=2930 bytes
[libx264 @ 0x3f80b00] frame=140696 QP=26.08 NAL=2 Slice:P Poc:114 I:16
P:473  SKIP:831  size=4016 bytes
[libx264 @ 0x3f80b00] frame=140697 QP=32.85 NAL=2 Slice:B Poc:112 I:1
P:176  SKIP:1136 size=449 bytes
[libx264 @ 0x3f80b00] frame=140698 QP=32.22 NAL=0 Slice:B Poc:110 I:1
P:194  SKIP:1121 size=449 bytes
[libx264 @ 0x3f80b00] frame=140699 QP=27.23 NAL=2 Slice:P Poc:122 I:8
P:335  SKIP:977  size=2490 bytes
[libx264 @ 0x3f80b00] frame=140700 QP=29.44 NAL=2 Slice:B Poc:118 I:2
P:202  SKIP:1104 size=721 bytes
[libx264 @ 0x3f80b00] frame=140701 QP=32.20 NAL=0 Slice:B Poc:116 I:1
P:120  SKIP:1196 size=366 bytes
[libx264 @ 0x3f80b00] frame=140702 QP=31.61 NAL=0 Slice:B Poc:120 I:1
P:144  SKIP:1167 size=346 bytes
[libx264 @ 0x3f80b00] frame=140703 QP=29.12 NAL=2 Slice:P Poc:126 I:5
P:171  SKIP:1144 size=1210 bytes
[libx264 @ 0x3f80b00] frame=140704 QP=32.43 NAL=0 Slice:B Poc:124 I:1
P:99   SKIP:1217 size=356 bytes
[libx264 @ 0x3f80b00] frame=140705 QP=30.85 NAL=2 Slice:P Poc:128 I:7
P:132  SKIP:1181 size=836 bytes
[libfdk_aac @ 0x3f83bc0] Trying to remove 819 more samples than there are in
the queue
[AVIOContext @ 0x404aea0] Statistics: 0 seeks, 280 writeouts
[hls @ 0x3f8ca00] EXT-X-MEDIA-SEQUENCE:915
[AVIOContext @ 0x4a199a0] Statistics: 0 seeks, 1 writeouts
frame=140706 fps= 30 q=-1.0 Lsize=N/A time=01:18:14.82 bitrate=N/A dup=80
drop=0    ^M
video:546488kB audio:73298kB subtitle:0kB other streams:0kB global
headers:0kB muxing overhead: unknown
Input file #0 (udp://127.0.0.1:50001):
  Input stream #0:0 (video): 140686 packets read (869814977 bytes); 140628
frames decoded;
  Input stream #0:1 (audio): 195510 packets read (75086955 bytes); 195459
frames decoded (225168768 samples);
  Total: 336196 packets (944901932 bytes) demuxed
Output file #0 (/mnt/video/2/9A8E018C008D.m3u8):
  Output stream #0:0 (video): 140706 frames encoded; 140706 packets muxed
(559604215 bytes);
  Output stream #0:1 (audio): 202026 frames encoded (206873805 samples);
202028 packets muxed (75057348 bytes);
  Total: 342734 packets (634661563 bytes) muxed
336125 frames successfully decoded, 72 decoding errors
[libx264 @ 0x3f80b00] frame I:1025  Avg QP:20.02  size: 47316
[libx264 @ 0x3f80b00] frame P:45326 Avg QP:23.60  size:  8567
[libx264 @ 0x3f80b00] frame B:94355 Avg QP:29.68  size:  1301
[libx264 @ 0x3f80b00] consecutive B-frames:  3.4%  6.5% 44.9% 45.1%
[libx264 @ 0x3f80b00] mb I  I16..4: 15.5% 63.4% 21.1%
[libx264 @ 0x3f80b00] mb P  I16..4:  1.9%  5.0%  0.9%  P16..4: 32.5% 10.7%
6.9%  0.0%  0.0%    skip:42.0%
[libx264 @ 0x3f80b00] mb B  I16..4:  0.1%  0.3%  0.1%  B16..8: 22.6%  2.3%
0.6%  direct: 1.4%  skip:72.7%  L0:38.4% L1:51.5% BI:10.1%
[libx264 @ 0x3f80b00] 8x8 transform intra:63.9% inter:75.4%
[libx264 @ 0x3f80b00] direct mvs  spatial:100.0% temporal:0.0%
[libx264 @ 0x3f80b00] coded y,uvDC,uvAC intra: 62.5% 69.2% 32.1% inter:
11.0% 9.6% 1.7%
[libx264 @ 0x3f80b00] i16 v,h,dc,p: 31% 39%  8% 22%
[libx264 @ 0x3f80b00] i8 v,h,dc,ddl,ddr,vr,hd,vl,hu: 20% 16% 20%  6%  6%  8%
7%  8%  9%
[libx264 @ 0x3f80b00] i4 v,h,dc,ddl,ddr,vr,hd,vl,hu: 17% 19%  7%  7% 10% 10%
10%  9% 11%
[libx264 @ 0x3f80b00] i8c dc,h,v,p: 30% 36% 23% 11%
[libx264 @ 0x3f80b00] Weighted P-Frames: Y:0.8% UV:0.6%
[libx264 @ 0x3f80b00] ref P L0: 62.0% 12.2% 15.3%  4.1%  4.0%  2.3%  0.0%
[libx264 @ 0x3f80b00] ref B L0: 81.7% 13.3%  3.9%  1.1%
[libx264 @ 0x3f80b00] ref B L1: 92.9%  7.1%
[libx264 @ 0x3f80b00] kb/s:953.55
[AVIOContext @ 0x3f4cbc0] Statistics: 995960644 bytes read, 0 seeks

-----Original Message-----
From: ffmpeg-user-bounces at ffmpeg.org [mailto:ffmpeg-user-bounces at ffmpeg.org]
On Behalf Of Andy Furniss
Sent: Thursday, June 19, 2014 5:01 AM
To: FFmpeg user questions
Subject: Re: [FFmpeg-user] problem of transcoding HD DVB-T program

Soundwin / Andy wrote:
>> Thank you,
>>
>> Now I modify the command to the below. (remove the minrate and
>> maxrate, keep crf, remove -s 640x480, output to m3u8 format)
>>
>> /home/soundwin/ffmpeg -re -f mpegts -i udp://127.0.0.1:50000 -c:v
>> libx264 -preset slow -crf 23 -b:v 1000k -bufsize 1000k -pix_fmt
>> yuv420p -g 50 -acodec libvo_aacenc -b:a 128k -ac 2 -ar 44100
>> -loglevel debug -hls_time 5 -hls_wrap 100 -f hls
>> /mnt/video/1/E139091DC956.m3u8
>>
>> Is this command has other problems?

>I don't know really but I thought crf was variable bitrate any you now
>say -b:v 1000k which if it works is quite low for full res HD. I also
>don't know whether the buffer size is sane or not. Preset slow will use
>more cpu which could be an issue.

>There is still a slight issue with progressive vs interlaced in that
>x264 should probably be be set up differently for weave.

>>
>> BTW, sometimes the output stream appears only has video or audio.
>> Sorry I don't keep the complete ffmpeg output, the reason is that
>> there is a shell script will restart ffmpeg when it outputs specific
>>  string. (Non-monotonous DTS in output stream, Delay between the
>> first packet and last packet, no picture) I will try to keep all the
>> output logs.

>You could still be loosing buffers I suppose. Perhaps you could try
>-threads X where X is one less that how many cores you have so that
>there is spare for dvblast/v4l. Alternately you could try renice to give
>more prio to dvblast. I have no idea if either will help, just thinking
>of things to try.

>>
>> The three specific string outputted from ffmpeg which I mention
>> before will be occurred in random time(sometimes < 30mins, sometimes
>>>> 18hrs). If occurred, the monitor shell script will restart that
>> ffmpeg. In the same time, the UDP input stream looks normal from VLC
>>  player. Restarting the ffmpeg usually solves the problem, but
>> sometimes the computer needs to be rebooted or the ffmpeg will always
>> failed to generate normal output stream. Can the ffmpeg transcode the
>> input stream normally all year? (7*24*365)

>I don't know - the problem with broadcast transport streams is there are
>likely to be errors or gaps from missed reads caused by cpu load from
>transcoding in them that can trip up encoders.

>I don't know what your requirements/constraints are, but for home TV use
>I wouldn't consider transcoding live - far easier just to stream the ts
>with something like tvheadend and you get a pvr + epg + browser
>interface thrown in too.
_______________________________________________
>ffmpeg-user mailing list
>ffmpeg-user at ffmpeg.org
>http://ffmpeg.org/mailman/listinfo/ffmpeg-user



More information about the ffmpeg-user mailing list