Opened 7 years ago

Closed 7 years ago

Last modified 5 years ago

#6541 closed defect (fixed)

HLS fMP4 Bug

Reported by: JohnPi Owned by: Steven Liu
Priority: normal Component: avformat
Version: git-master Keywords: HLS
Cc: Blocked By:
Blocking: Reproduced by developer: no
Analyzed by developer: no

Description

Hi,

When i try to use "-hls_segment_type fmp4" , ffmpeg detect the option but continue to encode in .ts file,the headers are good but the segments aren't in .m4s.
Did i did something wrong ?
Thank you by advance :)

There is the command :

" ./ffmpeg -y  -loglevel debug  -re  -i  "udp://239.192.0.1:1234?fifo_size=5000000&overrun_nonfatal=1" -c:v mpeg4 -hls_segment_type fmp4 -hls_fmp4_init_filename test.mp4 /var/www/HLS/A.m3u8 "

and there is the m3u8 playlist :

"#EXTM3U
#EXT-X-VERSION:7
#EXT-X-TARGETDURATION:3
#EXT-X-MEDIA-SEQUENCE:12
#EXT-X-MAP:URI="test.mp4"
#EXTINF:1.920000,
A12.ts
#EXTINF:1.920000,
A13.ts
#EXTINF:2.240000,
A14.ts
#EXTINF:1.920000,
A15.ts
#EXTINF:1.920000,
A16.ts "

and there is the ffmpeg -version :

ffmpeg version N-86789-g4c1aac8 Copyright (c) 2000-2017 the FFmpeg developers
built with gcc 6.4.0 (Debian 6.4.0-1) 20170704
configuration: --prefix=/root/ffmpeg_build --pkg-config-flags=--static --extra-cflags=-I/root/ffmpeg_build/include --extra-ldflags=-L/root/ffmpeg_build/lib --bindir=/root/bin --enable-gpl --enable-libass --enable-libfdk-aac --enable-libfreetype --enable-vaapi --enable-vdpau --enable-libx264 --enable-nvenc --enable-cuvid --enable-nonfree
libavutil      55. 67.100 / 55. 67.100
libavcodec     57.100.104 / 57.100.104
libavformat    57. 75.100 / 57. 75.100
libavdevice    57.  7.100 / 57.  7.100
libavfilter     6. 95.100 /  6. 95.100
libswscale      4.  7.101 /  4.  7.101
libswresample   2.  8.100 /  2.  8.100
libpostproc    54.  6.100 / 54.  6.100

Change History (16)

comment:1 by Steven Liu, 7 years ago

Owner: set to Steven Liu
Status: newopen

comment:2 by Steven Liu, 7 years ago

https://patchwork.ffmpeg.org/patch/4377/

what about the result after you applied this patch?

comment:3 by JohnPi, 7 years ago

It's now making the ".m4s" segments but the "init.mp4" initial segment is missing.

in reply to:  3 comment:4 by Steven Liu, 7 years ago

Replying to JohnPi:

It's now making the ".m4s" segments but the "init.mp4" initial segment is missing.

I have update the newest version patch at ​https://patchwork.ffmpeg.org/patch/4377/

liuqideMBP:hlsfmp4 liuqi$ ./ffmpeg -i ~/Movies/objectC/facebook.mp4 -c copy -f hls -hls_segment_type fmp4 -hls_fmp4_init_filename test.mp4 -t 20  output_test.m3u8
ffmpeg version N-86820-g3cd616a0c9 Copyright (c) 2000-2017 the FFmpeg developers
  built with Apple LLVM version 8.1.0 (clang-802.0.42)
  configuration: --enable-fontconfig --enable-gpl --enable-libass --enable-libbluray --enable-libfreetype --enable-libmp3lame --enable-libspeex --enable-libx264 --enable-libx265 --enable-libfdk-aac --enable-version3 --cc='ccache gcc' --enable-nonfree --enable-videotoolbox
  libavutil      55. 68.100 / 55. 68.100
  libavcodec     57.102.100 / 57.102.100
  libavformat    57. 76.100 / 57. 76.100
  libavdevice    57.  7.100 / 57.  7.100
  libavfilter     6. 95.100 /  6. 95.100
  libswscale      4.  7.101 /  4.  7.101
  libswresample   2.  8.100 /  2.  8.100
  libpostproc    54.  6.100 / 54.  6.100
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from '/Users/liuqi/Movies/objectC/facebook.mp4':
  Metadata:
    major_brand     : isom
    minor_version   : 1
    compatible_brands: isomavc1
    creation_time   : 2015-02-02T18:19:19.000000Z
  Duration: 00:45:02.06, start: 0.000000, bitrate: 2708 kb/s
    Stream #0:0(und): Video: h264 (High) (avc1 / 0x31637661), yuv420p, 1280x714 [SAR 1:1 DAR 640:357], 2576 kb/s, 25 fps, 25 tbr, 25k tbn, 50 tbc (default)
    Metadata:
      creation_time   : 2015-02-02T18:19:19.000000Z
      handler_name    : GPAC ISO Video Handler
    Stream #0:1(und): Audio: aac (LC) (mp4a / 0x6134706D), 48000 Hz, stereo, fltp, 127 kb/s (default)
    Metadata:
      creation_time   : 2015-02-02T18:19:23.000000Z
      handler_name    : GPAC ISO Audio Handler
