Opened 7 years ago

Last modified 5 years ago

#6673 reopened defect

fmp4/hls not working with remote paths

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

Description

Summary of the bug:

When sending the chunks via the HTTP PUT method the init.mp4 file is not created on the remote path. When supplying a init.mp4 manually in the playlist the manifest does not play anywhere. This could be due to the init.mp4 being incorrect or because of something else. Is the init.mp4 stream specific or is it possible to generate a generic one?

How to reproduce:

% ffmpeg -i bbb.avi -loglevel warning \
     -hls_fmp4_init_filename init.mp4 -c:a aac -b:a 128k -ar 44100 -c:v libx264 -max_muxing_queue_size 400 -x264opts no-scenecut -force_key_frames "expr:gte(t,n_forced*2)" -crf 23 -start_number 0 -hls_time 4 -hls_list_size 3 -use_localtime 1 -hls_segment_type fmp4 -hls_segment_filename "${REMOTE_PATH}/segment_%s.m4s" -preset ultrafast -profile:v main -level 3.1 -r 30 -threads 0 -vf "scale=-2:720" -bufsize 2000k -maxrate 2000k -b:v 2000k -f hls -method PUT "${REMOTE_PATH}/playlist.m3u8"

ffmpeg version 3.3.3

Error:

[hls @ 0x7fa09a00ca00] Failed to open segment 'init.mp4'
Could not write header for output file #0 (incorrect codec parameters ?): No such file or directory

Patches should be submitted to the ffmpeg-devel mailing list and not this bug tracker.

Attachments (2)

3CA1E340-7ACD-4939-B846-05B009EAACE8.png (118.4 KB ) - added by Steven Liu 7 years ago.
test_ok_on_safari
withdebugmessage.png (226.3 KB ) - added by Steven Liu 7 years ago.
with debug message

Download all attachments as: .zip

Change History (13)

comment:1 by Steven Liu, 7 years ago

./ffmpeg -i ~/Movies/objectC/facebook.mp4 -loglevel warning      -hls_fmp4_init_filename http://192.168.0.157/init.mp4 -c:a aac -b:a 128k -ar 44100 -c:v libx264 -max_muxing_queue_size 400 -x264opts no-scenecut -force_key_frames "expr:gte(t,n_forced*2)" -crf 23 -start_number 0 -hls_time 4 -hls_list_size 3 -use_localtime 1 -hls_segment_type fmp4 -hls_segment_filename "http://192.168.0.157/segment_%s.m4s" -preset ultrafast -profile:v main -level 3.1 -r 30 -threads 0 -vf "scale=-2:720" -bufsize 2000k -maxrate 2000k -b:v 2000k -f hls -method PUT "http://192.168.0.157/playlist.m3u8"

Try modify your command looks like this.

Last edited 7 years ago by Steven Liu (previous) (diff)

comment:2 by Steven Liu, 7 years ago

Resolution: duplicate
Status: newclosed

comment:3 by Stephen Hoogendijk, 7 years ago

hi stevenliu, thanks for the quick reponse. It seems that it does not upload the init.mp4 to the remote endpoint. As in i'm not getting PUT request here for that file.

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

Resolution: duplicate
Status: closedreopened

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

Replying to thecodeassassin:

hi stevenliu, thanks for the quick reponse. It seems that it does not upload the init.mp4 to the remote endpoint. As in i'm not getting PUT request here for that file.

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

Try this patch please.

