#8806 closed defect (needs_more_info)
apad filter seems not working with HLS output
| Reported by: | mrskman | Owned by: | |
|---|---|---|---|
| Priority: | normal | Component: | undetermined |
| Version: | unspecified | Keywords: | |
| Cc: | liuqi05@kuaishou.com | Blocked By: | |
| Blocking: | Reproduced by developer: | no | |
| Analyzed by developer: | no |
Description
I'm trying to add audio silence so the audio track length matches the length of video track. But it seems not working correctly.
The input file has ~30s of video and ~1s of audio.
ffprobe -i apad_filter_not_working_with_hls_output.mkv
ffprobe version 4.3.1 Copyright (c) 2007-2020 the FFmpeg developers
built with gcc 4.9.4 (Ubuntu 4.9.4-2ubuntu1~12.04)
configuration: --prefix=/opt/ffmpeg/4.3.1/build --cc= --cxx= --objcc= --dep-cc= --extra-cflags=' -I/usr/local/cuda-10.1/include' --extra-cxxflags= --extra-ldflags='-Wl,-rpath,/opt/ffmpeg/4.3.1/build/lib -L/opt/ffmpeg/4.3.1/build/lib -Wl,-rpath,/usr/local/cuda-10.1/lib64 -L/usr/local/cuda-10.1/lib64' --bindir=/opt/ffmpeg/4.3.1/build/bin --enable-shared --disable-static --disable-doc --disable-htmlpages --disable-manpages --disable-podpages --disable-txtpages --enable-cuda-nvcc --enable-gpl --enable-libaom --enable-libfdk-aac --enable-libmp3lame --enable-libnpp --enable-libopenjpeg --enable-libopus --enable-librtmp --enable-libtheora --enable-libvorbis --enable-libvpx --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxml2 --enable-nonfree --enable-nvdec --enable-nvenc --enable-openssl --enable-rpath --enable-version3
libavutil 56. 51.100 / 56. 51.100
libavcodec 58. 91.100 / 58. 91.100
libavformat 58. 45.100 / 58. 45.100
libavdevice 58. 10.100 / 58. 10.100
libavfilter 7. 85.100 / 7. 85.100
libswscale 5. 7.100 / 5. 7.100
libswresample 3. 7.100 / 3. 7.100
libpostproc 55. 7.100 / 55. 7.100
Input #0, matroska,webm, from 'apad_filter_not_working_with_hls_output.mkv':
Metadata:
ENCODER : Lavf58.45.100
Duration: 00:00:30.11, start: 0.000000, bitrate: 227 kb/s
Stream #0:0(eng): Video: h264 (High), yuv420p(tv, bt709, progressive), 1920x1080 [SAR 1:1 DAR 16:9], 23.98 fps, 23.98 tbr, 1k tbn, 47.95 tbc (default)
Metadata:
BPS : 212945
BPS-eng : 212945
DURATION-eng : 00:10:05.063000000
NUMBER_OF_FRAMES: 14507
NUMBER_OF_FRAMES-eng: 14507
NUMBER_OF_BYTES : 16105645
NUMBER_OF_BYTES-eng: 16105645
_STATISTICS_WRITING_APP: mkvmerge v7.2.0 ('On Every Street') 32bit built on Sep 13 2014 15:42:11
_STATISTICS_WRITING_APP-eng: mkvmerge v7.2.0 ('On Every Street') 32bit built on Sep 13 2014 15:42:11
_STATISTICS_WRITING_DATE_UTC: 2014-09-19 01:06:47
_STATISTICS_WRITING_DATE_UTC-eng: 2014-09-19 01:06:47
_STATISTICS_TAGS: BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES
_STATISTICS_TAGS-eng: BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES
DURATION : 00:00:30.113000000
Stream #0:1(eng): Audio: mp3, 48000 Hz, stereo, fltp, 80 kb/s (default)
Metadata:
BPS : 34181
BPS-eng : 34181
DURATION-eng : 00:00:01.056000000
NUMBER_OF_FRAMES: 44
NUMBER_OF_FRAMES-eng: 44
NUMBER_OF_BYTES : 4512
NUMBER_OF_BYTES-eng: 4512
_STATISTICS_WRITING_APP: mkvmerge v7.2.0 ('On Every Street') 32bit built on Sep 13 2014 15:42:11
_STATISTICS_WRITING_APP-eng: mkvmerge v7.2.0 ('On Every Street') 32bit built on Sep 13 2014 15:42:11
_STATISTICS_WRITING_DATE_UTC: 2014-09-19 01:06:47
_STATISTICS_WRITING_DATE_UTC-eng: 2014-09-19 01:06:47
_STATISTICS_TAGS: BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES
_STATISTICS_TAGS-eng: BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES
DURATION : 00:00:01.056000000
I'm trying to convert it to HLS using this command:
ffmpeg -i apad_filter_not_working_with_hls_output.mkv -filter_complex '[0:a]apad=whole_dur=30[audio]' -map '0:v' -map '[audio]' -f hls -hls_time 5 -y test.m3u8
ffmpeg version 4.3.1 Copyright (c) 2000-2020 the FFmpeg developers
built with gcc 4.9.4 (Ubuntu 4.9.4-2ubuntu1~12.04)
configuration: --prefix=/opt/ffmpeg/4.3.1/build --cc= --cxx= --objcc= --dep-cc= --extra-cflags=' -I/usr/local/cuda-10.1/include' --extra-cxxflags= --extra-ldflags='-Wl,-rpath,/opt/ffmpeg/4.3.1/build/lib -L/opt/ffmpeg/4.3.1/build/lib -Wl,-rpath,/usr/local/cuda-10.1/lib64 -L/usr/local/cuda-10.1/lib64' --bindir=/opt/ffmpeg/4.3.1/build/bin --enable-shared --disable-static --disable-doc --disable-htmlpages --disable-manpages --disable-podpages --disable-txtpages --enable-cuda-nvcc --enable-gpl --enable-libaom --enable-libfdk-aac --enable-libmp3lame --enable-libnpp --enable-libopenjpeg --enable-libopus --enable-librtmp --enable-libtheora --enable-libvorbis --enable-libvpx --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxml2 --enable-nonfree --enable-nvdec --enable-nvenc --enable-openssl --enable-rpath --enable-version3
libavutil 56. 51.100 / 56. 51.100
libavcodec 58. 91.100 / 58. 91.100
libavformat 58. 45.100 / 58. 45.100
libavdevice 58. 10.100 / 58. 10.100
libavfilter 7. 85.100 / 7. 85.100
libswscale 5. 7.100 / 5. 7.100
libswresample 3. 7.100 / 3. 7.100
libpostproc 55. 7.100 / 55. 7.100
Input #0, matroska,webm, from 'apad_filter_not_working_with_hls_output.mkv':
Metadata:
ENCODER : Lavf58.45.100
Duration: 00:00:30.11, start: 0.000000, bitrate: 227 kb/s
Stream #0:0(eng): Video: h264 (High), yuv420p(tv, bt709, progressive), 1920x1080 [SAR 1:1 DAR 16:9], 23.98 fps, 23.98 tbr, 1k tbn, 47.95 tbc (default)
Metadata:
BPS : 212945
BPS-eng : 212945
DURATION-eng : 00:10:05.063000000
NUMBER_OF_FRAMES: 14507
NUMBER_OF_FRAMES-eng: 14507
NUMBER_OF_BYTES : 16105645
NUMBER_OF_BYTES-eng: 16105645
_STATISTICS_WRITING_APP: mkvmerge v7.2.0 ('On Every Street') 32bit built on Sep 13 2014 15:42:11
_STATISTICS_WRITING_APP-eng: mkvmerge v7.2.0 ('On Every Street') 32bit built on Sep 13 2014 15:42:11
_STATISTICS_WRITING_DATE_UTC: 2014-09-19 01:06:47
_STATISTICS_WRITING_DATE_UTC-eng: 2014-09-19 01:06:47
_STATISTICS_TAGS: BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES
_STATISTICS_TAGS-eng: BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES
DURATION : 00:00:30.113000000
Stream #0:1(eng): Audio: mp3, 48000 Hz, stereo, fltp, 80 kb/s (default)
Metadata:
BPS : 34181
BPS-eng : 34181
DURATION-eng : 00:00:01.056000000
NUMBER_OF_FRAMES: 44
NUMBER_OF_FRAMES-eng: 44
NUMBER_OF_BYTES : 4512
NUMBER_OF_BYTES-eng: 4512
_STATISTICS_WRITING_APP: mkvmerge v7.2.0 ('On Every Street') 32bit built on Sep 13 2014 15:42:11
_STATISTICS_WRITING_APP-eng: mkvmerge v7.2.0 ('On Every Street') 32bit built on Sep 13 2014 15:42:11
_STATISTICS_WRITING_DATE_UTC: 2014-09-19 01:06:47
_STATISTICS_WRITING_DATE_UTC-eng: 2014-09-19 01:06:47
_STATISTICS_TAGS: BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES
_STATISTICS_TAGS-eng: BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES
DURATION : 00:00:01.056000000
Stream mapping:
Stream #0:1 (mp3float) -> apad (graph 0)
Stream #0:0 -> #0:0 (h264 (native) -> h264 (libx264))
apad (graph 0) -> Stream #0:1 (aac)
Press [q] to stop, [?] for help
[libx264 @ 0x13f4780] using SAR=1/1
[libx264 @ 0x13f4780] using cpu capabilities: MMX2 SSE2Fast SSSE3 SSE4.2 AVX FMA3 BMI2 AVX2
[libx264 @ 0x13f4780] profile Progressive High, level 4.0, 4:2:0, 8-bit
[libx264 @ 0x13f4780] 264 - core 157 - H.264/MPEG-4 AVC codec - Copyleft 2003-2019 - 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=34 lookahead_threads=5 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=23 scenecut=40 intra_refresh=0 rc_lookahead=40 rc=crf mbtree=1 crf=23.0 qcomp=0.60 qpmin=0 qpmax=69 qpstep=4 ip_ratio=1.40 aq=1:1.00
Output #0, hls, to 'test.m3u8':
Metadata:
encoder : Lavf58.45.100
Stream #0:0(eng): Video: h264 (libx264), yuv420p, 1920x1080 [SAR 1:1 DAR 16:9], q=-1--1, 23.98 fps, 90k tbn, 23.98 tbc (default)
Metadata:
BPS : 212945
BPS-eng : 212945
DURATION-eng : 00:10:05.063000000
NUMBER_OF_FRAMES: 14507
NUMBER_OF_FRAMES-eng: 14507
NUMBER_OF_BYTES : 16105645
NUMBER_OF_BYTES-eng: 16105645
_STATISTICS_WRITING_APP: mkvmerge v7.2.0 ('On Every Street') 32bit built on Sep 13 2014 15:42:11
_STATISTICS_WRITING_APP-eng: mkvmerge v7.2.0 ('On Every Street') 32bit built on Sep 13 2014 15:42:11
_STATISTICS_WRITING_DATE_UTC: 2014-09-19 01:06:47
_STATISTICS_WRITING_DATE_UTC-eng: 2014-09-19 01:06:47
_STATISTICS_TAGS: BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES
_STATISTICS_TAGS-eng: BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES
DURATION : 00:00:30.113000000
encoder : Lavc58.91.100 libx264
Side data:
cpb: bitrate max/min/avg: 0/0/0 buffer size: 0 vbv_delay: N/A
Stream #0:1: Audio: aac (LC), 48000 Hz, stereo, fltp, 128 kb/s (default)
Metadata:
encoder : Lavc58.91.100 aac
[hls @ 0x13e78c0] Opening 'test0.ts' for writing1.17 bitrate=N/A speed=7.39x
[hls @ 0x13e78c0] Opening 'test.m3u8.tmp' for writing
[hls @ 0x13e78c0] Opening 'test1.ts' for writing3.56 bitrate=N/A speed=7.81x
[hls @ 0x13e78c0] Opening 'test.m3u8.tmp' for writing
[hls @ 0x13e78c0] Opening 'test2.ts' for writing6.73 bitrate=N/A speed= 7.6x
[hls @ 0x13e78c0] Opening 'test.m3u8.tmp' for writing
[hls @ 0x13e78c0] Opening 'test3.ts' for writing
[hls @ 0x13e78c0] Opening 'test.m3u8.tmp' for writing
frame= 722 fps=197 q=-1.0 Lsize=N/A time=00:00:30.01 bitrate=N/A speed= 8.2x
video:683kB audio:8kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: unknown
[libx264 @ 0x13f4780] frame I:4 Avg QP: 8.36 size: 3162
[libx264 @ 0x13f4780] frame P:433 Avg QP:16.78 size: 976
[libx264 @ 0x13f4780] frame B:285 Avg QP:17.01 size: 924
[libx264 @ 0x13f4780] consecutive B-frames: 29.4% 53.7% 0.8% 16.1%
[libx264 @ 0x13f4780] mb I I16..4: 85.2% 13.3% 1.5%
[libx264 @ 0x13f4780] mb P I16..4: 3.1% 1.4% 0.2% P16..4: 1.6% 0.2% 0.2% 0.0% 0.0% skip:93.4%
[libx264 @ 0x13f4780] mb B I16..4: 0.4% 0.0% 0.1% B16..8: 5.8% 0.6% 0.1% direct: 0.0% skip:92.9% L0:46.9% L1:52.8% BI: 0.3%
[libx264 @ 0x13f4780] 8x8 transform intra:25.5% inter:12.7%
[libx264 @ 0x13f4780] coded y,uvDC,uvAC intra: 2.1% 0.0% 0.0% inter: 0.1% 0.0% 0.0%
[libx264 @ 0x13f4780] i16 v,h,dc,p: 98% 2% 0% 0%
[libx264 @ 0x13f4780] i8 v,h,dc,ddl,ddr,vr,hd,vl,hu: 7% 5% 88% 0% 0% 0% 0% 0% 0%
[libx264 @ 0x13f4780] i4 v,h,dc,ddl,ddr,vr,hd,vl,hu: 34% 18% 33% 4% 2% 3% 2% 4% 1%
[libx264 @ 0x13f4780] i8c dc,h,v,p: 100% 0% 0% 0%
[libx264 @ 0x13f4780] Weighted P-Frames: Y:0.0% UV:0.0%
[libx264 @ 0x13f4780] ref P L0: 82.0% 1.3% 9.3% 7.3%
[libx264 @ 0x13f4780] ref B L0: 91.4% 6.9% 1.6%
[libx264 @ 0x13f4780] ref B L1: 98.6% 1.4%
[libx264 @ 0x13f4780] kb/s:185.61
[aac @ 0x13d8c40] Qavg: 65536.000
After that I inspect the first chunk and I see that audio is less then 1s long instead of 5s.
ffprobe -show_streams -select_streams a -i test0.ts
ffprobe version 4.3.1 Copyright (c) 2007-2020 the FFmpeg developers
built with gcc 4.9.4 (Ubuntu 4.9.4-2ubuntu1~12.04)
configuration: --prefix=/opt/ffmpeg/4.3.1/build --cc= --cxx= --objcc= --dep-cc= --extra-cflags=' -I/usr/local/cuda-10.1/include' --extra-cxxflags= --extra-ldflags='-Wl,-rpath,/opt/ffmpeg/4.3.1/build/lib -L/opt/ffmpeg/4.3.1/build/lib -Wl,-rpath,/usr/local/cuda-10.1/lib64 -L/usr/local/cuda-10.1/lib64' --bindir=/opt/ffmpeg/4.3.1/build/bin --enable-shared --disable-static --disable-doc --disable-htmlpages --disable-manpages --disable-podpages --disable-txtpages --enable-cuda-nvcc --enable-gpl --enable-libaom --enable-libfdk-aac --enable-libmp3lame --enable-libnpp --enable-libopenjpeg --enable-libopus --enable-librtmp --enable-libtheora --enable-libvorbis --enable-libvpx --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxml2 --enable-nonfree --enable-nvdec --enable-nvenc --enable-openssl --enable-rpath --enable-version3
libavutil 56. 51.100 / 56. 51.100
libavcodec 58. 91.100 / 58. 91.100
libavformat 58. 45.100 / 58. 45.100
libavdevice 58. 10.100 / 58. 10.100
libavfilter 7. 85.100 / 7. 85.100
libswscale 5. 7.100 / 5. 7.100
libswresample 3. 7.100 / 3. 7.100
libpostproc 55. 7.100 / 55. 7.100
Input #0, mpegts, from 'test0.ts':
Duration: 00:00:05.03, start: 1.462089, bitrate: 262 kb/s
Program 1
Metadata:
service_name : Service01
service_provider: FFmpeg
Stream #0:0[0x100]: Video: h264 (High) ([27][0][0][0] / 0x001B), yuv420p(progressive), 1920x1080 [SAR 1:1 DAR 16:9], 23.98 fps, 23.98 tbr, 90k tbn, 47.95 tbc
Stream #0:1[0x101]: Audio: aac (LC) ([15][0][0][0] / 0x000F), 48000 Hz, stereo, fltp, 4 kb/s
[STREAM]
index=1
codec_name=aac
codec_long_name=AAC (Advanced Audio Coding)
profile=LC
codec_type=audio
codec_time_base=1/48000
codec_tag_string=[15][0][0][0]
codec_tag=0x000f
sample_fmt=fltp
sample_rate=48000
channels=2
channel_layout=stereo
bits_per_sample=0
id=0x101
r_frame_rate=0/0
avg_frame_rate=0/0
time_base=1/90000
start_pts=131588
start_time=1.462089
duration_ts=67200
duration=0.746667
bit_rate=4875
max_bit_rate=N/A
bits_per_raw_sample=N/A
nb_frames=N/A
nb_read_frames=N/A
nb_read_packets=N/A
DISPOSITION:default=0
DISPOSITION:dub=0
DISPOSITION:original=0
DISPOSITION:comment=0
DISPOSITION:lyrics=0
DISPOSITION:karaoke=0
DISPOSITION:forced=0
DISPOSITION:hearing_impaired=0
DISPOSITION:visual_impaired=0
DISPOSITION:clean_effects=0
DISPOSITION:attached_pic=0
DISPOSITION:timed_thumbnails=0
[/STREAM]
If I use separate files as an audio/video inputs the audio in the first chunk is closely to 5s.
ffmpeg -i apad_filter_not_working_with_hls_output.mkv -i apad_filter_not_working_with_hls_output.mkv -filter_complex '[0:a]apad=whole_dur=30[audio]' -map '1:v' -map '[audio]' -f hls -hls_time 5 -y test.m3u8
ffprobe -show_streams -select_streams a -i test0.ts ... duration=4.736000 ...
Attachments (1)
Change History (6)
by , 6 years ago
| Attachment: | apad_filter_not_working_with_hls_output.mkv added |
|---|
comment:1 by , 6 years ago
| Cc: | added |
|---|
comment:2 by , 6 years ago
| Resolution: | → needs_more_info |
|---|---|
| Status: | new → closed |
comment:4 by , 6 years ago
Replying to mrskman:
What more info do you need?
Can you double check about the audio pts? there have little audio packet in the first 5 second, so hlsenc only split by video pts which 5 seconds, there only have little audio packet in the first packet, this is not hls problem.