[hls @ 0x7fbfbc826c00] Opening 'test.mp4' for writing
Output #0, hls, to 'output_test.m3u8':
  Metadata:
    major_brand     : isom
    minor_version   : 1
    compatible_brands: isomavc1
    encoder         : Lavf57.76.100
    Stream #0:0(und): Video: h264 (High) (avc1 / 0x31637661), yuv420p, 1280x714 [SAR 1:1 DAR 640:357], q=2-31, 2576 kb/s, 25 fps, 25 tbr, 12800 tbn, 25 tbc (default)
    Metadata:
      creation_time   : 2015-02-02T18:19:19.000000Z
      handler_name    : GPAC ISO Video Handler
    Stream #0:1(und): Audio: aac (LC) (mp4a / 0x6134706D), 48000 Hz, stereo, fltp, 127 kb/s (default)
    Metadata:
      creation_time   : 2015-02-02T18:19:23.000000Z
      handler_name    : GPAC ISO Audio Handler
Stream mapping:
  Stream #0:0 -> #0:0 (copy)
  Stream #0:1 -> #0:1 (copy)
Press [q] to stop, [?] for help
[hls @ 0x7fbfbc826c00] Opening 'output_test0.m4s' for writing
[hls @ 0x7fbfbc826c00] Opening 'output_test.m3u8.tmp' for writing
[hls @ 0x7fbfbc826c00] Opening 'output_test1.m4s' for writing
[hls @ 0x7fbfbc826c00] Opening 'output_test.m3u8.tmp' for writing
[hls @ 0x7fbfbc826c00] Opening 'output_test2.m4s' for writing
[hls @ 0x7fbfbc826c00] Opening 'output_test.m3u8.tmp' for writing
[hls @ 0x7fbfbc826c00] Opening 'output_test3.m4s' for writing
[hls @ 0x7fbfbc826c00] Opening 'output_test.m3u8.tmp' for writing
[hls @ 0x7fbfbc826c00] Opening 'output_test4.m4s' for writing
[hls @ 0x7fbfbc826c00] Opening 'output_test.m3u8.tmp' for writing
[hls @ 0x7fbfbc826c00] Opening 'output_test5.m4s' for writing
[hls @ 0x7fbfbc826c00] Opening 'output_test.m3u8.tmp' for writing
[hls @ 0x7fbfbc826c00] Opening 'output_test6.m4s' for writing
[hls @ 0x7fbfbc826c00] Opening 'output_test.m3u8.tmp' for writing
[hls @ 0x7fbfbc826c00] Opening 'output_test7.m4s' for writing
[hls @ 0x7fbfbc826c00] Opening 'output_test.m3u8.tmp' for writing
[hls @ 0x7fbfbc826c00] Opening 'output_test8.m4s' for writing
[hls @ 0x7fbfbc826c00] Opening 'output_test.m3u8.tmp' for writing
[hls @ 0x7fbfbc826c00] Opening 'output_test.m3u8.tmp' for writing
frame=  500 fps=0.0 q=-1.0 Lsize=N/A time=00:00:19.98 bitrate=N/A speed= 203x
video:6246kB audio:303kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: unknown
liuqideMBP:hlsfmp4 liuqi$ cat output_test.m3u8
#EXTM3U
#EXT-X-VERSION:7
#EXT-X-TARGETDURATION:6
#EXT-X-MEDIA-SEQUENCE:4
#EXT-X-MAP:URI="test.mp4"
#EXTINF:1.040000,
output_test4.m4s
#EXTINF:2.920000,
output_test5.m4s
#EXTINF:1.720000,
output_test6.m4s
#EXTINF:0.960000,
output_test7.m4s
#EXTINF:5.960000,
output_test8.m4s
#EXT-X-ENDLIST
liuqideMBP:hlsfmp4 liuqi$ ./ffmpeg -i ~/Movies/objectC/facebook.mp4 -c copy -f hls -hls_segment_type fmp4  -t 20  output_test.m3u8
ffmpeg version N-86820-g3cd616a0c9 Copyright (c) 2000-2017 the FFmpeg developers
  built with Apple LLVM version 8.1.0 (clang-802.0.42)
  configuration: --enable-fontconfig --enable-gpl --enable-libass --enable-libbluray --enable-libfreetype --enable-libmp3lame --enable-libspeex --enable-libx264 --enable-libx265 --enable-libfdk-aac --enable-version3 --cc='ccache gcc' --enable-nonfree --enable-videotoolbox
  libavutil      55. 68.100 / 55. 68.100
  libavcodec     57.102.100 / 57.102.100
  libavformat    57. 76.100 / 57. 76.100
  libavdevice    57.  7.100 / 57.  7.100
  libavfilter     6. 95.100 /  6. 95.100
  libswscale      4.  7.101 /  4.  7.101
  libswresample   2.  8.100 /  2.  8.100
  libpostproc    54.  6.100 / 54.  6.100
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from '/Users/liuqi/Movies/objectC/facebook.mp4':
  Metadata:
    major_brand     : isom
    minor_version   : 1
    compatible_brands: isomavc1
    creation_time   : 2015-02-02T18:19:19.000000Z
  Duration: 00:45:02.06, start: 0.000000, bitrate: 2708 kb/s
    Stream #0:0(und): Video: h264 (High) (avc1 / 0x31637661), yuv420p, 1280x714 [SAR 1:1 DAR 640:357], 2576 kb/s, 25 fps, 25 tbr, 25k tbn, 50 tbc (default)
    Metadata:
      creation_time   : 2015-02-02T18:19:19.000000Z
      handler_name    : GPAC ISO Video Handler
    Stream #0:1(und): Audio: aac (LC) (mp4a / 0x6134706D), 48000 Hz, stereo, fltp, 127 kb/s (default)
    Metadata:
      creation_time   : 2015-02-02T18:19:23.000000Z
      handler_name    : GPAC ISO Audio Handler