liuqideMBP:hlsdemux liuqi$ ls -hl /usr/local/nginx/html/
total 48
-rwxrwxrwx  1 root    admin   537B  5 17  2016 50x.html
-rw-r--r--  1 liuqi   admin   1.0K  1 28  2017 a.html
-rw-r--r--  1 liuqi   admin   1.1K  7  1 08:17 aaa.mpd
-rw-r--r--  1 liuqi   admin   1.1K  6 30 23:20 aaa_bbb.mpd
drwxrwxrwx  2 root    admin    68B 10 12  2016 flowstream
-rwxrwxrwx  1 root    admin   612B  5 17  2016 index.html
drwxrwxrwx  7 liuqi   admin   238B  7 18 19:59 test
-rwxrwxrwx  1 nobody  admin   239B  5 18  2016 upload.hls
liuqideMBP:hlsdemux liuqi$ ./ffmpeg -i ~/Movies/objectC/facebook.mp4 -loglevel warning      -hls_fmp4_init_filename http://192.168.0.157/init.mp4 -c:a aac -b:a 128k -ar 44100 -c:v libx264 -max_muxing_queue_size 400 -x264opts no-scenecut -force_key_frames "expr:gte(t,n_forced*2)" -crf 23 -start_number 0 -hls_time 4 -hls_list_size 3 -use_localtime 1 -hls_segment_type fmp4 -hls_segment_filename "http://192.168.0.157/segment_%s.m4s" -preset ultrafast -profile:v main -level 3.1 -r 30 -threads 0 -vf "scale=-2:720" -bufsize 2000k -maxrate 2000k -b:v 2000k -f hls -method PUT -t 20 "http://192.168.0.157/playlist.m3u8"
[libx264 @ 0x7f9198030e00] frame MB size (81x45) > level limit (3600)
[libx264 @ 0x7f9198030e00] MB rate (109350) > level limit (108000)
[hls @ 0x7f91980a4c00] Cannot use rename on non file protocol, this may lead to races and temporary partial files
[mp4 @ 0x7f9198000600] Track 0 starts with a nonzero dts 357, while the moov already has been written. Set the delay_moov flag to handle this case.
[hls muxer @ 0x7f91980a5200] Duplicated segment filename detected: segment_1505815744.m4s
[hls muxer @ 0x7f91980a5200] Duplicated segment filename detected: segment_1505815745.m4s
liuqideMBP:hlsdemux liuqi$ ls -hl /usr/local/nginx/html/
total 8800
-rwxrwxrwx  1 root    admin   537B  5 17  2016 50x.html
-rw-r--r--  1 liuqi   admin   1.0K  1 28  2017 a.html
-rw-r--r--  1 liuqi   admin   1.1K  7  1 08:17 aaa.mpd
-rw-r--r--  1 liuqi   admin   1.1K  6 30 23:20 aaa_bbb.mpd
drwxrwxrwx  2 root    admin    68B 10 12  2016 flowstream
-rwxrwxrwx  1 root    admin   612B  5 17  2016 index.html
-rw-rw-rw-  1 nobody  admin   1.2K  9 19 18:09 init.mp4
-rw-rw-rw-  1 nobody  admin   217B  9 19 18:09 playlist.m3u8
-rw-rw-rw-  1 nobody  admin   1.2M  9 19 18:09 segment_1505815744.m4s
-rw-rw-rw-  1 nobody  admin   1.0M  9 19 18:09 segment_1505815745.m4s
-rw-rw-rw-  1 nobody  admin   1.0M  9 19 18:09 segment_1505815746.m4s
-rw-rw-rw-  1 nobody  admin   1.0M  9 19 18:09 segment_1505815747.m4s
drwxrwxrwx  7 liuqi   admin   238B  7 18 19:59 test
-rwxrwxrwx  1 nobody  admin   239B  5 18  2016 upload.hls

in reply to:  5 ; comment:6 by Stephen Hoogendijk, 7 years ago

Yeah this patch solves the problem. However my playlist doesn't seem to play in a test player:

#EXTM3U
#EXT-X-VERSION:7
#EXT-X-MEDIA-SEQUENCE:0
#EXT-X-ALLOW-CACHE:YES
#EXT-X-PLAYLIST-TYPE:VOD
#EXT-X-TARGETDURATION:4
#EXT-X-INDEPENDENT-SEGMENTS
#EXT-X-MAP:URI="init_720p.mp4"

#EXTINF:4.000000,
720p_segment_1505824953.m4s
#EXTINF:4.000000,
720p_segment_1505824958.m4s
#EXTINF:2.200000,
720p_segment_1505824962.m4s
#EXT-X-ENDLIST

Playlist: https://d3ksou5z0j9mc7.cloudfront.net/stephen-test-7/master.m3u8

ffmpeg -i  https://d3ksou5z0j9mc7.cloudfront.net/stephen-test-7/master.m3u8 -acodec aac -b:a 128k -vcodec libx264 -b:v 3000k -preset ultrafast -movflags +faststart -f mp4 pipe:1 > ~/test.mp4
ffmpeg version N-87327-g18821e3 Copyright (c) 2000-2017 the FFmpeg developers
  built with Apple LLVM version 8.0.0 (clang-800.0.42.1)
  configuration: --prefix=/usr/local --enable-gpl --enable-nonfree --enable-libass --enable-libfdk-aac --enable-libfreetype --enable-libx264
  libavutil      55. 75.100 / 55. 75.100
  libavcodec     57.106.101 / 57.106.101
  libavformat    57. 82.100 / 57. 82.100
  libavdevice    57.  8.101 / 57.  8.101
  libavfilter     6.105.100 /  6.105.100
  libswscale      4.  7.103 /  4.  7.103
  libswresample   2.  8.100 /  2.  8.100
  libpostproc    54.  6.100 / 54.  6.100
