This project is a Django-based web application that allows users to upload videos and automatically extracts subtitles in the background. Users can search the subtitles and jump to specific timestamps in the video based on the search results.
- Video Upload: Users can upload video files having subtitles (.mp4,.mkv).
- Subtitle Extraction: Subtitles are automatically extracted in the background after video uploads, subtitles are extracted using ffmpeg.
- Search Subtitles: Users can search for words, phrases within subtitles and jump to the timestamp in the video.
- Django Backend: Django framework are used in this assessment.
- PostgreSQL Support (optional): You can configure the application to use PostgreSQL for storing subtitle data.
- Python 3.x
- Django
- PostgreSQL (optional for advanced database setup)
-
Clone the Repository
git clone https://github.com/Huzaifa-Antule/Fatmug-Assessment.git cd Fatmug-Assessment
-
Set Up Virtual Environment
python -m venv venv source venv/bin/activate # On Windows use: venv\Scripts\activate
-
Install Dependencies
Install the required Python dependencies using
pip
:pip install -r requirements.txt
-
Database Setup (Optional)
By default, the project uses SQLite, but you can configure it to use PostgreSQL if needed. To configure PostgreSQL, update your
DATABASES
setting insettings.py
: PostgreSQLDATABASES = { 'default': { 'ENGINE': 'django.db.backends.postgresql', 'NAME': 'Fatmug', 'USER': 'postgres', 'PASSWORD': '123', 'HOST': 'localhost', 'PORT': '5432', } }
Django's Default
DATABASES = { 'default': { 'ENGINE': 'django.db.backends.sqlite3', 'NAME': BASE_DIR / 'db.sqlite3', } }
Ensure PostgreSQL is running and accessible with the provided credentials.
-
Run Migrations (Optional)
If you have updated the database to PostgreSQL or made changes to the models, you can run migrations:
python manage.py makemigrations
python manage.py migrate
For SQLite (default setup), migrations will already be included.
-
Create a Superuser
To manage the application through Django’s admin interface, create a superuser:
python manage.py createsuperuser
-
Run the Development Server
Finally, start the development server:
python manage.py runserver
Open your browser and navigate to
http://127.0.0.1:8000
orhttp://localhost:8000
to access the application.
If you prefer to use Docker for containerizing the application, follow these steps.
-
Build and Run Containers
docker-compose up --build
-
Access the Application
- Django Application:
http://localhost:8000
- PostgreSQL: Accessible at
localhost:5432
with the credentials indocker-compose.yml
.
- Django Application:
- Uploading Videos: you can upload videos via the web interface. The application will extract subtitles from the video automatically.
- Search Subtitles: You can search within the subtitles and navigate to the specific timestamp in the video by clicking on the search result.
This project is licensed under the MIT License - see the MIT file for details.
- Fork the repository.
- Create your feature branch:
git checkout -b feature/my-feature
- Commit your changes:
git commit -am 'Add my feature'
- Push to the branch:
git push origin feature/my-feature
- Submit a pull request.
- Large videos can decrease the performance of the application.
- some .mkv or other files create issue for jumping on timestamps and skipping issue.
- Subtitles are stored in media folder, hard to retrieve from PostgreSQLdatabase.