I have a segment of a webm file with an incomplete header, I want to cut this segment down to 10 seconds by trimming x seconds off the front of the file, however I am unable to use the -sseof tag because the end of the file isn't defined. I have discovered that if I ask ffmpeg to pull out the audio or video from the file it responds with some data long the lines of size= 212kB time=00:00:13.32 bitrate= 130.2kbits/s speed=1.79e+03x video:0kB audio:210kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 0.991311% Showing that there is 13.32 seconds of data in the file, however if I use ffprobe for the file length it replies with N/A. Is there a way to get that 13.32 value by itself without encoding the webm file?
Asked
Active
Viewed 1,170 times
2
Neil Hutcheon
- 21
- 2
1 Answers
2
Run
ffprobe -v 0 -hide_banner -of compact=p=0:nk=1 -show_entries packet=pts_time -read_intervals 99999%+#1000 input.webm | tail -1
Assuming the file isn't longer than 99999 seconds, this will print the timestamp of the last media packet in the file.
Gyan
- 34,439
- 6
- 56
- 98