[hls,applehttp @ 0x7fa63c800000] Opening 'https://d3ksou5z0j9mc7.cloudfront.net/stephen-test-7/720p/playlist.m3u8' for reading
[hls,applehttp @ 0x7fa63c800000] Opening 'https://d3ksou5z0j9mc7.cloudfront.net/stephen-test-7/480p/playlist.m3u8' for reading
[hls,applehttp @ 0x7fa63c800000] Opening 'https://d3ksou5z0j9mc7.cloudfront.net/stephen-test-7/240p/playlist.m3u8' for reading
[hls,applehttp @ 0x7fa63c800000] Opening 'https://d3ksou5z0j9mc7.cloudfront.net/stephen-test-7/720p/init_720p.mp4' for reading
Could not read complete segment.
[hls,applehttp @ 0x7fa63c800000] Opening 'https://d3ksou5z0j9mc7.cloudfront.net/stephen-test-7/720p/720p_segment_1505824953.m4s' for reading
[hls,applehttp @ 0x7fa63c800000] Opening 'https://d3ksou5z0j9mc7.cloudfront.net/stephen-test-7/480p/init_480p.mp4' for reading
Could not read complete segment.
[hls,applehttp @ 0x7fa63c800000] Opening 'https://d3ksou5z0j9mc7.cloudfront.net/stephen-test-7/480p/480p_segment_1505824953.m4s' for reading
[hls,applehttp @ 0x7fa63c800000] Opening 'https://d3ksou5z0j9mc7.cloudfront.net/stephen-test-7/240p/init_240p.mp4' for reading
Could not read complete segment.
[hls,applehttp @ 0x7fa63c800000] Opening 'https://d3ksou5z0j9mc7.cloudfront.net/stephen-test-7/240p/240p_segment_1505824953.m4s' for reading
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x7fa63b817e00] stream 0, offset 0xc76: partial file
[hls,applehttp @ 0x7fa63c800000] Could not find codec parameters for stream 0 (Video: h264 (avc1 / 0x31637661), none, 1280x720, 2239 kb/s): unspecified pixel format
Consider increasing the value for the 'analyzeduration' and 'probesize' options
[hls,applehttp @ 0x7fa63c800000] Could not find codec parameters for stream 2 (Video: h264 (avc1 / 0x31637661), none, 854x480, 1110 kb/s): unspecified pixel format
Consider increasing the value for the 'analyzeduration' and 'probesize' options
[hls,applehttp @ 0x7fa63c800000] Could not find codec parameters for stream 4 (Video: h264 (avc1 / 0x31637661), none, 426x240, 379 kb/s): unspecified pixel format
Consider increasing the value for the 'analyzeduration' and 'probesize' options
Input #0, hls,applehttp, from 'https://d3ksou5z0j9mc7.cloudfront.net/stephen-test-7/master.m3u8':
  Duration: 00:05:18.87, bitrate: 0 kb/s
  Program 0
    Metadata:
      variant_bitrate : 3000000
    Stream #0:0: Video: h264 (avc1 / 0x31637661), none, 1280x720, 2239 kb/s, 15360 tbr, 15360 tbn, 30720 tbc
    Metadata:
      variant_bitrate : 3000000
    Stream #0:1: Audio: aac (mp4a / 0x6134706D), 44100 Hz, 5.1, fltp, 127 kb/s
    Metadata:
      variant_bitrate : 3000000
  Program 1
    Metadata:
      variant_bitrate : 1500000
    Stream #0:2: Video: h264 (avc1 / 0x31637661), none, 854x480, 1110 kb/s, 15360 tbr, 15360 tbn, 30720 tbc
    Metadata:
      variant_bitrate : 1500000
    Stream #0:3: Audio: aac (mp4a / 0x6134706D), 44100 Hz, 5.1, fltp, 127 kb/s
    Metadata:
      variant_bitrate : 1500000
  Program 2
    Metadata:
      variant_bitrate : 800000
    Stream #0:4: Video: h264 (avc1 / 0x31637661), none, 426x240, 379 kb/s, 15360 tbr, 15360 tbn, 30720 tbc
    Metadata:
      variant_bitrate : 800000
    Stream #0:5: Audio: aac (mp4a / 0x6134706D), 44100 Hz, 5.1, fltp, 127 kb/s
    Metadata:
      variant_bitrate : 800000
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
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x7fa63b817e00] stream 0, offset 0xc76: partial file
https://d3ksou5z0j9mc7.cloudfront.net/stephen-test-7/master.m3u8: Invalid data found when processing input
Finishing stream 0:0 without any data written to it.
Finishing stream 0:1 without any data written to it.
Nothing was written into output file 0 (pipe:1), because at least one of its streams received no packets.
frame=    0 fps=0.0 q=0.0 Lsize=       0kB time=-577014:32:22.77 bitrate=  -0.0kbits/s speed=N/A
video:0kB audio:0kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: unknown
[aac @ 0x7fa63c01ee00] Qavg: na