[hls @ 0x7f94a2831600] Opening 'init.mp4' for writing
Output #0, hls, to 'output_test.m3u8':
  Metadata:
    major_brand     : isom
    minor_version   : 1
    compatible_brands: isomavc1
    encoder         : Lavf57.76.100
    Stream #0:0(und): Video: h264 (High) (avc1 / 0x31637661), yuv420p, 1280x714 [SAR 1:1 DAR 640:357], q=2-31, 2576 kb/s, 25 fps, 25 tbr, 12800 tbn, 25 tbc (default)
    Metadata:
      creation_time   : 2015-02-02T18:19:19.000000Z
      handler_name    : GPAC ISO Video Handler
    Stream #0:1(und): Audio: aac (LC) (mp4a / 0x6134706D), 48000 Hz, stereo, fltp, 127 kb/s (default)
    Metadata:
      creation_time   : 2015-02-02T18:19:23.000000Z
      handler_name    : GPAC ISO Audio Handler
Stream mapping:
  Stream #0:0 -> #0:0 (copy)
  Stream #0:1 -> #0:1 (copy)
Press [q] to stop, [?] for help
[hls @ 0x7f94a2831600] Opening 'output_test0.m4s' for writing
[hls @ 0x7f94a2831600] Opening 'output_test.m3u8.tmp' for writing
[hls @ 0x7f94a2831600] Opening 'output_test1.m4s' for writing
[hls @ 0x7f94a2831600] Opening 'output_test.m3u8.tmp' for writing
[hls @ 0x7f94a2831600] Opening 'output_test2.m4s' for writing
[hls @ 0x7f94a2831600] Opening 'output_test.m3u8.tmp' for writing
[hls @ 0x7f94a2831600] Opening 'output_test3.m4s' for writing
[hls @ 0x7f94a2831600] Opening 'output_test.m3u8.tmp' for writing
[hls @ 0x7f94a2831600] Opening 'output_test4.m4s' for writing
[hls @ 0x7f94a2831600] Opening 'output_test.m3u8.tmp' for writing
[hls @ 0x7f94a2831600] Opening 'output_test5.m4s' for writing
[hls @ 0x7f94a2831600] Opening 'output_test.m3u8.tmp' for writing
[hls @ 0x7f94a2831600] Opening 'output_test6.m4s' for writing
[hls @ 0x7f94a2831600] Opening 'output_test.m3u8.tmp' for writing
[hls @ 0x7f94a2831600] Opening 'output_test7.m4s' for writing
[hls @ 0x7f94a2831600] Opening 'output_test.m3u8.tmp' for writing
[hls @ 0x7f94a2831600] Opening 'output_test8.m4s' for writing
[hls @ 0x7f94a2831600] Opening 'output_test.m3u8.tmp' for writing
[hls @ 0x7f94a2831600] Opening 'output_test.m3u8.tmp' for writing
frame=  500 fps=0.0 q=-1.0 Lsize=N/A time=00:00:19.98 bitrate=N/A speed= 231x
video:6246kB audio:303kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: unknown
liuqideMBP:hlsfmp4 liuqi$ cat output_test.m3u8
#EXTM3U
#EXT-X-VERSION:7
#EXT-X-TARGETDURATION:6
#EXT-X-MEDIA-SEQUENCE:4
#EXT-X-MAP:URI="init.mp4"
#EXTINF:1.040000,
output_test4.m4s
#EXTINF:2.920000,
output_test5.m4s
#EXTINF:1.720000,
output_test6.m4s
#EXTINF:0.960000,
output_test7.m4s
#EXTINF:5.960000,
output_test8.m4s
#EXT-X-ENDLIST
liuqideMBP:hlsfmp4 liuqi$

