#!/usr/bin/env python from scapy.all import rdpcap, wrpcap def process_packets(in_file_name, out_file_name, scale_factor): pkts = rdpcap(in_file_name) cooked=[] #timestamp = 1234567890.000000 base_timestamp = None for p in pkts: if not base_timestamp: base_timestamp = p.time delta_time = p.time - base_timestamp p.time = base_timestamp + (scale_factor * delta_time) pmod=p cooked.append(pmod) wrpcap(out_file_name, cooked) process_packets("sample.pcap", "modified.pcap", 12.0)