This is not hls problem.
(base) liuqi05:clang liuqi$ ./ffmpeg -i ~/Movies/Test/apad_filter_not_working_with_hls_output.mkv -filter_complex '[0:a]apad=whole_dur=30[audio]' -map '0:v' -map '[audio]' -y test.ts ffmpeg version N-98462-gfa56546a49 Copyright (c) 2000-2020 the FFmpeg developers built with Apple clang version 11.0.3 (clang-1103.0.32.62) configuration: --cc=clang --extra-cflags='-O0 -g3 -fsanitize=address -fno-omit-frame-pointer -Wno-error -I/usr/local/include' --extra-ldflags='-O0 -g3 -fsanitize=address -fno-omit-frame-pointer -Wno-error -L/usr/local/lib' --enable-debug --quiet --enable-htmlpages --enable-libx264 --enable-libxml2 --enable-gpl --enable-libfreetype --enable-fontconfig --enable-libspeex --enable-libopus --enable-libzmq --enable-libx265 --enable-libass --enable-videotoolbox --disable-optimizations --disable-stripping --enable-libmp3lame --samples=fate-suite/ libavutil 56. 55.100 / 56. 55.100 libavcodec 58. 95.100 / 58. 95.100 libavformat 58. 48.100 / 58. 48.100 libavdevice 58. 11.101 / 58. 11.101 libavfilter 7. 87.100 / 7. 87.100 libswscale 5. 8.100 / 5. 8.100 libswresample 3. 8.100 / 3. 8.100 libpostproc 55. 8.100 / 55. 8.100 Input #0, matroska,webm, from '/Users/liuqi/Movies/Test/apad_filter_not_working_with_hls_output.mkv': Metadata: ENCODER : Lavf58.45.100 Duration: 00:00:30.11, start: 0.000000, bitrate: 227 kb/s Stream #0:0(eng): Video: h264 (High), yuv420p(tv, bt709, progressive), 1920x1080 [SAR 1:1 DAR 16:9], 23.98 fps, 23.98 tbr, 1k tbn, 47.95 tbc (default) Metadata: BPS : 212945 BPS-eng : 212945 DURATION-eng : 00:10:05.063000000 NUMBER_OF_FRAMES: 14507 NUMBER_OF_FRAMES-eng: 14507 NUMBER_OF_BYTES : 16105645 NUMBER_OF_BYTES-eng: 16105645 _STATISTICS_WRITING_APP: mkvmerge v7.2.0 ('On Every Street') 32bit built on Sep 13 2014 15:42:11 _STATISTICS_WRITING_APP-eng: mkvmerge v7.2.0 ('On Every Street') 32bit built on Sep 13 2014 15:42:11 _STATISTICS_WRITING_DATE_UTC: 2014-09-19 01:06:47 _STATISTICS_WRITING_DATE_UTC-eng: 2014-09-19 01:06:47 _STATISTICS_TAGS: BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES _STATISTICS_TAGS-eng: BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES DURATION : 00:00:30.113000000 Stream #0:1(eng): Audio: mp3, 48000 Hz, stereo, fltp, 80 kb/s (default) Metadata: BPS : 34181 BPS-eng : 34181 DURATION-eng : 00:00:01.056000000 NUMBER_OF_FRAMES: 44 NUMBER_OF_FRAMES-eng: 44 NUMBER_OF_BYTES : 4512 NUMBER_OF_BYTES-eng: 4512 _STATISTICS_WRITING_APP: mkvmerge v7.2.0 ('On Every Street') 32bit built on Sep 13 2014 15:42:11 _STATISTICS_WRITING_APP-eng: mkvmerge v7.2.0 ('On Every Street') 32bit built on Sep 13 2014 15:42:11 _STATISTICS_WRITING_DATE_UTC: 2014-09-19 01:06:47 _STATISTICS_WRITING_DATE_UTC-eng: 2014-09-19 01:06:47 _STATISTICS_TAGS: BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES _STATISTICS_TAGS-eng: BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES DURATION : 00:00:01.056000000 Stream mapping: Stream #0:1 (mp3float) -> apad (graph 0) Stream #0:0 -> #0:0 (h264 (native) -> mpeg2video (native)) apad (graph 0) -> Stream #0:1 (mp2) Press [q] to stop, [?] for help Output #0, mpegts, to 'test.ts': Metadata: encoder : Lavf58.48.100 Stream #0:0(eng): Video: mpeg2video (Main), yuv420p, 1920x1080 [SAR 1:1 DAR 16:9], q=2-31, 200 kb/s, 23.98 fps, 90k tbn, 23.98 tbc (default) Metadata: BPS : 212945 BPS-eng : 212945 DURATION-eng : 00:10:05.063000000 NUMBER_OF_FRAMES: 14507 NUMBER_OF_FRAMES-eng: 14507 NUMBER_OF_BYTES : 16105645 NUMBER_OF_BYTES-eng: 16105645 _STATISTICS_WRITING_APP: mkvmerge v7.2.0 ('On Every Street') 32bit built on Sep 13 2014 15:42:11 _STATISTICS_WRITING_APP-eng: mkvmerge v7.2.0 ('On Every Street') 32bit built on Sep 13 2014 15:42:11 _STATISTICS_WRITING_DATE_UTC: 2014-09-19 01:06:47 _STATISTICS_WRITING_DATE_UTC-eng: 2014-09-19 01:06:47 _STATISTICS_TAGS: BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES _STATISTICS_TAGS-eng: BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES DURATION : 00:00:30.113000000 encoder : Lavc58.95.100 mpeg2video Side data: cpb: bitrate max/min/avg: 0/0/200000 buffer size: 0 vbv_delay: N/A Stream #0:1: Audio: mp2, 48000 Hz, stereo, s16, 384 kb/s (default) Metadata: encoder : Lavc58.95.100 mp2 frame= 722 fps=163 q=31.0 Lsize= 5538kB time=00:00:30.03 bitrate=1510.7kbits/s speed=6.79x video:3783kB audio:1406kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 6.725081% (base) liuqi05:clang liuqi$analyze the test.ts file first 5 seconds packets. there only have less than 1 second audio packets.
(base) liuqi05:clang liuqi$ ffprobe -of xml -show_entries packet=codec_type,pts_time test.ts|grep "packet codec_type" |head -n 150 ffprobe version 4.2 Copyright (c) 2007-2019 the FFmpeg developers built with clang version 4.0.1 (tags/RELEASE_401/final) configuration: --prefix=/Users/liuqi/miniconda3 --cc=x86_64-apple-darwin13.4.0-clang --disable-doc --disable-openssl --enable-avresample --enable-gnutls --enable-gpl --enable-hardcoded-tables --enable-libfreetype --enable-libopenh264 --enable-libx264 --enable-pic --enable-pthreads --enable-shared --enable-static --enable-version3 --enable-zlib --enable-libmp3lame libavutil 56. 31.100 / 56. 31.100 libavcodec 58. 54.100 / 58. 54.100 libavformat 58. 29.100 / 58. 29.100 libavdevice 58. 8.100 / 58. 8.100 libavfilter 7. 57.100 / 7. 57.100 libavresample 4. 0. 0 / 4. 0. 0 libswscale 5. 5.100 / 5. 5.100 libswresample 3. 5.100 / 3. 5.100 libpostproc 55. 5.100 / 55. 5.100 Input #0, mpegts, from 'test.ts': Duration: 00:00:30.12, start: 1.431689, bitrate: 1505 kb/s Program 1 Metadata: service_name : Service01 service_provider: FFmpeg Stream #0:0[0x100]: Video: mpeg2video (Main) ([2][0][0][0] / 0x0002), yuv420p(tv, progressive), 1920x1080 [SAR 1:1 DAR 16:9], 23.98 fps, 23.98 tbr, 90k tbn, 47.95 tbc Stream #0:1[0x101]: Audio: mp2 ([3][0][0][0] / 0x0003), 48000 Hz, stereo, fltp, 384 kb/s <packet codec_type="audio" pts_time="1.431689"> <packet codec_type="audio" pts_time="1.455689"/> <packet codec_type="video" pts_time="1.441711"> <packet codec_type="video" pts_time="1.483422"> <packet codec_type="audio" pts_time="1.479689"> <packet codec_type="audio" pts_time="1.503689"/> <packet codec_type="video" pts_time="1.525133"> <packet codec_type="audio" pts_time="1.527689"> <packet codec_type="audio" pts_time="1.551689"/> <packet codec_type="video" pts_time="1.566833"> <packet codec_type="audio" pts_time="1.575689"> <packet codec_type="audio" pts_time="1.599689"/> <packet codec_type="video" pts_time="1.608544"> <packet codec_type="audio" pts_time="1.623689"> <packet codec_type="audio" pts_time="1.647689"/> <packet codec_type="video" pts_time="1.650256"> <packet codec_type="audio" pts_time="1.671689"> <packet codec_type="audio" pts_time="1.695689"/> <packet codec_type="video" pts_time="1.691967"> <packet codec_type="audio" pts_time="1.719689"> <packet codec_type="audio" pts_time="1.743689"/> <packet codec_type="video" pts_time="1.733667"> <packet codec_type="audio" pts_time="1.767689"> <packet codec_type="audio" pts_time="1.791689"/> <packet codec_type="video" pts_time="1.775378"> <packet codec_type="video" pts_time="1.817089"> <packet codec_type="audio" pts_time="1.815689"> <packet codec_type="audio" pts_time="1.839689"/> <packet codec_type="video" pts_time="1.858800"> <packet codec_type="audio" pts_time="1.863689"> <packet codec_type="audio" pts_time="1.887689"/> <packet codec_type="video" pts_time="1.900500"> <packet codec_type="audio" pts_time="1.911689"> <packet codec_type="audio" pts_time="1.935689"/> <packet codec_type="video" pts_time="1.942211"> <packet codec_type="audio" pts_time="1.959689"> <packet codec_type="audio" pts_time="1.983689"/> <packet codec_type="video" pts_time="1.983922"> <packet codec_type="audio" pts_time="2.007689"> <packet codec_type="audio" pts_time="2.031689"/> <packet codec_type="video" pts_time="2.025633"> <packet codec_type="audio" pts_time="2.055689"> <packet codec_type="audio" pts_time="2.079689"/> <packet codec_type="video" pts_time="2.067333"> <packet codec_type="video" pts_time="2.109044"> <packet codec_type="audio" pts_time="2.103689"> <packet codec_type="audio" pts_time="2.127689"/> <packet codec_type="video" pts_time="2.150756"> <packet codec_type="audio" pts_time="2.151689"> <packet codec_type="audio" pts_time="2.175689"/> <packet codec_type="video" pts_time="2.192467"> <packet codec_type="audio" pts_time="2.199689"> <packet codec_type="audio" pts_time="2.223689"/> <packet codec_type="video" pts_time="2.234167"> <packet codec_type="audio" pts_time="2.247689"> <packet codec_type="audio" pts_time="2.271689"/> <packet codec_type="video" pts_time="2.275878"> <packet codec_type="audio" pts_time="2.295689"> <packet codec_type="audio" pts_time="2.319689"/> <packet codec_type="video" pts_time="2.317589"> <packet codec_type="audio" pts_time="2.343689"> <packet codec_type="audio" pts_time="2.367689"/> <packet codec_type="video" pts_time="2.359300"> <packet codec_type="audio" pts_time="2.391689"> <packet codec_type="audio" pts_time="2.415689"/> <packet codec_type="video" pts_time="2.401000"> <packet codec_type="video" pts_time="2.442711"> <packet codec_type="video" pts_time="2.484422"> <packet codec_type="video" pts_time="2.526133"> <packet codec_type="video" pts_time="2.567833"> <packet codec_type="video" pts_time="2.609544"> <packet codec_type="video" pts_time="2.651256"> <packet codec_type="video" pts_time="2.692967"> <packet codec_type="video" pts_time="2.734667"> <packet codec_type="video" pts_time="2.776378"> <packet codec_type="video" pts_time="2.818089"> <packet codec_type="video" pts_time="2.859800"> <packet codec_type="video" pts_time="2.901500"> <packet codec_type="video" pts_time="2.943211"> <packet codec_type="video" pts_time="2.984922"> <packet codec_type="video" pts_time="3.026633"> <packet codec_type="video" pts_time="3.068333"> <packet codec_type="video" pts_time="3.110044"> <packet codec_type="video" pts_time="3.151756"> <packet codec_type="video" pts_time="3.193467"> <packet codec_type="video" pts_time="3.235167"> <packet codec_type="video" pts_time="3.276878"> <packet codec_type="video" pts_time="3.318589"> <packet codec_type="video" pts_time="3.360300"> <packet codec_type="video" pts_time="3.402000"> <packet codec_type="video" pts_time="3.443711"> <packet codec_type="video" pts_time="3.485422"> <packet codec_type="video" pts_time="3.527133"> <packet codec_type="video" pts_time="3.568833"> <packet codec_type="video" pts_time="3.610544"> <packet codec_type="video" pts_time="3.652256"> <packet codec_type="video" pts_time="3.693967"> <packet codec_type="video" pts_time="3.735667"> <packet codec_type="video" pts_time="3.777378"> <packet codec_type="video" pts_time="3.819089"> <packet codec_type="video" pts_time="3.860800"> <packet codec_type="video" pts_time="3.902500"> <packet codec_type="video" pts_time="3.944211"> <packet codec_type="video" pts_time="3.985922"> <packet codec_type="video" pts_time="4.027633"> <packet codec_type="video" pts_time="4.069333"> <packet codec_type="video" pts_time="4.111044"> <packet codec_type="video" pts_time="4.152756"> <packet codec_type="video" pts_time="4.194467"> <packet codec_type="video" pts_time="4.236167"> <packet codec_type="video" pts_time="4.277878"> <packet codec_type="video" pts_time="4.319589"> <packet codec_type="video" pts_time="4.361300"> <packet codec_type="video" pts_time="4.403000"> <packet codec_type="video" pts_time="4.444711"> <packet codec_type="video" pts_time="4.486422"> <packet codec_type="video" pts_time="4.528133"> <packet codec_type="video" pts_time="4.569833"> <packet codec_type="video" pts_time="4.611544"> <packet codec_type="video" pts_time="4.653256"> <packet codec_type="video" pts_time="4.694967"> <packet codec_type="video" pts_time="4.736667"> <packet codec_type="video" pts_time="4.778378"> <packet codec_type="video" pts_time="4.820089"> <packet codec_type="video" pts_time="4.861800"> <packet codec_type="video" pts_time="4.903500"> <packet codec_type="video" pts_time="4.945211"> <packet codec_type="video" pts_time="4.986922"> <packet codec_type="video" pts_time="5.028633"> <packet codec_type="video" pts_time="5.070333"> <packet codec_type="video" pts_time="5.112044"> <packet codec_type="video" pts_time="5.153756"> <packet codec_type="video" pts_time="5.195467"> <packet codec_type="video" pts_time="5.237167"> <packet codec_type="video" pts_time="5.278878"> <packet codec_type="video" pts_time="5.320589"> <packet codec_type="video" pts_time="5.362300"> <packet codec_type="video" pts_time="5.404000"> <packet codec_type="video" pts_time="5.445711"> <packet codec_type="video" pts_time="5.487422"> <packet codec_type="video" pts_time="5.529133"> <packet codec_type="video" pts_time="5.570833"> <packet codec_type="video" pts_time="5.612544"> <packet codec_type="video" pts_time="5.654256"> <packet codec_type="video" pts_time="5.695967"> <packet codec_type="video" pts_time="5.737667"> <packet codec_type="video" pts_time="5.779378"> <packet codec_type="video" pts_time="5.821089"> <packet codec_type="video" pts_time="5.862800"> <packet codec_type="video" pts_time="5.904500"> (base) liuqi05:clang liuqi$