in reply to:  3 comment:5 by Steven Liu, 7 years ago

Replying to JohnPi:

It's now making the ".m4s" segments but the "init.mp4" initial segment is missing.

I have update the newest version patch at ​https://patchwork.ffmpeg.org/patch/4377/

liuqideMBP:hlsfmp4 liuqi$ ./ffmpeg -i ~/Movies/objectC/facebook.mp4 -c copy -f hls -hls_segment_type fmp4 -hls_fmp4_init_filename test.mp4 -t 20  output_test.m3u8
ffmpeg version N-86820-g3cd616a0c9 Copyright (c) 2000-2017 the FFmpeg developers
  built with Apple LLVM version 8.1.0 (clang-802.0.42)
  configuration: --enable-fontconfig --enable-gpl --enable-libass --enable-libbluray --enable-libfreetype --enable-libmp3lame --enable-libspeex --enable-libx264 --enable-libx265 --enable-libfdk-aac --enable-version3 --cc='ccache gcc' --enable-nonfree --enable-videotoolbox
  libavutil      55. 68.100 / 55. 68.100
  libavcodec     57.102.100 / 57.102.100
  libavformat    57. 76.100 / 57. 76.100
  libavdevice    57.  7.100 / 57.  7.100
  libavfilter     6. 95.100 /  6. 95.100
  libswscale      4.  7.101 /  4.  7.101
  libswresample   2.  8.100 /  2.  8.100
  libpostproc    54.  6.100 / 54.  6.100
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from '/Users/liuqi/Movies/objectC/facebook.mp4':
  Metadata:
    major_brand     : isom
    minor_version   : 1
    compatible_brands: isomavc1
    creation_time   : 2015-02-02T18:19:19.000000Z
  Duration: 00:45:02.06, start: 0.000000, bitrate: 2708 kb/s
    Stream #0:0(und): Video: h264 (High) (avc1 / 0x31637661), yuv420p, 1280x714 [SAR 1:1 DAR 640:357], 2576 kb/s, 25 fps, 25 tbr, 25k tbn, 50 tbc (default)
    Metadata:
      creation_time   : 2015-02-02T18:19:19.000000Z
      handler_name    : GPAC ISO Video Handler
    Stream #0:1(und): Audio: aac (LC) (mp4a / 0x6134706D), 48000 Hz, stereo, fltp, 127 kb/s (default)
    Metadata:
      creation_time   : 2015-02-02T18:19:23.000000Z
      handler_name    : GPAC ISO Audio Handler
