1. 06 1月, 2017 1 次提交
  2. 05 1月, 2017 3 次提交
  3. 03 1月, 2017 1 次提交
    • B
      avformat/hlsenc: size and duration in segment filenames · 557c0df9
      Bela Bodecs 提交于
      1st:
      This patch makes it possible to put actual segment file size (measured
      in bytes) and/or duration (calculated in microseconds) into segment
      filenames. This feature is useful when post-processing live streaming
      access log files. New behaviour works only when -use_localtime option
      is set and second_level_segment_size or/and
      second_level_segment_duration new hls_flags are specified. %%s is the
      placeholder for size and %%t for duration in hls_segment_filename
      option. Fix sized trailing zeropadding also works eg. %%09s or %%023t.
      
      A command to test new features:
      ./ffmpeg -loglevel info -y -f lavfi -i color=c=red:size=640x480:r=25 -f
      lavfi -i sine=f=440:b=4:r=44100 -c:v mpeg2video -g 25 -acodec aac
      -cutoff 20000 -ac 2 -ar 44100 -ab 192k -f hls -hls_time 3 -hls_list_size
      5 -hls_flags
      second_level_segment_index+second_level_segment_size+second_level_segment_duration
      -use_localtime 1 -use_localtime_mkdir 1 -hls_segment_filename
      "segment_%Y%m%d%H%M%S_%%04d_%%08s_%%013t.ts" stream.m3u8
      
      2nd:
      doc/muxers: beside second_level_segment_duration and second_level_segment_size,
      added some more details and example to hls_segment_filename,
      use_localtime, use_localtime_mkdir, hls_flags. hls_flags option list
      reformatted to table
      Signed-off-by: NBela Bodecs <bodecsb@vivanet.hu>
      Signed-off-by: NSteven Liu <lq@chinaffmpeg.org>
      557c0df9
  4. 01 1月, 2017 2 次提交
  5. 29 12月, 2016 1 次提交
  6. 27 12月, 2016 2 次提交
    • B
      avformat/hlsenc: strftime identifiers and segment index · 0ff8c6b6
      Bodecs Bela 提交于
       in filenames
      
      Putting date/time values into segment filenames is very usefull.
      But to produce non-conflicting segment filenames with -use_localtime
      option with date/time
      values in hls_segment_filename option, sometimes is not enough.
      Like in cases when multiple segments produced in the same second.
      But hlsenc currently does not make possible to use segment index (%d) at
      the
      
      same time whe use_localtime is in effect, due to identifier conflict.
      This patch makes possible to use strftime identifiers and still put
      segment index (%d) at same time in segment filenames by introducing
      second_level_segment_index flag. When -use_localtime is active,
      identifier %d is for month day index, so %%d is the segment index
      placeholder. This enhanced behaviour only exists when new
      second_level_segment_index flag is specified.
      For instance putting 'segment_%Y%m%d%H%M%S_%%05d.ts' value into
      -hls_segment_filename option and specifing -hls_flags
      second_level_segment_index and -use_localtime 1, may produce segment
      filename as 'segment_20161230235758_00002.ts'
      
      An example:
      
      ffmpeg -loglevel info -y -f lavfi -i color=c=red:size=640x480:r=25 -f
      lavfi -i anullsrc=r=44100:cl=stereo -c:v mpeg2video -g 25 -acodec aac
      -cutoff 20000 -ac 2 -ar 44100 -ab 192k -f hls -hls_time 3 -hls_list_size
      5 -hls_flags delete_segments+second_level_segment_index -use_localtime 1
      -hls_segment_filename "segment_%Y%m%d%H%M%S_%%05d.ts" stream.m3u8
      
      will produce segments filenames:
      
      ....
      segment_20161227005902_00013.ts
      segment_20161227005902_00014.ts
      segment_20161227005902_00015.ts
      segment_20161227005903_00016.ts
      segment_20161227005903_00017.ts
      segment_20161227005903_00018.ts
      segment_20161227005903_00019.ts
      segment_20161227005903_00020.ts
      ....
      Signed-off-by: NBela Bodecs <bodecsb@vivanet.hu>
      0ff8c6b6
    • J
      Fix bug when incrementing initial_prog_date_time when removing segments · c7c0046e
      Jesper Ek 提交于
      initial_prog_date_time shouldn't be adjusted when deleting segments
      from disk, but rather when segments are removed from the playlist.
      Signed-off-by: NJesper Ek <deadbeef84@gmail.com>
      Signed-off-by: NSteven Liu <lq@chinaffmpeg.org>
      c7c0046e
  7. 26 12月, 2016 1 次提交
  8. 07 12月, 2016 1 次提交
    • S
      avformat/hlsenc: save the EXT-X-DISCONTINUITY from old list · 6b95da9a
      Steven Liu 提交于
      when use fix ticket 2nd problem.
      
      command line test step:
      rm -rf output*;./ffmpeg  -i ~/Movies/objectC/facebook.mp4 -an -c:v copy
      -f hls -hls_time 4 -hls_list_size 5 -hls_flags +delete_segments
      -hls_flags +append_list -hls_flags +omit_endlist -hls_flags
      +discont_start -t 50 output.m3u8
      ./ffmpeg -i ~/Movies/objectC/facebook.mp4 -an -c:v libx264 -g 4 -f hls
      -hls_time 4 -hls_list_size 5 -hls_flags +delete_segments -hls_flags
      +append_list -hls_flags +omit_endlist -hls_flags +discont_start -t 5
      output.m3u8
      ./ffmpeg -i ~/Movies/objectC/facebook.mp4 -an -c:v libx264 -g 4 -f hls
      -hls_time 4 -hls_list_size 5 -hls_flags +delete_segments -hls_flags
      +append_list -hls_flags +omit_endlist -hls_flags +discont_start -t 5
      output.m3u8
      
      result:
       #EXTM3U
       #EXT-X-VERSION:3
       #EXT-X-TARGETDURATION:5
       #EXT-X-MEDIA-SEQUENCE:6
       #EXTINF:4.120000,
       output6.ts
       #EXT-X-DISCONTINUITY
       #EXTINF:4.000000,
       output7.ts
       #EXTINF:0.960000,
       output8.ts
       #EXT-X-DISCONTINUITY
       #EXTINF:4.000000,
       output9.ts
       #EXTINF:0.960000,
       output10.ts
      Signed-off-by: NSteven Liu <lq@chinaffmpeg.org>
      6b95da9a
  9. 05 12月, 2016 1 次提交
  10. 12 11月, 2016 1 次提交
  11. 02 11月, 2016 2 次提交
  12. 10 10月, 2016 1 次提交
  13. 04 10月, 2016 1 次提交
    • liuqi_123's avatar
      avformat/hlsenc: support multi level path in m3u8 with filename · be1d3249
      liuqi_123 提交于
      before patch:
      
      localhost:osx liuqi$ tree 20160926/
      20160926/
      └── file-20160909
          └── 26
              └── 16
                  └── 15
                      ├── 46
                      │   ├── 13.ts
                      │   ├── 25.ts
                      │   ├── 36.ts
                      │   ├── 45.ts
                      │   └── 54.ts
                      └── 47
                          ├── 04.ts
                          ├── 14.ts
                          ├── 24.ts
                          └── 35.ts
      
      6 directories, 9 files
      localhost:osx liuqi$ cat out.m3u8
       #EXTM3U
       #EXT-X-VERSION:3
       #EXT-X-TARGETDURATION:12
       #EXT-X-MEDIA-SEQUENCE:0
       #EXTINF:11.360000,
       13.ts
       #EXTINF:10.800000,
       25.ts
       #EXTINF:9.120000,
       36.ts
       #EXTINF:8.760000,
       45.ts
       #EXTINF:10.200000,
       54.ts
       #EXTINF:10.720000,
       04.ts
       #EXTINF:9.600000,
       14.ts
       #EXTINF:10.600000,
       24.ts
       #EXTINF:8.760000,
       35.ts
       #EXT-X-ENDLIST
      
      after patch:
      
      localhost:osx liuqi$ tree 20160926/
      20160926/
      └── file-20160909
          └── 26
              └── 16
                  └── 15
                      ├── 46
                      │   ├── 13.ts
                      │   ├── 25.ts
                      │   ├── 36.ts
                      │   ├── 45.ts
                      │   └── 54.ts
                      └── 47
                          ├── 04.ts
                          ├── 14.ts
                          ├── 24.ts
                          └── 35.ts
      
      6 directories, 9 files
      localhost:osx liuqi$ cat out.m3u8
       #EXTM3U
       #EXT-X-VERSION:3
       #EXT-X-TARGETDURATION:12
       #EXT-X-MEDIA-SEQUENCE:0
       #EXTINF:11.360000,
       20160926/file-20160909/26/16/15/46/13.ts
       #EXTINF:10.800000,
       20160926/file-20160909/26/16/15/46/25.ts
       #EXTINF:9.120000,
       20160926/file-20160909/26/16/15/46/36.ts
       #EXTINF:8.760000,
       20160926/file-20160909/26/16/15/46/45.ts
       #EXTINF:10.200000,
       20160926/file-20160909/26/16/15/46/54.ts
       #EXTINF:10.720000,
       20160926/file-20160909/26/16/15/47/04.ts
       #EXTINF:9.600000,
       20160926/file-20160909/26/16/15/47/14.ts
       #EXTINF:10.600000,
       20160926/file-20160909/26/16/15/47/24.ts
       #EXTINF:8.760000,
       20160926/file-20160909/26/16/15/47/35.ts
       #EXT-X-ENDLIST
      Signed-off-by: liuqi_123's avatarSteven Liu <lingjiujianke@gmail.com>
      be1d3249
  14. 01 10月, 2016 1 次提交
  15. 24 9月, 2016 1 次提交
    • liuqi_123's avatar
      avformat/hlsenc: refine EXT-X-BYTERANGE support for segments · 1212e346
      liuqi_123 提交于
      refine EXT-X-BYTERANGE tag,
      the spec link:
      https://tools.ietf.org/html/draft-pantos-http-live-streaming-19#section-4.3.2.2
      the apple doc:
      https://developer.apple.com/library/ios/technotes/tn2288/_index.html#
      //apple_ref/doc/uid/DTS40012238-CH1-BYTE_RANGE_SUPPORT_FOR_SEGMENTS
      
      command line:
      ./ffmpeg -i ~/Movies/objectC/a.mp4 -c copy -f hls -hls_time 7
       -hls_list_size 0 -hls_segment_size 2500000 -t 40 output-test.m3u8
      output:
      localhost:ffmpeg liuqi$ ll *.ts ;cat output-test.m3u8
       -rw-r--r--  1 liuqi  staff  2792176  9 12 14:44 output-test0.ts
       -rw-r--r--  1 liuqi  staff  3112528  9 12 14:44 output-test3.ts
       -rw-r--r--  1 liuqi  staff  3377420  9 12 14:44 output-test6.ts
       -rw-r--r--  1 liuqi  staff  1228016  9 12 14:44 output-test7.ts
       #EXTM3U
       #EXT-X-VERSION:4
       #EXT-X-TARGETDURATION:10
       #EXT-X-MEDIA-SEQUENCE:0
       #EXTINF:9.021000,
       #EXT-X-BYTERANGE:1334988@0
       output-test0.ts
       #EXTINF:3.000000,
       #EXT-X-BYTERANGE:721356@1334988
       output-test0.ts
       #EXTINF:3.000000,
       #EXT-X-BYTERANGE:735832@2056344
       output-test0.ts
       #EXTINF:6.000000,
       #EXT-X-BYTERANGE:1645940@0
       output-test3.ts
       #EXTINF:3.000000,
       #EXT-X-BYTERANGE:715152@1645940
       output-test3.ts
       #EXTINF:3.000000,
       #EXT-X-BYTERANGE:751436@2361092
       output-test3.ts
       #EXTINF:9.000000,
       #EXT-X-BYTERANGE:3377420@0
       output-test6.ts
       #EXTINF:3.960000,
       #EXT-X-BYTERANGE:1228016@0
       output-test7.ts
       #EXT-X-ENDLIST
       localhost:ffmpeg liuqi$
      
       ticket-id: #5839
      Signed-off-by: liuqi_123's avatarSteven Liu <lingjiujianke@gmail.com>
      Signed-off-by: NMichael Niedermayer <michael@niedermayer.cc>
      1212e346
  16. 15 9月, 2016 1 次提交
  17. 14 9月, 2016 2 次提交
  18. 08 9月, 2016 1 次提交
  19. 05 9月, 2016 1 次提交
  20. 31 8月, 2016 1 次提交
  21. 29 8月, 2016 1 次提交
  22. 21 8月, 2016 1 次提交
  23. 05 8月, 2016 1 次提交
  24. 11 7月, 2016 1 次提交
  25. 13 3月, 2016 1 次提交
  26. 11 3月, 2016 1 次提交
  27. 24 2月, 2016 1 次提交
    • A
      lavf: replace AVStream.codec with AVStream.codecpar · 9200514a
      Anton Khirnov 提交于
      Currently, AVStream contains an embedded AVCodecContext instance, which
      is used by demuxers to export stream parameters to the caller and by
      muxers to receive stream parameters from the caller. It is also used
      internally as the codec context that is passed to parsers.
      
      In addition, it is also widely used by the callers as the decoding (when
      demuxer) or encoding (when muxing) context, though this has been
      officially discouraged since Libav 11.
      
      There are multiple important problems with this approach:
          - the fields in AVCodecContext are in general one of
              * stream parameters
              * codec options
              * codec state
            However, it's not clear which ones are which. It is consequently
            unclear which fields are a demuxer allowed to set or a muxer allowed to
            read. This leads to erratic behaviour depending on whether decoding or
            encoding is being performed or not (and whether it uses the AVStream
            embedded codec context).
          - various synchronization issues arising from the fact that the same
            context is used by several different APIs (muxers/demuxers,
            parsers, bitstream filters and encoders/decoders) simultaneously, with
            there being no clear rules for who can modify what and the different
            processes being typically delayed with respect to each other.
          - avformat_find_stream_info() making it necessary to support opening
            and closing a single codec context multiple times, thus
            complicating the semantics of freeing various allocated objects in the
            codec context.
      
      Those problems are resolved by replacing the AVStream embedded codec
      context with a newly added AVCodecParameters instance, which stores only
      the stream parameters exported by the demuxers or read by the muxers.
      9200514a
  28. 17 2月, 2016 1 次提交
  29. 11 2月, 2016 1 次提交
  30. 02 2月, 2016 1 次提交
  31. 24 1月, 2016 1 次提交
    • A
      lavf: allow custom IO for all files · 9f61abc8
      Anton Khirnov 提交于
      Some (de)muxers open additional files beyond the main IO context.
      Currently, they call avio_open() directly, which prevents the caller
      from using custom IO for such streams.
      
      This commit adds callbacks to AVFormatContext that default to
      avio_open2()/avio_close(), but can be overridden by the caller. All
      muxers and demuxers using AVIO are switched to using those callbacks
      instead of calling avio_open()/avio_close() directly.
      
      (de)muxers that use the URLProtocol layer directly instead of AVIO
      remain unconverted for now. This should be fixed in later commits.
      9f61abc8
  32. 20 12月, 2015 1 次提交
  33. 13 12月, 2015 1 次提交
  34. 04 12月, 2015 1 次提交