However, the same structure with ts segments work fine.

Replying to stevenliu:

Replying to thecodeassassin:

hi stevenliu, thanks for the quick reponse. It seems that it does not upload the init.mp4 to the remote endpoint. As in i'm not getting PUT request here for that file.

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

Try this patch please.

liuqideMBP:hlsdemux liuqi$ ls -hl /usr/local/nginx/html/
total 48
-rwxrwxrwx  1 root    admin   537B  5 17  2016 50x.html
-rw-r--r--  1 liuqi   admin   1.0K  1 28  2017 a.html
-rw-r--r--  1 liuqi   admin   1.1K  7  1 08:17 aaa.mpd
-rw-r--r--  1 liuqi   admin   1.1K  6 30 23:20 aaa_bbb.mpd
drwxrwxrwx  2 root    admin    68B 10 12  2016 flowstream
-rwxrwxrwx  1 root    admin   612B  5 17  2016 index.html
drwxrwxrwx  7 liuqi   admin   238B  7 18 19:59 test
-rwxrwxrwx  1 nobody  admin   239B  5 18  2016 upload.hls
liuqideMBP:hlsdemux liuqi$ ./ffmpeg -i ~/Movies/objectC/facebook.mp4 -loglevel warning      -hls_fmp4_init_filename http://192.168.0.157/init.mp4 -c:a aac -b:a 128k -ar 44100 -c:v libx264 -max_muxing_queue_size 400 -x264opts no-scenecut -force_key_frames "expr:gte(t,n_forced*2)" -crf 23 -start_number 0 -hls_time 4 -hls_list_size 3 -use_localtime 1 -hls_segment_type fmp4 -hls_segment_filename "http://192.168.0.157/segment_%s.m4s" -preset ultrafast -profile:v main -level 3.1 -r 30 -threads 0 -vf "scale=-2:720" -bufsize 2000k -maxrate 2000k -b:v 2000k -f hls -method PUT -t 20 "http://192.168.0.157/playlist.m3u8"
[libx264 @ 0x7f9198030e00] frame MB size (81x45) > level limit (3600)
[libx264 @ 0x7f9198030e00] MB rate (109350) > level limit (108000)
[hls @ 0x7f91980a4c00] Cannot use rename on non file protocol, this may lead to races and temporary partial files
[mp4 @ 0x7f9198000600] Track 0 starts with a nonzero dts 357, while the moov already has been written. Set the delay_moov flag to handle this case.
[hls muxer @ 0x7f91980a5200] Duplicated segment filename detected: segment_1505815744.m4s
[hls muxer @ 0x7f91980a5200] Duplicated segment filename detected: segment_1505815745.m4s
liuqideMBP:hlsdemux liuqi$ ls -hl /usr/local/nginx/html/
total 8800
-rwxrwxrwx  1 root    admin   537B  5 17  2016 50x.html
-rw-r--r--  1 liuqi   admin   1.0K  1 28  2017 a.html
-rw-r--r--  1 liuqi   admin   1.1K  7  1 08:17 aaa.mpd
-rw-r--r--  1 liuqi   admin   1.1K  6 30 23:20 aaa_bbb.mpd
drwxrwxrwx  2 root    admin    68B 10 12  2016 flowstream
-rwxrwxrwx  1 root    admin   612B  5 17  2016 index.html
-rw-rw-rw-  1 nobody  admin   1.2K  9 19 18:09 init.mp4
-rw-rw-rw-  1 nobody  admin   217B  9 19 18:09 playlist.m3u8
-rw-rw-rw-  1 nobody  admin   1.2M  9 19 18:09 segment_1505815744.m4s
-rw-rw-rw-  1 nobody  admin   1.0M  9 19 18:09 segment_1505815745.m4s
-rw-rw-rw-  1 nobody  admin   1.0M  9 19 18:09 segment_1505815746.m4s
-rw-rw-rw-  1 nobody  admin   1.0M  9 19 18:09 segment_1505815747.m4s
drwxrwxrwx  7 liuqi   admin   238B  7 18 19:59 test
-rwxrwxrwx  1 nobody  admin   239B  5 18  2016 upload.hls
Last edited 7 years ago by Stephen Hoogendijk (previous) (diff)

comment:7 by Steven Liu, 7 years ago

maybe need support http play fmp4 format at hls.c, now you can test the link with quicktime or safari
and i will make it right at hls, so this ticket can be closed.

I saw your link codec is mpeg4, not AVC.

