Skip to content

How to Update your AVideo Platform

Daniel Neto edited this page Jan 14, 2025 · 15 revisions

Updating AVideo: Streamer and Encoder

To maintain optimal performance and security, it is crucial to keep the Streamer and Encoder components of AVideo up-to-date. Here are detailed instructions for updating your AVideo installation using the most reliable methods.

1. Using Git Pull (Recommended)

Why Git Pull is the Best Method

  • Safety and Consistency: Git pull ensures that your local files are synchronized with the latest version from the repository, avoiding conflicts that often arise with manual file transfers.
  • Efficiency: Updates through Git are handled automatically, reducing the likelihood of errors and saving time.
  • Transparency: Git provides clear records of changes, allowing easy tracking and management of updates.

How to Update Using Git

Update the Streamer

To update the Streamer, navigate to its directory and execute the following commands:

cd /var/www/html/AVideo/
sudo git pull

Update the Encoder

For the Encoder, use the same approach:

cd /var/www/html/AVideo/Encoder
sudo git pull

Resolving Update Conflicts

If you encounter errors during the git pull, you can reset your local copy to match the repository exactly:

sudo git fetch --all
sudo git reset --hard origin/master

Resolving Specific Git Conflict: WebRTC2RTMP Permission Issue

If you encounter an issue like the one below:

root@ns5146:/var/www/html/AVideo# git pull
remote: Enumerating objects: 144, done.
remote: Counting objects: 100% (16/16), done.
remote: Compressing objects: 100% (13/13), done.
remote: Total 144 (delta 3), reused 3 (delta 3), pack-reused 128 (from 3)
Receiving objects: 100% (144/144), 39.15 MiB | 38.00 MiB/s, done.
Resolving deltas: 100% (80/80), completed with 1 local object.
From https://github.com/WWBN/AVideo
   fb70c2730d..6d0daad7b2  master     -> origin/master
Updating fb70c2730d..6d0daad7b2
error: Your local changes to the following files would be overwritten by merge:
        plugin/WebRTC/WebRTC2RTMP
Please commit your changes or stash them before you merge.
Aborting

The issue occurs because the WebRTC2RTMP file has changed permissions or has been modified locally. Resolve it as follows:

cd /var/www/html/AVideo/plugin/WebRTC
pkill WebRTC2RTMP
sudo git fetch --all
sudo git reset --hard origin/master
chmod  x WebRTC2RTMP
./WebRTC2RTMP

Explanation of Commands:

  1. cd /var/www/html/AVideo/plugin/WebRTC:

    • Navigates to the WebRTC plugin directory where the WebRTC2RTMP file is located.
  2. pkill WebRTC2RTMP:

    • Terminates any running instance of WebRTC2RTMP to ensure it is not in use during the update process.
  3. sudo git fetch --all:

    • Retrieves the latest changes from the remote repository without altering local files yet.
  4. sudo git reset --hard origin/master:

    • Resets the local files to exactly match the remote repository, discarding any local changes, including the permission changes.
  5. chmod x WebRTC2RTMP:

    • Ensures that the WebRTC2RTMP file has execute permissions, which might be required after the reset.
  6. ./WebRTC2RTMP:

    • Runs the WebRTC2RTMP script to verify it works correctly after the update.

Important: Update the Database

Don’t forget to update the database after updating the software. Go to AVideo menu -> Update version and run the script update for each version sequentially.

2. Manual Download and Upload (Not Recommended)

While it is possible to manually download and upload files to update AVideo, this method is not recommended due to several potential issues:

  • Risk of Errors: Manual updates are prone to mistakes such as incorrectly copying files, which can disrupt your system.
  • Time Consuming: This process requires more time and effort compared to automated methods.
  • Potential Conflicts: Manually replacing files can lead to conflicts and inconsistencies, especially if some files are missed or improperly overwritten.

If you must update manually, ensure you handle files carefully and backup your current installation before proceeding:

  1. Download: Obtain the latest version from GitHub: Download AVideo
  2. Upload: Use an FTP or SSH method to upload and replace files on your server.

3. Update Plugins

Regularly check and update any plugins you are using with AVideo.

Check for Plugin Updates

Access the plugin management section within AVideo to see if updates are necessary:

  • Download the latest versions from the AVideo Marketplace.
  • Follow the instructions to install or update the plugins.

Run Plugin Tables

Always execute the install tables for plugins, even for those not currently active, to ensure compatibility and readiness.

Rollback Options

If an update causes issues, consider these rollback options:

Option 1: Adjust the Database Version

Directly modify the version in your database to allow re-running update scripts:

mysql -u root -p youPHPTube
UPDATE configurations SET version = '6.5' WHERE id = 1;

Option 2: Manually Run Update Scripts

Navigate to the update directory and execute the required SQL script:

cd /var/www/html/AVideo/updatedb/
mysql -u root -p youPHPTube < updateDb.v6.5.sql

Conclusion

For maintaining your AVideo installation, using Git for updates is highly recommended over manual methods to ensure a stable, secure, and efficient update process. Always keep your database updated following software updates and manage plugins carefully to maintain system integrity and functionality.

Clone this wiki locally