[hls @ 0x7fbfbc826c00] Opening 'test.mp4' for writing
Output #0, hls, to 'output_test.m3u8':
  Metadata:
    major_brand     : isom
    minor_version   : 1
    compatible_brands: isomavc1
    encoder         : Lavf57.76.100
    Stream #0:0(und): Video: h264 (High) (avc1 / 0x31637661), yuv420p, 1280x714 [SAR 1:1 DAR 640:357], q=2-31, 2576 kb/s, 25 fps, 25 tbr, 12800 tbn, 25 tbc (default)
    Metadata:
      creation_time   : 2015-02-02T18:19:19.000000Z
      handler_name    : GPAC ISO Video Handler
    Stream #0:1(und): Audio: aac (LC) (mp4a / 0x6134706D), 48000 Hz, stereo, fltp, 127 kb/s (default)
    Metadata:
      creation_time   : 2015-02-02T18:19:23.000000Z
      handler_name    : GPAC ISO Audio Handler
Stream mapping:
  Stream #0:0 -> #0:0 (copy)
  Stream #0:1 -> #0:1 (copy)
Press [q] to stop, [?] for help
[hls @ 0x7fbfbc826c00] Opening 'output_test0.m4s' for writing
[hls @ 0x7fbfbc826c00] Opening 'output_test.m3u8.tmp' for writing
[hls @ 0x7fbfbc826c00] Opening 'output_test1.m4s' for writing
[hls @ 0x7fbfbc826c00] Opening 'output_test.m3u8.tmp' for writing
[hls @ 0x7fbfbc826c00] Opening 'output_test2.m4s' for writing
[hls @ 0x7fbfbc826c00] Opening 'output_test.m3u8.tmp' for writing
[hls @ 0x7fbfbc826c00] Opening 'output_test3.m4s' for writing
[hls @ 0x7fbfbc826c00] Opening 'output_test.m3u8.tmp' for writing
[hls @ 0x7fbfbc826c00] Opening 'output_test4.m4s' for writing
[hls @ 0x7fbfbc826c00] Opening 'output_test.m3u8.tmp' for writing
[hls @ 0x7fbfbc826c00] Opening 'output_test5.m4s' for writing
[hls @ 0x7fbfbc826c00] Opening 'output_test.m3u8.tmp' for writing
[hls @ 0x7fbfbc826c00] Opening 'output_test6.m4s' for writing
[hls @ 0x7fbfbc826c00] Opening 'output_test.m3u8.tmp' for writing
[hls @ 0x7fbfbc826c00] Opening 'output_test7.m4s' for writing
[hls @ 0x7fbfbc826c00] Opening 'output_test.m3u8.tmp' for writing
[hls @ 0x7fbfbc826c00] Opening 'output_test8.m4s' for writing
[hls @ 0x7fbfbc826c00] Opening 'output_test.m3u8.tmp' for writing
[hls @ 0x7fbfbc826c00] Opening 'output_test.m3u8.tmp' for writing
frame=  500 fps=0.0 q=-1.0 Lsize=N/A time=00:00:19.98 bitrate=N/A speed= 203x
video:6246kB audio:303kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: unknown
liuqideMBP:hlsfmp4 liuqi$ cat output_test.m3u8
#EXTM3U
#EXT-X-VERSION:7
#EXT-X-TARGETDURATION:6
#EXT-X-MEDIA-SEQUENCE:4
#EXT-X-MAP:URI="test.mp4"
#EXTINF:1.040000,
output_test4.m4s
#EXTINF:2.920000,
output_test5.m4s
#EXTINF:1.720000,
output_test6.m4s
#EXTINF:0.960000,
output_test7.m4s
#EXTINF:5.960000,
output_test8.m4s
#EXT-X-ENDLIST
liuqideMBP:hlsfmp4 liuqi$ ./ffmpeg -i ~/Movies/objectC/facebook.mp4 -c copy -f hls -hls_segment_type fmp4  -t 20  output_test.m3u8
ffmpeg version N-86820-g3cd616a0c9 Copyright (c) 2000-2017 the FFmpeg developers
  built with Apple LLVM version 8.1.0 (clang-802.0.42)
  configuration: --enable-fontconfig --enable-gpl --enable-libass --enable-libbluray --enable-libfreetype --enable-libmp3lame --enable-libspeex --enable-libx264 --enable-libx265 --enable-libfdk-aac --enable-version3 --cc='ccache gcc' --enable-nonfree --enable-videotoolbox
  libavutil      55. 68.100 / 55. 68.100
  libavcodec     57.102.100 / 57.102.100
  libavformat    57. 76.100 / 57. 76.100
  libavdevice    57.  7.100 / 57.  7.100
  libavfilter     6. 95.100 /  6. 95.100
  libswscale      4.  7.101 /  4.  7.101
  libswresample   2.  8.100 /  2.  8.100
  libpostproc    54.  6.100 / 54.  6.100
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from '/Users/liuqi/Movies/objectC/facebook.mp4':
  Metadata:
    major_brand     : isom
    minor_version   : 1
    compatible_brands: isomavc1
    creation_time   : 2015-02-02T18:19:19.000000Z
  Duration: 00:45:02.06, start: 0.000000, bitrate: 2708 kb/s
    Stream #0:0(und): Video: h264 (High) (avc1 / 0x31637661), yuv420p, 1280x714 [SAR 1:1 DAR 640:357], 2576 kb/s, 25 fps, 25 tbr, 25k tbn, 50 tbc (default)
    Metadata:
      creation_time   : 2015-02-02T18:19:19.000000Z
      handler_name    : GPAC ISO Video Handler
    Stream #0:1(und): Audio: aac (LC) (mp4a / 0x6134706D), 48000 Hz, stereo, fltp, 127 kb/s (default)
    Metadata:
      creation_time   : 2015-02-02T18:19:23.000000Z
      handler_name    : GPAC ISO Audio Handler
