Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6597747
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T18:14:53+00:00 2026-05-25T18:14:53+00:00

I have a java servlet api, that when requested, starts a live conversion of

  • 0

I have a java servlet api, that when requested, starts a live conversion of a video file using ffmpeg and pipes it to mediastreamsegmenter to segment it for http live streaming. What I want is for the java servlet to return the url of the index file as soon as it has been generated (after the 4th transport stream file is written) so the user can start watching the video without waiting for it to fully finish converting.

How I was thinking of achieving this was to pass a command into the -file-complete-command argument of mediastreamsegmenter, and have it call some sort of a command that could tell the java servlet to return its response if the last file completed was the index file.

Another idea I had was to just segment the first 30 seconds or so of the video, and then return the response, and add the remainder of the video into some sort of a background task in the servlet. I’m not sure how this would be done though. Could I create a separate thread to do this conversion that will continue to run after the servlet returns? I’m sure there must be a better way of doing this. Any thoughts would be appreciated.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-25T18:14:53+00:00Added an answer on May 25, 2026 at 6:14 pm

    I’m not so much into video streaming but could you start a Thread (called PARSE_THREAD) that does the parsing and tell the servlet (living in SERVLET_THREAD) to wait for a reasonable amount of time? I would think that the ffmpeg conversion takes about the same amount of time to parse the first 30 seconds so you start the PARSE_THREAD, then sleep the SERVLET_THREAD for that time and then let the servlet start the streaming.

    Using a separate thread is a good solution for that problem.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm using Java Logging API in a simple Servlet application that uses Maven and
I have this java servlet that grabs information from a form, I need to
I have web application written in java using Eclipse. It has just one servlet
I'm writing a java servlet that calls a function in a jar. I have
I have a Java servlet which generates XML, translates it with an XSLT stylesheet,
I have a web app built on Java Servlet technology. I am thinking of
I have many years of experience in Java including Swing, Servlet and JDBC, but
I have inherited a Java application (servlets) that runs under Tomcat. For historical reasons,
I've done lots of java web development using jsps and servlets, and I have
I have a problem with Tomcat 5.5 and Java EE webapp libraries. I'm using

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.