diff --git a/gst/mpegtsmux/mpegtsmux.c b/gst/mpegtsmux/mpegtsmux.c
index 0ed2403..97a1426 100644
--- a/gst/mpegtsmux/mpegtsmux.c
+++ b/gst/mpegtsmux/mpegtsmux.c
@@ -884,8 +884,8 @@ new_packet_cb (guint8 * data, guint len, void *user_data, gint64 new_pcr)
             break;
           gst_buffer_set_caps (out_buf, GST_PAD_CAPS (mux->srcpad));
 
-          /*writing the 4  byte timestamp value */
-          GST_WRITE_UINT32_BE (GST_BUFFER_DATA (out_buf), m2ts_pcr);
+          /* writing 2 bit copy permission indicator and 30 bit timestamp value */
+          GST_WRITE_UINT32_BE (GST_BUFFER_DATA (out_buf), (m2ts_pcr & 0x3FFFFFFF));
 
           GST_LOG_OBJECT (mux, "Outputting a packet of length %d",
               M2TS_PACKET_LENGTH);