localhost:dash StevenLiu$ ./ffmpeg -re -i ~/Movies/objectC/facebook.mp4 -g 30 -c:a aac -b:a 128k -ar 44100 -c:v libx264 -f hls -method PUT -hls_fmp4_init_filename http://192.168.3.2/init.mp4 -hls_time 4 -hls_list_size 0 -hls_segment_type fmp4 -preset ultrafast -profile:v main -level 3.1 -r 30 -t 20 "http://192.168.3.2/playlist.m3u8"
ffmpeg version N-87328-gb4ecf2b582 Copyright (c) 2000-2017 the FFmpeg developers
  built with Apple LLVM version 8.1.0 (clang-802.0.42)
  configuration: --enable-htmlpages --enable-libass --enable-opengl --enable-libx264 --enable-libmp3lame --enable-gpl --enable-nonfree --prefix=/usr/local --enable-libopencv --enable-libtesseract --enable-libspeex --enable-libfreetype --enable-libfontconfig --enable-libfdk-aac --enable-videotoolbox --enable-libxml2
  libavutil      55. 75.100 / 55. 75.100
  libavcodec     57.106.101 / 57.106.101
  libavformat    57. 82.100 / 57. 82.100
  libavdevice    57.  8.101 / 57.  8.101
  libavfilter     6.105.100 /  6.105.100
  libswscale      4.  7.103 /  4.  7.103
  libswresample   2.  8.100 /  2.  8.100
  libpostproc    54.  6.100 / 54.  6.100
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from '/Users/StevenLiu/Movies/objectC/facebook.mp4':
  Metadata:
    major_brand     : isom
    minor_version   : 512
    compatible_brands: isomiso2avc1mp41
    encoder         : Lavf55.22.102
    description     : This File is Created by Easy RealMedia Tools@!
  Duration: 02:00:27.85, start: 0.000000, bitrate: 893 kb/s
    Stream #0:0(und): Video: h264 (High) (avc1 / 0x31637661), yuv420p, 640x480, 797 kb/s, 25 fps, 25 tbr, 12800 tbn, 50 tbc (default)
    Metadata:
      handler_name    : VideoHandler
    Stream #0:1(und): Audio: aac (LC) (mp4a / 0x6134706D), 44100 Hz, stereo, fltp, 87 kb/s (default)
    Metadata:
      handler_name    : SoundHandler
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
[libx264 @ 0x7fa12b803200] using cpu capabilities: MMX2 SSE2Fast SSSE3 SSE4.2 AVX AVX2 FMA3 LZCNT BMI2
[libx264 @ 0x7fa12b803200] profile Constrained Baseline, level 3.1
[libx264 @ 0x7fa12b803200] 264 - core 133 r2334M a3ac64b - H.264/MPEG-4 AVC codec - Copyleft 2003-2013 - 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=6 lookahead_threads=1 sliced_threads=0 nr=0 decimate=1 interlaced=0 bluray_compat=0 constrained_intra=0 bframes=0 weightp=0 keyint=30 keyint_min=3 scenecut=0 intra_refresh=0 rc=crf mbtree=0 crf=23.0 qcomp=0.60 qpmin=0 qpmax=69 qpstep=4 ip_ratio=1.40 aq=0
[hls @ 0x7fa12b801200] Opening 'http://192.168.3.2/init.mp4' for writing
Output #0, hls, to 'http://192.168.3.2/playlist.m3u8':
  Metadata:
    major_brand     : isom
    minor_version   : 512
    compatible_brands: isomiso2avc1mp41
    description     : This File is Created by Easy RealMedia Tools@!
    encoder         : Lavf57.82.100
    Stream #0:0(und): Video: h264 (libx264), yuv420p, 640x480, q=-1--1, 30 fps, 15360 tbn, 30 tbc (default)
    Metadata:
      handler_name    : VideoHandler
      encoder         : Lavc57.106.101 libx264
    Side data:
      cpb: bitrate max/min/avg: 0/0/0 buffer size: 0 vbv_delay: -1
    Stream #0:1(und): Audio: aac (LC), 44100 Hz, stereo, fltp, 128 kb/s (default)
    Metadata:
      handler_name    : SoundHandler
      encoder         : Lavc57.106.101 aac
