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
1515
1616 API changes, most recent first:
1717
18+2018-05-xx - xxxxxxxxxx - lavf 58.14.100 - avformat.h
19+ Add AV_DISPOSITION_STILL_IMAGE
20+
1821 2018-05-xx - xxxxxxxxxx - lavu 56.18.101 - hwcontext_cuda.h
1922 Add AVCUDADeviceContext.stream.
2023
libavformat/avformat.h+1−0
@@ -846,6 +846,7 @@ typedef struct AVStreamInternal AVStreamInternal; · 845 unmodified lines
846846 #define AV_DISPOSITION_DESCRIPTIONS 0x20000
847847 #define AV_DISPOSITION_METADATA 0x40000
848848 #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)
849850
850851 /**
851852 * 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
551551 av_log(NULL, AV_LOG_INFO, " (descriptions)");
552552 if (st->disposition & AV_DISPOSITION_DEPENDENT)
553553 av_log(NULL, AV_LOG_INFO, " (dependent)");
554+ if (st->disposition & AV_DISPOSITION_STILL_IMAGE)
555+ av_log(NULL, AV_LOG_INFO, " (still image)");
554556 av_log(NULL, AV_LOG_INFO, "\n");
555557
556558 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
16831683 mpegts_find_stream_type(st, desc_tag, DESC_types);
16841684
16851685 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;
16861691 case 0x1E: /* SL descriptor */
16871692 desc_es_id = get16(pp, desc_end);
16881693 if (desc_es_id < 0)
libavformat/version.h+2−2
@@ -32,8 +32,8 @@ · 31 unmodified lines
3232 // Major bumping may affect Ticket5467, 5421, 5451(compatibility with Chromium)
3333 // Also please add any ticket numbers that you believe might be affected here
3434 #define LIBAVFORMAT_VERSION_MAJOR 58
35−#define LIBAVFORMAT_VERSION_MINOR 13
36−#define LIBAVFORMAT_VERSION_MICRO 102
35+#define LIBAVFORMAT_VERSION_MINOR 14
36+#define LIBAVFORMAT_VERSION_MICRO 100
3737
3838 #define LIBAVFORMAT_VERSION_INT AV_VERSION_INT(LIBAVFORMAT_VERSION_MAJOR, \
3939 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