[hls @ 0x7f94a2831600] Opening 'init.mp4' for writing
Output #0, hls, to 'output_test.m3u8':
  Metadata:
    major_brand     : isom
    minor_version   : 1
    compatible_brands: isomavc1
    encoder         : Lavf57.76.100
    Stream #0:0(und): Video: h264 (High) (avc1 / 0x31637661), yuv420p, 1280x714 [SAR 1:1 DAR 640:357], q=2-31, 2576 kb/s, 25 fps, 25 tbr, 12800 tbn, 25 tbc (default)
    Metadata:
      creation_time   : 2015-02-02T18:19:19.000000Z
      handler_name    : GPAC ISO Video Handler
    Stream #0:1(und): Audio: aac (LC) (mp4a / 0x6134706D), 48000 Hz, stereo, fltp, 127 kb/s (default)
    Metadata:
      creation_time   : 2015-02-02T18:19:23.000000Z
      handler_name    : GPAC ISO Audio Handler
Stream mapping:
  Stream #0:0 -> #0:0 (copy)
  Stream #0:1 -> #0:1 (copy)
Press [q] to stop, [?] for help
[hls @ 0x7f94a2831600] Opening 'output_test0.m4s' for writing
[hls @ 0x7f94a2831600] Opening 'output_test.m3u8.tmp' for writing
[hls @ 0x7f94a2831600] Opening 'output_test1.m4s' for writing
[hls @ 0x7f94a2831600] Opening 'output_test.m3u8.tmp' for writing
[hls @ 0x7f94a2831600] Opening 'output_test2.m4s' for writing
[hls @ 0x7f94a2831600] Opening 'output_test.m3u8.tmp' for writing
[hls @ 0x7f94a2831600] Opening 'output_test3.m4s' for writing
[hls @ 0x7f94a2831600] Opening 'output_test.m3u8.tmp' for writing
[hls @ 0x7f94a2831600] Opening 'output_test4.m4s' for writing
[hls @ 0x7f94a2831600] Opening 'output_test.m3u8.tmp' for writing
[hls @ 0x7f94a2831600] Opening 'output_test5.m4s' for writing
[hls @ 0x7f94a2831600] Opening 'output_test.m3u8.tmp' for writing
[hls @ 0x7f94a2831600] Opening 'output_test6.m4s' for writing
[hls @ 0x7f94a2831600] Opening 'output_test.m3u8.tmp' for writing
[hls @ 0x7f94a2831600] Opening 'output_test7.m4s' for writing
[hls @ 0x7f94a2831600] Opening 'output_test.m3u8.tmp' for writing
[hls @ 0x7f94a2831600] Opening 'output_test8.m4s' for writing
[hls @ 0x7f94a2831600] Opening 'output_test.m3u8.tmp' for writing
[hls @ 0x7f94a2831600] Opening 'output_test.m3u8.tmp' for writing
frame=  500 fps=0.0 q=-1.0 Lsize=N/A time=00:00:19.98 bitrate=N/A speed= 231x
video:6246kB audio:303kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: unknown
liuqideMBP:hlsfmp4 liuqi$ cat output_test.m3u8
#EXTM3U
#EXT-X-VERSION:7
#EXT-X-TARGETDURATION:6
#EXT-X-MEDIA-SEQUENCE:4
#EXT-X-MAP:URI="init.mp4"
#EXTINF:1.040000,
output_test4.m4s
#EXTINF:2.920000,
output_test5.m4s
#EXTINF:1.720000,
output_test6.m4s
#EXTINF:0.960000,
output_test7.m4s
#EXTINF:5.960000,
output_test8.m4s
#EXT-X-ENDLIST
liuqideMBP:hlsfmp4 liuqi$