[hls @ 0x7fa12b801200] Opening 'http://192.168.3.2/playlist0.m4s' for writing
[hls @ 0x7fa12b801200] Cannot use rename on non file protocol, this may lead to races and temporary partial files
[mp4 @ 0x7fa12bc2b200] Track 1 starts with a nonzero dts 1764, while the moov already has been written. Set the delay_moov flag to handle this case.
[hls @ 0x7fa12b801200] Opening 'http://192.168.3.2/playlist1.m4s' for writing speed=0.952x
[mp4 @ 0x7fa12bc2b200] Application provided duration: -10 / timestamp: 44397 is out of range for mov/mp4 format
[hls @ 0x7fa12b801200] Opening 'http://192.168.3.2/playlist2.m4s' for writing0 speed=0.984x
[mp4 @ 0x7fa12bc2b200] Application provided duration: -10 / timestamp: 177006 is out of range for mov/mp4 format
[hls @ 0x7fa12b801200] Opening 'http://192.168.3.2/playlist3.m4s' for writing0 speed=0.993x
[mp4 @ 0x7fa12bc2b200] Application provided duration: -10 / timestamp: 353009 is out of range for mov/mp4 format
[hls @ 0x7fa12b801200] Opening 'http://192.168.3.2/playlist4.m4s' for writing0 speed=0.994x
[mp4 @ 0x7fa12bc2b200] Application provided duration: -9 / timestamp: 530071 is out of range for mov/mp4 format
[hls @ 0x7fa12b801200] Opening 'http://192.168.3.2/playlist5.m4s' for writing0 speed=0.996x
[mp4 @ 0x7fa12bc2b200] Application provided duration: -9 / timestamp: 706074 is out of range for mov/mp4 format
frame=  600 fps= 30 q=-1.0 Lsize=N/A time=00:00:20.00 bitrate=N/A dup=100 drop=0 speed=0.991x
video:2803kB audio:316kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: unknown
[libx264 @ 0x7fa12b803200] frame I:20    Avg QP:15.95  size: 41923
[libx264 @ 0x7fa12b803200] frame P:580   Avg QP:18.95  size:  3503
[libx264 @ 0x7fa12b803200] mb I  I16..4: 100.0%  0.0%  0.0%
[libx264 @ 0x7fa12b803200] mb P  I16..4:  2.5%  0.0%  0.0%  P16..4: 38.0%  0.0%  0.0%  0.0%  0.0%    skip:59.5%
[libx264 @ 0x7fa12b803200] coded y,uvDC,uvAC intra: 46.4% 53.7% 30.4% inter: 15.5% 15.3% 0.9%
[libx264 @ 0x7fa12b803200] i16 v,h,dc,p: 42% 32% 10% 16%
[libx264 @ 0x7fa12b803200] i8c dc,h,v,p: 44% 30% 14% 11%
[libx264 @ 0x7fa12b803200] kb/s:1147.99
[aac @ 0x7fa12b804a00] Qavg: 528.571
localhost:dash StevenLiu$
Last edited 7 years ago by Steven Liu (previous) (diff)

by Steven Liu, 7 years ago

test_ok_on_safari

by Steven Liu, 7 years ago

Attachment: withdebugmessage.png added

with debug message

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

Replying to thecodeassassin:

Yeah this patch solves the problem. However my playlist doesn't seem to play in a test player:

#EXTM3U
#EXT-X-VERSION:7
#EXT-X-MEDIA-SEQUENCE:0
#EXT-X-ALLOW-CACHE:YES
#EXT-X-PLAYLIST-TYPE:VOD
#EXT-X-TARGETDURATION:4
#EXT-X-INDEPENDENT-SEGMENTS
#EXT-X-MAP:URI="init_720p.mp4"

#EXTINF:4.000000,
720p_segment_1505824953.m4s
#EXTINF:4.000000,
720p_segment_1505824958.m4s
#EXTINF:2.200000,
720p_segment_1505824962.m4s
#EXT-X-ENDLIST

Playlist: https://d3ksou5z0j9mc7.cloudfront.net/stephen-test-7/master.m3u8

ffmpeg -i  https://d3ksou5z0j9mc7.cloudfront.net/stephen-test-7/master.m3u8 -acodec aac -b:a 128k -vcodec libx264 -b:v 3000k -preset ultrafast -movflags +faststart -f mp4 pipe:1 > ~/test.mp4
ffmpeg version N-87327-g18821e3 Copyright (c) 2000-2017 the FFmpeg developers
  built with Apple LLVM version 8.0.0 (clang-800.0.42.1)
  configuration: --prefix=/usr/local --enable-gpl --enable-nonfree --enable-libass --enable-libfdk-aac --enable-libfreetype --enable-libx264
  libavutil      55. 75.100 / 55. 75.100
  libavcodec     57.106.101 / 57.106.101
  libavformat    57. 82.100 / 57. 82.100
  libavdevice    57.  8.101 / 57.  8.101
  libavfilter     6.105.100 /  6.105.100
  libswscale      4.  7.103 /  4.  7.103
  libswresample   2.  8.100 /  2.  8.100
  libpostproc    54.  6.100 / 54.  6.100
