1. 08 Apr, 2020 8 commits
    • Limin Wang's avatar
      avformat/hlsenc: remove the first slash of the relative path line in the master m3u8 file · e2e8ef50
      Limin Wang authored
      Please testing with the following command:
      ./ffmpeg -y -i input.mkv \
       -b:v:0 5250k -c:v h264 -pix_fmt yuv420p -profile:v main -level 4.1 \
       -b:a:0 256k \
       -c:a mp2 -ar 48000 -ac 2 -map 0:v -map 0:a:0\
       -f hls -var_stream_map "v:0,a:0" \
       -master_pl_name master.m3u8 -t 300 -hls_time 10 -hls_init_time 4 -hls_list_size \
       10 -master_pl_publish_rate 10  -hls_flags \
       delete_segments+discont_start+split_by_time ./tmp/video.m3u8
      
      then cat ./tmp/master.m3u8
      before:
      #EXTM3U
      #EXT-X-VERSION:3
      #EXT-X-STREAM-INF:BANDWIDTH=6056600,RESOLUTION=1280x720,CODECS="avc1.4d4829,mp4a.40.33"
      /video.m3u8
      
      $ ./ffmpeg -i  ./tmp/master.m3u8 -c:v copy -c:a mp2 ./test.mkv
      [hls @ 0x7f82f9000000] Skip ('#EXT-X-VERSION:3')
      [hls @ 0x7f82f9000000] Opening '/video.m3u8' for reading
      [hls @ 0x7f82f9000000] parse_playlist error No such file or directory [/video.m3u8]
      ./tmp/master.m3u8: No such file or directory
      
      after:
      #EXTM3U
      #EXT-X-VERSION:3
      #EXT-X-STREAM-INF:BANDWIDTH=6056600,RESOLUTION=1280x720,CODECS="avc1.4d4829,mp4a.40.33"
      video.m3u8
      Signed-off-by: 's avatarLimin Wang <lance.lmwang@gmail.com>
      e2e8ef50
    • Andreas Rheinhardt's avatar
      avformat/hlsenc: Use AVBPrint to avoid allocations of strings · c9cd0a20
      Andreas Rheinhardt authored
      when deleting old segments.
      Signed-off-by: 's avatarAndreas Rheinhardt <andreas.rheinhardt@gmail.com>
      c9cd0a20
    • Andreas Rheinhardt's avatar
      avformat/hlsenc: Fix memleak when deleting old segments · de8f6a40
      Andreas Rheinhardt authored
      if the directory name of the segments contains "%v".
      
      This memleak is caused by masking the pointer that will eventually
      be freed by a variable of the same name in a smaller scope.
      Therefore the pointer that gets freed is always NULL when it is
      freed and the allocated data leaks.
      Signed-off-by: 's avatarAndreas Rheinhardt <andreas.rheinhardt@gmail.com>
      de8f6a40
    • Andreas Rheinhardt's avatar
      avformat/smacker: Cosmetics · 95e9cf81
      Andreas Rheinhardt authored
      This is mainly about improving legibility of the code and getting rid of
      overlong lines by using variables for st->codecpar instead of accessing
      the codecparameters via st->codecpar->.
      
      Also, some code has been moved to better fitting places.
      Signed-off-by: 's avatarAndreas Rheinhardt <andreas.rheinhardt@gmail.com>
      95e9cf81
    • Andreas Rheinhardt's avatar
    • Andreas Rheinhardt's avatar
      avformat/smacker: Only store what is needed later · b6ebc5ae
      Andreas Rheinhardt authored
      This commit removes data that is only used during smacker_read_header()
      from the demuxer's context and replaces the data that is used by local
      variables. The other data is completely dropped.
      Signed-off-by: 's avatarAndreas Rheinhardt <andreas.rheinhardt@gmail.com>
      b6ebc5ae
    • Andreas Rheinhardt's avatar
      avformat/smacker: Create audio streams immediately · 33bc45e4
      Andreas Rheinhardt authored
      The Smacker demuxer currently parses several fields that indicate
      how many audio streams a file contains. This data is parsed and stored
      into arrays in the demuxer's context and although the data is used only
      to initialize the audio streams, it is kept for the whole lifetime of
      the demuxer.
      
      This has been changed: The data is used directly to create
      the audio streams and no longer kept at all.
      
      This also simplifies error handling in case adding a new stream fails:
      Several arrays which until now have been allocated between parsing the
      data determining how many audio streams to create and actually creating
      them would need to be freed in this case. Now the streams are created
      first, so freeing is no longer an issue.
      Signed-off-by: 's avatarAndreas Rheinhardt <andreas.rheinhardt@gmail.com>
      33bc45e4
    • Andreas Rheinhardt's avatar
      avformat/smacker: Read extradata directly into extradata · 7885c735
      Andreas Rheinhardt authored
      The Smacker demuxer reads four consecutive 32bit values from the file
      header into its demux context (as four uint32_t), converting it to
      native endianness in the process and then writing these four values
      later (after extradata has been allocated) to extradata as four 32bit
      values (converting to little endian in the process).
      
      This commit changes this: The stream and the extradata are allocated
      earlier, so that the data destined for extradata can be read directly
      into extradata.
      
      Furthermore, given that these values are not needed for demuxing itself
      they are now no longer kept as part of the demuxing context.
      
      Finally, a check regarding the number of frames has been moved up,
      too, in order to exit early before unnecessarily allocating the
      stream and the extradata.
      Signed-off-by: 's avatarAndreas Rheinhardt <andreas.rheinhardt@gmail.com>
      7885c735
  2. 07 Apr, 2020 15 commits
  3. 06 Apr, 2020 2 commits
  4. 05 Apr, 2020 9 commits
  5. 04 Apr, 2020 6 commits