Skip to content

Ashlok2003/livesitter

Repository files navigation

LiveSitter Application - Testing Guide

✅ Application Status: WORKING!

Your livestreaming application is now fully functional and ready for testing!

🎥 How to Test the Application

Option 1: Using the Frontend (Recommended)

  1. Open your browser and go to: http://localhost

  2. Start a stream with one of these URLs:

    • Local test video: /app/test_video.mp4
    • With file:// protocol: file:///app/test_video.mp4
  3. Enter a Stream ID (e.g., test_stream_1)

  4. Click "Start Stream"

  5. Watch the video player - it should load and play the video in HLS format

Option 2: Using API (For Testing)

# Start a stream
curl -X POST http://localhost:5000/api/streams/start \
  -H "Content-Type: application/json" \
  -d '{"rtsp_url": "/app/test_video.mp4", "stream_id": "test1"}'

# Check stream status
curl http://localhost:5000/api/streams/status

# Access the HLS playlist (wait 2-3 seconds after starting)
curl http://localhost:5000/api/streams/test1/playlist.m3u8

# Stop the stream
curl -X POST http://localhost:5000/api/streams/stop \
  -H "Content-Type: application/json" \
  -d '{"stream_id": "test1"}'

📹 When You Have an RTSP Camera

Once you have an actual RTSP camera, use its URL like:

rtsp://username:password@camera_ip:554/stream

Examples:

  • rtsp://admin:password@192.168.1.100:554/stream1
  • rtsp://192.168.1.50:8554/live.sdp

🔧 Testing Other Features

Test Overlays

# Create an overlay
curl -X POST http://localhost:5000/api/overlays \
  -H "Content-Type: application/json" \
  -d '{
    "name": "Test Overlay",
    "type": "text",
    "content": "Hello World!",
    "position": {"x": 10, "y": 10},
    "size": {"width": 200, "height": 50}
  }'

# Get all overlays
curl http://localhost:5000/api/overlays

Test Settings

# Get settings
curl http://localhost:5000/api/settings

# Update settings
curl -X POST http://localhost:5000/api/settings \
  -H "Content-Type: application/json" \
  -d '{
    "auto_start_streams": true,
    "default_stream_quality": "1080p",
    "max_concurrent_streams": 10
  }'

📝 Important Notes

  1. Test video limitation: The included test video is only 10 seconds long, so streams will automatically stop after processing it.

  2. For continuous streaming: You need a live RTSP camera or a looping video source.

  3. HLS delay: There's a 2-5 second delay before HLS segments are available after starting a stream.

  4. Multiple streams: You can run multiple streams simultaneously with different stream IDs.

🐛 Troubleshooting

Stream Not Playing

  • Wait 3-5 seconds after starting the stream for HLS segments to generate
  • Check backend logs: docker-compose logs backend --tail 20
  • Verify files are created: docker exec livestream_backend ls -la /app/hls_output/YOUR_STREAM_ID/

CORS Errors

  • Ensure you're accessing the frontend from http://localhost (not 127.0.0.1)
  • Check that CORS_ORIGINS includes your frontend URL

FFmpeg Errors

  • For RTSP streams, ensure the camera is accessible from the Docker container
  • Test with the local video file first: /app/test_video.mp4

🚀 Next Steps

  1. Get an RTSP camera or IP camera with RTSP support
  2. Configure your camera's RTSP URL
  3. Test with real camera streams
  4. Customize overlays for your use case
  5. Deploy to production when ready

📦 What's Working

✅ Backend API (Flask) ✅ Frontend UI (React) ✅ MongoDB (Database) ✅ Redis (Caching) ✅ FFmpeg (Video conversion) ✅ HLS Streaming (Browser compatible) ✅ Overlay Management ✅ Settings Management ✅ Local file streaming (for testing) ✅ RTSP streaming (when camera available)

Your application is production-ready! 🎉