[hls,applehttp @ 0x7fa63c800000] Opening 'https://d3ksou5z0j9mc7.cloudfront.net/stephen-test-7/720p/playlist.m3u8' for reading
[hls,applehttp @ 0x7fa63c800000] Opening 'https://d3ksou5z0j9mc7.cloudfront.net/stephen-test-7/480p/playlist.m3u8' for reading
[hls,applehttp @ 0x7fa63c800000] Opening 'https://d3ksou5z0j9mc7.cloudfront.net/stephen-test-7/240p/playlist.m3u8' for reading
[hls,applehttp @ 0x7fa63c800000] Opening 'https://d3ksou5z0j9mc7.cloudfront.net/stephen-test-7/720p/init_720p.mp4' for reading
Could not read complete segment.
[hls,applehttp @ 0x7fa63c800000] Opening 'https://d3ksou5z0j9mc7.cloudfront.net/stephen-test-7/720p/720p_segment_1505824953.m4s' for reading
[hls,applehttp @ 0x7fa63c800000] Opening 'https://d3ksou5z0j9mc7.cloudfront.net/stephen-test-7/480p/init_480p.mp4' for reading
Could not read complete segment.
[hls,applehttp @ 0x7fa63c800000] Opening 'https://d3ksou5z0j9mc7.cloudfront.net/stephen-test-7/480p/480p_segment_1505824953.m4s' for reading
[hls,applehttp @ 0x7fa63c800000] Opening 'https://d3ksou5z0j9mc7.cloudfront.net/stephen-test-7/240p/init_240p.mp4' for reading
Could not read complete segment.
[hls,applehttp @ 0x7fa63c800000] Opening 'https://d3ksou5z0j9mc7.cloudfront.net/stephen-test-7/240p/240p_segment_1505824953.m4s' for reading
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x7fa63b817e00] stream 0, offset 0xc76: partial file
[hls,applehttp @ 0x7fa63c800000] Could not find codec parameters for stream 0 (Video: h264 (avc1 / 0x31637661), none, 1280x720, 2239 kb/s): unspecified pixel format
Consider increasing the value for the 'analyzeduration' and 'probesize' options
[hls,applehttp @ 0x7fa63c800000] Could not find codec parameters for stream 2 (Video: h264 (avc1 / 0x31637661), none, 854x480, 1110 kb/s): unspecified pixel format
Consider increasing the value for the 'analyzeduration' and 'probesize' options
[hls,applehttp @ 0x7fa63c800000] Could not find codec parameters for stream 4 (Video: h264 (avc1 / 0x31637661), none, 426x240, 379 kb/s): unspecified pixel format
Consider increasing the value for the 'analyzeduration' and 'probesize' options
Input #0, hls,applehttp, from 'https://d3ksou5z0j9mc7.cloudfront.net/stephen-test-7/master.m3u8':
  Duration: 00:05:18.87, bitrate: 0 kb/s
  Program 0
    Metadata:
      variant_bitrate : 3000000
    Stream #0:0: Video: h264 (avc1 / 0x31637661), none, 1280x720, 2239 kb/s, 15360 tbr, 15360 tbn, 30720 tbc
    Metadata:
      variant_bitrate : 3000000
    Stream #0:1: Audio: aac (mp4a / 0x6134706D), 44100 Hz, 5.1, fltp, 127 kb/s
    Metadata:
      variant_bitrate : 3000000
  Program 1
    Metadata:
      variant_bitrate : 1500000
    Stream #0:2: Video: h264 (avc1 / 0x31637661), none, 854x480, 1110 kb/s, 15360 tbr, 15360 tbn, 30720 tbc
    Metadata:
      variant_bitrate : 1500000
    Stream #0:3: Audio: aac (mp4a / 0x6134706D), 44100 Hz, 5.1, fltp, 127 kb/s
    Metadata:
      variant_bitrate : 1500000
  Program 2
    Metadata:
      variant_bitrate : 800000
    Stream #0:4: Video: h264 (avc1 / 0x31637661), none, 426x240, 379 kb/s, 15360 tbr, 15360 tbn, 30720 tbc
    Metadata:
      variant_bitrate : 800000
    Stream #0:5: Audio: aac (mp4a / 0x6134706D), 44100 Hz, 5.1, fltp, 127 kb/s
    Metadata:
      variant_bitrate : 800000
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
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x7fa63b817e00] stream 0, offset 0xc76: partial file
https://d3ksou5z0j9mc7.cloudfront.net/stephen-test-7/master.m3u8: Invalid data found when processing input
Finishing stream 0:0 without any data written to it.
Finishing stream 0:1 without any data written to it.
Nothing was written into output file 0 (pipe:1), because at least one of its streams received no packets.
frame=    0 fps=0.0 q=0.0 Lsize=       0kB time=-577014:32:22.77 bitrate=  -0.0kbits/s speed=N/A
video:0kB audio:0kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: unknown
[aac @ 0x7fa63c01ee00] Qavg: na

However, the same structure with ts segments work fine.

Replying to stevenliu:

Replying to thecodeassassin:

