-
Notifications
You must be signed in to change notification settings - Fork 978
Automatically Convert Videos to MP4 and MP3
Daniel Neto edited this page Jan 8, 2025
·
4 revisions
This guide explains how to enable and use features like converting videos to MP4 and MP3. These options make it easy to download, watch offline, or listen to audio content.
- HLS videos are optimized for streaming but difficult to download or watch offline.
- Converting them to MP4 makes downloading and offline viewing simple.
- Open the VideoHLS Plugin settings.
- Look for the option
autoConvertToMp4
. - Check the box to activate this feature.
📖 Learn more about the VideoHLS Plugin.
If you prefer to convert videos yourself:
- Open your terminal and go to this folder:
cd /var/www/html/AVideo/plugin/VideoHLS/tools
- Run this command:
php convertToMP4.php
- This will only convert if the MP4 file doesn’t already exist.
- To force a conversion, even if the MP4 file exists:
php convertToMP4.php 1
- MP3 files allow users to listen to the audio from videos, perfect for podcasts.
- Especially useful for mobile users who want to listen with the screen locked.
- Go to the CustomizeAdvanced Plugin settings.
- Locate the
autoConvertVideosToMP3
option. - Check the box to enable it.
📖 Learn more about enabling MP3 downloads.
- Open your terminal and navigate to:
cd /var/www/html/AVideo/install
- Run the command:
php getMp3FromAll.php
- Converts videos to MP3 only if the MP3 doesn’t already exist.
To convert a specific video to MP3:
- Run this command:
php getMp3FromVideo.php
- Follow the prompts:
- Enter the video ID to specify the video.
- If the MP3 already exists, the script will ask if you want to delete it and retry.
- Example interaction:
cd /var/www/html/AVideo/install php getMp3FromVideo.php Enter the video ID: 123 MP3 file already exists at: /path/to/mp3/file.mp3 Do you want to remove and try again? (y/n): y Conversion successful! Execution Steps: - Step 1 - Step 2 MP3 Duration: 3:15
If an MP3 file’s length doesn’t match the video’s:
- Run this command to identify and fix errors:
php verifyAllMP3Lengths.php
- Note: This process may take longer.
- Easier Downloads: Enables users to download HLS videos as MP4.
- Offline Viewing: Watch videos anywhere, even without internet access.
📖 Learn more about offline viewing.
- Listen Anywhere: Perfect for podcasts, audiobooks, or lectures.
- Screen Locked Listening: Save battery on mobile devices.
- Car-Friendly: Connect to your car’s audio system for hands-free listening.
📖 Learn more about the mobile app.
-
HLS to MP4 Conversion:
- The system checks for new HLS videos every minute and converts them.
- If the conversion fails, it retries every minute.
-
Video to MP3 Conversion:
- The system checks for new videos every hour and converts them.
- If the conversion fails, it retries every hour.