comment:6 by Steven Liu, 7 years ago

https://patchwork.ffmpeg.org/patch/4383/

use this patch and check it.

comment:7 by JohnPi, 7 years ago

Ffmpeg doesn't generate the init.mp4 again , ffmpeg say it open 'init.mp4' for writing but there is no file.

co: unref short failure
[libx264 @ 0x55f86b9882e0] using SAR=1/1
[libx264 @ 0x55f86b9882e0] using cpu capabilities: MMX2 SSE2Fast SSSE3 SSE4.2 AVX FMA3 BMI2 AVX2
[libx264 @ 0x55f86b9882e0] profile Constrained Baseline, level 3.1
[libx264 @ 0x55f86b9882e0] 264 - core 152 - H.264/MPEG-4 AVC codec - Copyleft 2003-2017 - http://www.videolan.org/x264.html - options: cabac=0 ref=1 deblock=0:0:0 analyse=0:0 me=dia subme=0 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=17 lookahead_threads=2 sliced_threads=0 nr=0 decimate=1 interlaced=0 bluray_compat=0 constrained_intra=0 bframes=0 weightp=0 keyint=250 keyint_min=25 scenecut=0 intra_refresh=0 rc=crf mbtree=0 crf=25.0 qcomp=0.60 qpmin=0 qpmax=69 qpstep=4 ip_ratio=1.40 aq=0
[hls @ 0x55f86b911aa0] Opening 'init.mp4' for writing
Output #0, hls, to '/var/www/HLS/A.m3u8':
  Metadata:
    encoder         : Lavf57.76.100
    Stream #0:0: Video: h264 (libx264), yuv420p, 960x540 [SAR 1:1 DAR 16:9], q=-1--1, 1500 kb/s, 25 fps, 12800 tbn, 25 tbc
    Metadata:
      encoder         : Lavc57.102.100 libx264
    Side data:
      cpb: bitrate max/min/avg: 0/0/1500000 buffer size: 0 vbv_delay: -1
    Stream #0:1(fre): Audio: aac (LC), 48000 Hz, stereo, fltp, 96 kb/s
    Metadata:
      encoder         : Lavc57.102.100 aac
[hls @ 0x55f86b911aa0] Opening '/var/www/HLS/A-1500626433.m4s' for writing
[hls @ 0x55f86b911aa0] Opening '/var/www/HLS/A.m3u8.tmp' for writing
[hls @ 0x55f86b911aa0] Opening '/var/www/HLS/A-1500626433.m4s' for writing
[hls @ 0x55f86b911aa0] Opening '/var/www/HLS/A.m3u8.tmp' for writing
[mp4 @ 0x55f86f6073c0] Track 0 starts with a nonzero dts 274, while the moov already has been written. Set the delay_moov flag to handle this case.
[hls muxer @ 0x55f86babdf40] Duplicated segment filename detected: A-1500626433.m4sd=1.76x
[hls @ 0x55f86b911aa0] Opening '/var/www/HLS/A-1500626438.m4s' for writing
[hls @ 0x55f86b911aa0] Opening '/var/www/HLS/A.m3u8.tmp' for writing
[hls @ 0x55f86b911aa0] Opening '/var/www/HLS/A.m3u8.tmp' for writing=46 drop=0 speed=1.28x
frame=  500 fps= 33 q=-1.0 Lsize=N/A time=00:00:20.01 bitrate=N/A dup=46 drop=0 speed=1.32x
video:3235kB audio:240kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: unknown
[libx264 @ 0x55f86b9882e0] frame I:2     Avg QP:22.50  size: 32330
[libx264 @ 0x55f86b9882e0] frame P:498   Avg QP:21.58  size:  6522
[libx264 @ 0x55f86b9882e0] mb I  I16..4: 100.0%  0.0%  0.0%
[libx264 @ 0x55f86b9882e0] mb P  I16..4:  5.1%  0.0%  0.0%  P16..4: 16.6%  0.0%  0.0%  0.0%  0.0%    skip:78.3%
[libx264 @ 0x55f86b9882e0] coded y,uvDC,uvAC intra: 39.3% 36.8% 21.1% inter: 9.6% 6.3% 1.5%
[libx264 @ 0x55f86b9882e0] i16 v,h,dc,p: 40% 36% 13% 11%
[libx264 @ 0x55f86b9882e0] i8c dc,h,v,p: 49% 28% 18%  5%
[libx264 @ 0x55f86b9882e0] kb/s:1324.98
[aac @ 0x55f86babac00] Qavg: 531.912