hi stevenliu, thanks for the quick reponse. It seems that it does not upload the init.mp4 to the remote endpoint. As in i'm not getting PUT request here for that file.

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

Try this patch please.

liuqideMBP:hlsdemux liuqi$ ls -hl /usr/local/nginx/html/
total 48
-rwxrwxrwx  1 root    admin   537B  5 17  2016 50x.html
-rw-r--r--  1 liuqi   admin   1.0K  1 28  2017 a.html
-rw-r--r--  1 liuqi   admin   1.1K  7  1 08:17 aaa.mpd
-rw-r--r--  1 liuqi   admin   1.1K  6 30 23:20 aaa_bbb.mpd
drwxrwxrwx  2 root    admin    68B 10 12  2016 flowstream
-rwxrwxrwx  1 root    admin   612B  5 17  2016 index.html
drwxrwxrwx  7 liuqi   admin   238B  7 18 19:59 test
-rwxrwxrwx  1 nobody  admin   239B  5 18  2016 upload.hls
liuqideMBP:hlsdemux liuqi$ ./ffmpeg -i ~/Movies/objectC/facebook.mp4 -loglevel warning      -hls_fmp4_init_filename http://192.168.0.157/init.mp4 -c:a aac -b:a 128k -ar 44100 -c:v libx264 -max_muxing_queue_size 400 -x264opts no-scenecut -force_key_frames "expr:gte(t,n_forced*2)" -crf 23 -start_number 0 -hls_time 4 -hls_list_size 3 -use_localtime 1 -hls_segment_type fmp4 -hls_segment_filename "http://192.168.0.157/segment_%s.m4s" -preset ultrafast -profile:v main -level 3.1 -r 30 -threads 0 -vf "scale=-2:720" -bufsize 2000k -maxrate 2000k -b:v 2000k -f hls -method PUT -t 20 "http://192.168.0.157/playlist.m3u8"
[libx264 @ 0x7f9198030e00] frame MB size (81x45) > level limit (3600)
[libx264 @ 0x7f9198030e00] MB rate (109350) > level limit (108000)
[hls @ 0x7f91980a4c00] Cannot use rename on non file protocol, this may lead to races and temporary partial files
[mp4 @ 0x7f9198000600] Track 0 starts with a nonzero dts 357, while the moov already has been written. Set the delay_moov flag to handle this case.
[hls muxer @ 0x7f91980a5200] Duplicated segment filename detected: segment_1505815744.m4s
[hls muxer @ 0x7f91980a5200] Duplicated segment filename detected: segment_1505815745.m4s
liuqideMBP:hlsdemux liuqi$ ls -hl /usr/local/nginx/html/
total 8800
-rwxrwxrwx  1 root    admin   537B  5 17  2016 50x.html
-rw-r--r--  1 liuqi   admin   1.0K  1 28  2017 a.html
-rw-r--r--  1 liuqi   admin   1.1K  7  1 08:17 aaa.mpd
-rw-r--r--  1 liuqi   admin   1.1K  6 30 23:20 aaa_bbb.mpd
drwxrwxrwx  2 root    admin    68B 10 12  2016 flowstream
-rwxrwxrwx  1 root    admin   612B  5 17  2016 index.html
-rw-rw-rw-  1 nobody  admin   1.2K  9 19 18:09 init.mp4
-rw-rw-rw-  1 nobody  admin   217B  9 19 18:09 playlist.m3u8
-rw-rw-rw-  1 nobody  admin   1.2M  9 19 18:09 segment_1505815744.m4s
-rw-rw-rw-  1 nobody  admin   1.0M  9 19 18:09 segment_1505815745.m4s
-rw-rw-rw-  1 nobody  admin   1.0M  9 19 18:09 segment_1505815746.m4s
-rw-rw-rw-  1 nobody  admin   1.0M  9 19 18:09 segment_1505815747.m4s
drwxrwxrwx  7 liuqi   admin   238B  7 18 19:59 test
-rwxrwxrwx  1 nobody  admin   239B  5 18  2016 upload.hls

base on the previous patch , and use this patch : https://patchwork.ffmpeg.org/patch/5200/
to play the hls like this:

ffplay cache:http://xxxxxx/xxxx.m3u8

for example:
./ffplay cache:http://192.168.0.157/playlist.m3u8

comment:9 by Carl Eugen Hoyos, 5 years ago

Keywords: fmp4 removed

Is this issue still reproducible?

in reply to:  9 comment:10 by Steven Liu, 5 years ago

Replying to cehoyos:

Is this issue still reproducible?

should be fixed by patchset:

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

comment:11 by Carl Eugen Hoyos, 5 years ago

If the patchset was pushed please post the commit hash and close the ticket.

Note: See TracTickets for help on using tickets.