Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Wouldn't expect a merge, but the idea is cool and wanted to discuss.
One of the issues I ran into when doing something similar with python and flask (using ffmpeg to transcode video to chrome) was that once you seek to an offset, from the web browsers perspective THAT is the new "00:00:00.000" starting point.
ffmpeg doesn't send the timecodes with the actual video's timecodes in mind, it sends from the perspective of the start time (the -ss time).
The flask code here:
Very similar place we both got it.
On the web side of things it became important to make your own progress bar instead of using the built in html5 progress bar.
video tag (forgive the angular1):
One would then need to dynamically set the source for that video and "play it"
Simple enough, but once you seek it gets all wierd.
I did it with a dumb interval thing in angular1
One would have to bootstrap the total timecode for a video that is about to be transcoded I did that with a separate endpoint but really it could come in the headers or the vha2 file itself.
`
@app.route('/duration/path:filename')
def transcode_duration(filename):
cmdline= list()
cmdline.append("/usr/bin/ffmpeg")
cmdline.append("-i")
cmdline.append("/" + filename);
duration= -1
FNULL = open(os.devnull, 'w')
proc= subprocess.Popen( cmdline, stderr=subprocess.PIPE, stdout=FNULL )
try:
for line in iter(proc.stderr.readline,''):
line= line.rstrip()
#Duration: 00:00:45.13, start: 0.000000, bitrate: 302 kb/s
m = re.search('Duration: (..):(..):(..)...', line)
if m is not None: duration= int(m.group(1)) * 3600 + int(m.group(2)) * 60 + int(m.group(3)) + 1
finally:
proc.kill()
`