diff --git a/doc/APIchanges b/doc/APIchanges
index 6ba3de5c582881c7872330a85f2c09cdcf6d4a10..45b38ee24ce909bda9b9fb02386825f69774a94b 100644
--- a/doc/APIchanges
+++ b/doc/APIchanges
@@ -15,6 +15,10 @@ libavutil:     2012-10-22
 
 API changes, most recent first:
 
+2014-08-04 - xxxxxxx - lavc 55.72.101 - avcodec.h
+2014-08-04 - xxxxxxx - lavu 52.95.100 - frame.h
+  Deprecate AVCodecContext.dtg_active_format and use side-data instead
+
 2014-08-03 - xxxxxxx - lavc 55.72.100 - avcodec.h
   Add get_pixels() to AVDCT
 
diff --git a/libavcodec/avcodec.h b/libavcodec/avcodec.h
index 6ef9da40df1e981b581c186d3d9d70241825a860..8ba58516b4129f52005a0738779b85df80080b2f 100644
--- a/libavcodec/avcodec.h
+++ b/libavcodec/avcodec.h
@@ -1690,6 +1690,7 @@ typedef struct AVCodecContext {
      */
     int me_subpel_quality;
 
+#if FF_API_AFD
     /**
      * DTG active format information (additional aspect ratio
      * information only used in DVB MPEG-2 transport streams)
@@ -1697,8 +1698,9 @@ typedef struct AVCodecContext {
      *
      * - encoding: unused
      * - decoding: Set by decoder.
+     * @deprecated Deprecated in favour of AVSideData
      */
-    int dtg_active_format;
+    attribute_deprecated int dtg_active_format;
 #define FF_DTG_AFD_SAME         8
 #define FF_DTG_AFD_4_3          9
 #define FF_DTG_AFD_16_9         10
@@ -1706,6 +1708,7 @@ typedef struct AVCodecContext {
 #define FF_DTG_AFD_4_3_SP_14_9  13
 #define FF_DTG_AFD_16_9_SP_14_9 14
 #define FF_DTG_AFD_SP_4_3       15
+#endif
 
     /**
      * maximum motion estimation search range in subpel units
diff --git a/libavcodec/mpeg12dec.c b/libavcodec/mpeg12dec.c
index 25e281dbc3367d3768be20bd4f945b31c27dcdf9..f4582ef1ec8e9517275ca971fc2734cee312c8d2 100644
--- a/libavcodec/mpeg12dec.c
+++ b/libavcodec/mpeg12dec.c
@@ -56,6 +56,8 @@ typedef struct Mpeg1Context {
     int has_stereo3d;
     uint8_t *a53_caption;
     int a53_caption_size;
+    uint8_t afd;
+    int has_afd;
     int slice_count;
     int save_aspect_info;
     int save_width, save_height, save_progressive_seq;
@@ -1659,6 +1661,18 @@ static int mpeg_field_start(MpegEncContext *s, const uint8_t *buf, int buf_size)
             *stereo = s1->stereo3d;
             s1->has_stereo3d = 0;
         }
+
+        if (s1->has_afd) {
+            AVFrameSideData *sd = av_frame_new_side_data(
+                s->current_picture_ptr->f, AV_FRAME_DATA_AFD,
+                1);
+            if (!sd)
+                return AVERROR(ENOMEM);
+
+            *sd->data = s1->afd;
+            s1->has_afd = 0;
+        }
+
         if (HAVE_THREADS && (avctx->active_thread_type & FF_THREAD_FRAME))
             ff_thread_finish_setup(avctx);
     } else { // second field
@@ -2264,6 +2278,7 @@ static void mpeg_decode_user_data(AVCodecContext *avctx,
 {
     Mpeg1Context *s = avctx->priv_data;
     const uint8_t *buf_end = p + buf_size;
+    Mpeg1Context *s1   = avctx->priv_data;
 
     if (buf_size > 29){
         int i;
@@ -2290,7 +2305,11 @@ static void mpeg_decode_user_data(AVCodecContext *avctx,
         if (flags & 0x40) {
             if (buf_end - p < 1)
                 return;
+#if FF_API_AFD
             avctx->dtg_active_format = p[0] & 0x0f;
+#endif
+            s1->has_afd = 1;
+            s1->afd = p[0] & 0x0f;
         }
     } else if (buf_end - p >= 6 &&
                p[0] == 'J' && p[1] == 'P' && p[2] == '3' && p[3] == 'D' &&
@@ -2302,7 +2321,6 @@ static void mpeg_decode_user_data(AVCodecContext *avctx,
             S3D_video_format_type == 0x04 ||
             S3D_video_format_type == 0x08 ||
             S3D_video_format_type == 0x23) {
-            Mpeg1Context *s1   = avctx->priv_data;
 
             s1->has_stereo3d = 1;
 
diff --git a/libavcodec/version.h b/libavcodec/version.h
index 7a7a2e9b217b2920f5cbab1e1411411ec686b0bc..dc7af8bc6596048bc7d000749f7e0955efea55b9 100644
--- a/libavcodec/version.h
+++ b/libavcodec/version.h
@@ -30,7 +30,7 @@
 
 #define LIBAVCODEC_VERSION_MAJOR 55
 #define LIBAVCODEC_VERSION_MINOR  72
-#define LIBAVCODEC_VERSION_MICRO 100
+#define LIBAVCODEC_VERSION_MICRO 101
 
 #define LIBAVCODEC_VERSION_INT  AV_VERSION_INT(LIBAVCODEC_VERSION_MAJOR, \
                                                LIBAVCODEC_VERSION_MINOR, \
@@ -168,5 +168,8 @@
 #ifndef FF_API_CODEC_NAME
 #define FF_API_CODEC_NAME        (LIBAVCODEC_VERSION_MAJOR < 57)
 #endif
+#ifndef FF_API_AFD
+#define FF_API_AFD               (LIBAVCODEC_VERSION_MAJOR < 57)
+#endif
 
 #endif /* AVCODEC_VERSION_H */
diff --git a/libavfilter/vf_showinfo.c b/libavfilter/vf_showinfo.c
index 323cf776204ae9e7188c6241962872c3d4e67abc..ae2c7af92ed2a30fb4b84e3650e35881e578084a 100644
--- a/libavfilter/vf_showinfo.c
+++ b/libavfilter/vf_showinfo.c
@@ -147,6 +147,9 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *frame)
             av_log(ctx, AV_LOG_INFO, "displaymatrix: rotation of %.2f degrees",
                    av_display_rotation_get((int32_t *)sd->data));
             break;
+        case AV_FRAME_DATA_AFD:
+            av_log(ctx, AV_LOG_INFO, "afd: value of %u", sd->data[0]);
+            break;
         default:
             av_log(ctx, AV_LOG_WARNING, "unknown side data type %d (%d bytes)",
                    sd->type, sd->size);
diff --git a/libavutil/frame.h b/libavutil/frame.h
index c57eb552e2ec9090fc5b6d3a07b550b52795d0f9..ca76c6e19f01333a562d17f64bbf3ae482474bb2 100644
--- a/libavutil/frame.h
+++ b/libavutil/frame.h
@@ -82,6 +82,22 @@ enum AVFrameSideDataType {
      * See libavutil/display.h for a detailed description of the data.
      */
     AV_FRAME_DATA_DISPLAYMATRIX,
+    /**
+     * Active Format Description data consisting of a single byte as specified in ETSI TS 101 154
+     * using AVActiveFormatDescription enum
+     */
+    AV_FRAME_DATA_AFD,
+};
+
+enum AVActiveFormatDescription
+{
+    AV_AFD_SAME = 8,
+    AV_AFD_4_3  = 9,
+    AV_AFD_16_9 = 10,
+    AV_AFD_14_9 = 11,
+    AV_AFD_4_3_SP_14_9  = 13,
+    AV_AFD_16_9_SP_14_9 = 14,
+    AV_AFD_SP_4_3       = 15
 };
 
 typedef struct AVFrameSideData {
diff --git a/libavutil/version.h b/libavutil/version.h
index 42e2db51d4daff0972494a14ab3d20793b1a899e..9af8f5fb77b15f8d429c807f9d49bcf7e8571b1d 100644
--- a/libavutil/version.h
+++ b/libavutil/version.h
@@ -56,7 +56,7 @@
  */
 
 #define LIBAVUTIL_VERSION_MAJOR  52
-#define LIBAVUTIL_VERSION_MINOR  94
+#define LIBAVUTIL_VERSION_MINOR  95
 #define LIBAVUTIL_VERSION_MICRO 100
 
 #define LIBAVUTIL_VERSION_INT   AV_VERSION_INT(LIBAVUTIL_VERSION_MAJOR, \