[FFmpeg-user] help time shifting frame time stamps for generated mpegts files

Mark Essel messel at gmail.com
Thu Mar 14 20:43:26 CET 2013


I've tried to edit the time stamps directly with ffmpeg setpts filter

  ffmpeg -i s100k_seg2_orig.ts -filter:v 'setpts=120+PTS' -f mpegts output.ts

but the output file times are always 1.4s to segment file duration+1.4s

if I convert the file to avi format, then apply the filter it works as
expected. I can then convert this avi file back into mpegts format but
it has it's times reset to 1.4s to segment file duration + time shift

the goal is to generate mpegts files on various servers and then load
them into a VOD m3u8 container. With only relative time stamps stream
playback has many issues (more over 3g). If instead all the files are
merged together into one large video and then segmented into mpegts
the time stamps are all contiguous and playback is smooth

---

As an alternate route I'm attempting to edit an old segment.c example
program I came across online. I've got it to compile by updating the
api calls, but it's seg faulting at the point where it tries to write
the new output format context header. My hopes with the c code is to
manually specify pts and dts times

pkt_pts_time=ShiftTime
pkt_dts_time=ShiftTime
pkt_duration_time=1 / fps

pkt_pts_time=ShiftTime + dT
pkt_dts_time=ShiftTime + dT
pkt_duration_time=1 / fps

...

Any help is appreciated.


ref:
http://stackoverflow.com/questions/9598973/ffmpeg-transcoding-reset-the-start-time-of-file


More information about the ffmpeg-user mailing list