History

avformat/mpegts: tag video streams with still images

Parses the video_stream_descriptor (H.222 2.6.2) to look for the still_picture_flag. This is exposed to the user via a new AV_DISPOSITION_STILL_IMAGE. See for example https://tmm1.s3.amazonaws.com/music-choice.ts, whose video stream only updates every ~6 seconds.

Aman Gupta committed 8 years ago

Commit 5dfeb7f1 parent 2734f8d5 files · +13 −2Browse files

Unified · Split

5 files
  1. doc/APIchanges +3 −0
  2. libavformat/avformat.h +1 −0
  3. libavformat/dump.c +2 −0
  4. libavformat/mpegts.c +5 −0
  5. libavformat/version.h +2 −2
doc/APIchanges+3−0
@@ -15,6 +15,9 @@ libavutil: 2017-10-21 · 14 unmodified lines
15 15
16API changes, most recent first:16API changes, most recent first:
17 17
182018-05-xx - xxxxxxxxxx - lavf 58.14.100 - avformat.h
19 Add AV_DISPOSITION_STILL_IMAGE
20
182018-05-xx - xxxxxxxxxx - lavu 56.18.101 - hwcontext_cuda.h212018-05-xx - xxxxxxxxxx - lavu 56.18.101 - hwcontext_cuda.h
19 Add AVCUDADeviceContext.stream.22 Add AVCUDADeviceContext.stream.
20 23
libavformat/avformat.h+1−0
@@ -846,6 +846,7 @@ typedef struct AVStreamInternal AVStreamInternal; · 845 unmodified lines
846#define AV_DISPOSITION_DESCRIPTIONS 0x20000846#define AV_DISPOSITION_DESCRIPTIONS 0x20000
847#define AV_DISPOSITION_METADATA 0x40000847#define AV_DISPOSITION_METADATA 0x40000
848#define AV_DISPOSITION_DEPENDENT 0x80000 ///< dependent audio stream (mix_type=0 in mpegts)848#define AV_DISPOSITION_DEPENDENT 0x80000 ///< dependent audio stream (mix_type=0 in mpegts)
849#define AV_DISPOSITION_STILL_IMAGE 0x100000 ///< still images in video stream (still_picture_flag=1 in mpegts)
849 850
850/**851/**
851 * Options for behavior on timestamp wrap detection.852 * Options for behavior on timestamp wrap detection.
libavformat/dump.c+2−0
@@ -551,6 +551,8 @@ static void dump_stream_format(AVFormatContext *ic, int i, · 550 unmodified lines
551 av_log(NULL, AV_LOG_INFO, " (descriptions)");551 av_log(NULL, AV_LOG_INFO, " (descriptions)");
552 if (st->disposition & AV_DISPOSITION_DEPENDENT)552 if (st->disposition & AV_DISPOSITION_DEPENDENT)
553 av_log(NULL, AV_LOG_INFO, " (dependent)");553 av_log(NULL, AV_LOG_INFO, " (dependent)");
554 if (st->disposition & AV_DISPOSITION_STILL_IMAGE)
555 av_log(NULL, AV_LOG_INFO, " (still image)");
554 av_log(NULL, AV_LOG_INFO, "\n");556 av_log(NULL, AV_LOG_INFO, "\n");
555 557
556 dump_metadata(NULL, st->metadata, " ");558 dump_metadata(NULL, st->metadata, " ");
libavformat/mpegts.c+5−0
@@ -1683,6 +1683,11 @@ int ff_parse_mpeg2_descriptor(AVFormatContext *fc, AVStream *st, int stream_type · 1682 unmodified lines
1683 mpegts_find_stream_type(st, desc_tag, DESC_types);1683 mpegts_find_stream_type(st, desc_tag, DESC_types);
1684 1684
1685 switch (desc_tag) {1685 switch (desc_tag) {
1686 case 0x02: /* video stream descriptor */
1687 if (get8(pp, desc_end) & 0x1) {
1688 st->disposition |= AV_DISPOSITION_STILL_IMAGE;
1689 }
1690 break;
1686 case 0x1E: /* SL descriptor */1691 case 0x1E: /* SL descriptor */
1687 desc_es_id = get16(pp, desc_end);1692 desc_es_id = get16(pp, desc_end);
1688 if (desc_es_id < 0)1693 if (desc_es_id < 0)
libavformat/version.h+2−2
@@ -32,8 +32,8 @@ · 31 unmodified lines
32// Major bumping may affect Ticket5467, 5421, 5451(compatibility with Chromium)32// Major bumping may affect Ticket5467, 5421, 5451(compatibility with Chromium)
33// Also please add any ticket numbers that you believe might be affected here33// Also please add any ticket numbers that you believe might be affected here
34#define LIBAVFORMAT_VERSION_MAJOR 5834#define LIBAVFORMAT_VERSION_MAJOR 58
35#define LIBAVFORMAT_VERSION_MINOR 1335#define LIBAVFORMAT_VERSION_MINOR 14
36#define LIBAVFORMAT_VERSION_MICRO 10236#define LIBAVFORMAT_VERSION_MICRO 100
37 37
38#define LIBAVFORMAT_VERSION_INT AV_VERSION_INT(LIBAVFORMAT_VERSION_MAJOR, \38#define LIBAVFORMAT_VERSION_INT AV_VERSION_INT(LIBAVFORMAT_VERSION_MAJOR, \
39 LIBAVFORMAT_VERSION_MINOR, \39 LIBAVFORMAT_VERSION_MINOR, \

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t