ls /var/www/HLS/

root@Streamerhls:~# ls /var/www/HLS/
0010.ts  001.m3u8  0029.ts   0038.ts   0057.ts   0066.ts   0075.ts   0084.ts   0093.ts   1002.ts   11001.ts   A-1500624114.m4s  A-1500624210.m4s  A-1500624847.m4s  A.m3u8
0011.ts  0020.ts   002.m3u8  0039.ts   0058.ts   0067.ts   0076.ts   0085.ts   0094.ts   1003.ts   11002.ts   A-1500624120.m4s  A-1500624220.m4s  A-1500624857.m4s
0012.ts  0021.ts   0030.ts   003.m3u8  0059.ts   0068.ts   0077.ts   0086.ts   0095.ts   1004.ts   11003.ts   A-1500624130.m4s  A-1500624230.m4s  A-1500624867.m4s
0013.ts  0022.ts   0031.ts   0050.ts   005.m3u8  0069.ts   0078.ts   0087.ts   0096.ts   1005.ts   11004.ts   A-1500624140.m4s  A-1500624240.m4s  A-1500624877.m4s
0014.ts  0023.ts   0032.ts   0051.ts   0060.ts   006.m3u8  0079.ts   0088.ts   0097.ts   1006.ts   11005.ts   A-1500624150.m4s  A-1500624250.m4s  A-1500626361.m4s
0015.ts  0024.ts   0033.ts   0052.ts   0061.ts   0070.ts   007.m3u8  0089.ts   0098.ts   1007.ts   11006.ts   A-1500624160.m4s  A-1500624260.m4s  A-1500626367.m4s
0016.ts  0025.ts   0034.ts   0053.ts   0062.ts   0071.ts   0080.ts   008.m3u8  0099.ts   1008.ts   11007.ts   A-1500624170.m4s  A-1500624482.m4s  A-1500626397.m4s
0017.ts  0026.ts   0035.ts   0054.ts   0063.ts   0072.ts   0081.ts   0090.ts   009.m3u8  1009.ts   11008.ts   A-1500624180.m4s  A-1500624679.m4s  A-1500626402.m4s
0018.ts  0027.ts   0036.ts   0055.ts   0064.ts   0073.ts   0082.ts   0091.ts   1000.ts   100.m3u8  11009.ts   A-1500624190.m4s  A-1500624684.m4s  A-1500626433.m4s
0019.ts  0028.ts   0037.ts   0056.ts   0065.ts   0074.ts   0083.ts   0092.ts   1001.ts   11000.ts  1100.m3u8  A-1500624200.m4s  A-1500624841.m4s  A-1500626438.m4s

Thank you for all your work :)

comment:8 by JohnPi, 7 years ago

I fond the init.mp4 file, it wasn't in the destination folder but in my root folder (on Linux).

in reply to:  8 comment:9 by Steven Liu, 7 years ago

Replying to JohnPi:

I fond the init.mp4 file, it wasn't in the destination folder but in my root folder (on Linux).

Ah, i see, you exec the command at the root folder :D

comment:10 by JohnPi, 7 years ago

Exactly :D there is a option to put it in the m3u8 destianation folder ?

comment:11 by Steven Liu, 7 years ago

Only -hls_fmp4_init_filename now, i will add the default dir same as the output m3u8 list, and same with the options with the basename

comment:12 by Steven Liu, 7 years ago

https://patchwork.ffmpeg.org/patch/4412/

I have update the patch, try it please!

comment:13 by Steven Liu, 7 years ago

updated fix ./output.m3u8 output.m3u8 /path/output.m3u8

https://patchwork.ffmpeg.org/patch/4419/

comment:14 by JohnPi, 7 years ago

It's working :D

comment:15 by Steven Liu, 7 years ago

Resolution: fixed
Status: openclosed

comment:16 by Carl Eugen Hoyos, 5 years ago

Keywords: Fmp4 removed
Note: See TracTickets for help on using tickets.