You can use the following
ffmpeg Custom command to trim a video, specifying the start time and duration:-ss 00:00:30 -t 00:01:00 -c copy
Hereβs what the options mean:
- -ss 00:00:30: The start time of the trim (in this example, 30 seconds).
- -t 00:01:00: The duration of the trim (in this example, 1 minute).
- -c copy: Copies the video and audio streams without re-encoding (which is faster and preserves quality).
This command will produce output video, containing only the 1-minute segment starting at 30 seconds into the original video.
If you want to re-encode the video (e.g., for compatibility), remove -c copy:
-ss 00:00:30 -t 00:01:00
This will result in a longer process since it will re-encode the video.
When re-encoding a video with
ffmpeg, you have several options to control the quality and file size. Hereβs how you can use the -crf (Constant Rate Factor) and -ac (Audio Channels) options, among others:1. Re-encoding with CRF for Quality Control
CRF (Constant Rate Factor) is a quality setting used by the
libx264 (H.264) and libx265 (H.265) encoders in ffmpeg. The range is typically from 0 to 51:- Lower values mean higher quality (and larger file sizes).
- Higher values mean lower quality (and smaller file sizes).
- A CRF value of around 18-23 is a good starting point for H.264, with 18 being visually lossless.
Example:
-ss 00:00:30 -t 00:01:00 -c:v libx264 -crf 23 -preset medium -c:a aac -b:a 128k
2. Explanation of the Options:
-
-c:v libx264: Specifies the video codec (H.264 in this case).- -crf 23: Sets the CRF value to 23, balancing quality and file size.
- -preset medium: Controls the encoding speed and compression (options: ultrafast, superfast, veryfast, faster, fast, medium, slow, slower, veryslow). Slower presets result in better compression and smaller file sizes but take more time.
- -c:a aac: Specifies the audio codec (AAC in this case).
- -b:a 128k: Sets the audio bitrate to 128 kbps.
3. Changing Audio Settings
-
-ac 2: Sets the number of audio channels (e.g., 2 for stereo).- -ar 44100: Sets the audio sampling rate (e.g., 44100 Hz).
4. Full Example Command
-ss 00:00:30 -t 00:01:00 -c:v libx264 -crf 23 -preset medium -c:a aac -b:a 128k -ac 2 -ar 44100
5. H.265 Example (Optional)
If you want to use the H.265 codec for better compression:
-ss 00:00:30 -t 00:01:00 -c:v libx265 -crf 28 -preset medium -c:a aac -b:a 128k
For H.265, a CRF of 28 is roughly equivalent to a CRF of 23 in H.264 in terms of visual quality.
These commands will allow you to trim and re-encode your video while maintaining control over the quality and file size.
You Can Use That ffmpeg Custom Command in Those Bots.
@SPxCompressBot
@SPxCompressOneBot
@SPxCompressTwoBot
@SPxCompressThreeBot
Please open Telegram to view this post
VIEW IN TELEGRAM
β€βπ₯3π€©2β‘1β€1π1π₯1π€―1
This media is not supported in your browser
VIEW IN TELEGRAM
Please open Telegram to view this post
VIEW IN TELEGRAM
π11β€βπ₯1π1
Hard Subtitle Using FFmpeg command
π π π π π π βΉοΈ π₯³ π π π π π π βΉοΈ
β οΈ This Command Only Work For Soft Subbed Video In Our Bot
Note : This ffmpeg Command Are On Your Special file input path
In our bot using like this :
Eg :
π£ βΉοΈ π βΉοΈ π πΆβπ«οΈ π£ π₯³ π£ βΉοΈ π βΉοΈ π πΆβπ«οΈ π£
Explanation :
5. -c:a aac -b:a 192k
This command will result in a video with both the first subtitle track and the first audio track hardcoded into the output.
Note : This ffmpeg Command Are On Your Special file input path
In our bot using like this :
/home/sp/app/ffmpeg/[userid]/[filename]
Eg :
/home/sp/app/ffmpeg/1224xxx/1234.mkv
-vf "subtitles='/home/sp/app/ffmpeg/[userid]/[filename]':si=0" \
-map 0:v:0 -map 0:a:0 \
-c:v libx264 -crf 18 -preset slow -c:a aac -b:a 192k
Explanation :
1. -vf "subtitles='/home/sp/app/ffmpeg/[userid]/[filename]':si=0" : Applies the first subtitle track as a hardcoded subtitle.
2. -map 0:v:0 : Maps the first video track.
3. -map 0:a:0 : Maps the first audio track. By default, this will be the first audio track (hard audio).
4. -c:v libx264 -crf 18 -preset slow : Sets the video codec to libx264 with a CRF value of 18 for high quality, and the slow preset for better compression.5. -c:a aac -b:a 192k
: Re-encodes the audio using the AAC codec at a bitrate of 192 kbps. This step is necessary to ensure the audio is hardcoded along with the video.This command will result in a video with both the first subtitle track and the first audio track hardcoded into the output.
Please open Telegram to view this post
VIEW IN TELEGRAM
β€3π2β€βπ₯1β‘1π€©1
Certainly! Here's a comprehensive explanation of how to handle multiple tracks for both subtitles and audio in FFmpeg, focusing on the use of
-map for audio and si for subtitles :Handling Multiple Audio Tracks
Audio Tracks :
- Mapping Audio Streams: Use
-map to select which audio stream to include in the output file. Audio streams are indexed starting from 0. For example:-
-map 0:a:0 : Selects the first audio stream.-
-map 0:a:1 : Selects the second audio stream.In FFmpeg, audio tracks are not "burned in" or hardcoded. Instead, they are simply included as separate streams in the output file. The
-map option determines which audio tracks are included in the final file.Handling Multiple Subtitle
Subtitle Tracks Burning Subtitles : To hardcode subtitles into the video, use the
-vf option with the subtitles filter. You can specify which subtitle stream to use with the si paramet si=0 : Uses the first subtitle si=1 : Uses the second subtitle stream.Unlike audio, subtitles are hardcoded directly into the video stream, which means they are rendered into the video frames rather than being a separate stream in the output file.
Example Command for Multiple Tracks
FFmpeg command that handles multiple audio and subtitle tracks :
-vf "subtitles='/home/sp/app/ffmpeg/[userid]/[filename]':si=1" \
-map 0:v:0 -map 0:a:1 \
-c:v libx264 -crf 18 -preset slow -c:a aac -b:a 192k
Breakdown :
- -vf "subtitles='/home/sp/app/ffmpeg/[userid]/[filename]':si=1" : Hardcodes the second subtitle
-map 0:v:0 : Includes the first video
-map 0:a:1 : Includes the second audio stream from the input.
- -c:v libx264 -crf 18 -preset slow : Encodes the video using x264 codec with specified
- -c:a aac -b:a 192k : Encodes the audio using AAC codec
- Subtitles : Use
-vf "subtitles=/home/sp/app/ffmpeg/[userid]/[filename]:si=<index>" to hardcode muti subtitles.- Audio : Use
-map 0:a:<index> to select which muti audio.You Can Use That ffmpeg Custom Command in Those Bots.
@SPxCompressBot
@SPxCompressOneBot
@SPxCompressTwoBot
@SPxCompressThreeBot
Please open Telegram to view this post
VIEW IN TELEGRAM
β€βπ₯8π€―4β‘1
Need Tutorials Video With Custom code ? While Using our Bots.
Video Watermark Text/metadata/trim/hardsubs(hardmux)
If U Want Comment Down Below.
Admin Riki(γγ)
Please open Telegram to view this post
VIEW IN TELEGRAM
β€βπ₯7β€2π2β‘1π1
ππ°πΆπ³π€π¦ πππ¦π’π΄π¦ ππ°π΅π΄
Which Bot First ?
Currently Working Auto Caption Support Format
{file_caption} current caption
{file_name} original file name
{file_size} total file size
{quality} file resolution
Please open Telegram to view this post
VIEW IN TELEGRAM
β€βπ₯6β‘2π2π€―1π1
ππ°πΆπ³π€π¦ πππ¦π’π΄π¦ ππ°π΅π΄
Youtube Link Fixedπ±
Removed YT.Cookies
Using VPN With USA IP
π Riki(γγ)
Using VPN With USA IP
Please open Telegram to view this post
VIEW IN TELEGRAM
π₯7β€βπ₯3β‘2π€©2
ππ°πΆπ³π€π¦ πππ¦π’π΄π¦ ππ°π΅π΄
ββπ ππΎπ π‘ππ π±πΎπ
πΎπΊππΎπ½ π π²π―ππ₯ππ
πΎπ²ππππΎπ‘ππ π π₯πΎπΊππππΎπ π π―ππππΎπΌππππ ππΏ π π
π
π³πππππ π£πΊππΊ : ππΎπΊπ½π ππ πππππΎπΌπ πΊππ½ ππΎπππΎ πΊππ ππππ½ ππΏ ππππ π½πΊππΊ ππππ πΊ πππ½πΎ ππΏ πΌππΊππ. β° π³πππΎ-π³ππΊππΎπ
πππ π£πΊππΊ : π£πΎπ
πΎππΎ π³πππΎπ, π²πΎπ πΊ ππππΎπ πΏππ πππΊππΎπ½ πΏππ
πΎπ ππ πΊπππππΊπππΌπΊπ
π
π π½πΎπ
πΎππΎ πΊπΏππΎπ πΊ πππΎπΌππΏππΎπ½β¦
Please open Telegram to view this post
VIEW IN TELEGRAM
β€βπ₯9β€3π1
Please open Telegram to view this post
VIEW IN TELEGRAM
π13β€βπ₯2π₯2β€1
ππ°πΆπ³π€π¦ πππ¦π’π΄π¦ ππ°π΅π΄
Please open Telegram to view this post
VIEW IN TELEGRAM
β‘6β€4π2π1
Please open Telegram to view this post
VIEW IN TELEGRAM
β€βπ₯6β€2π€©2π2π₯1
ππ°πΆπ³π€π¦ πππ¦π’π΄π¦ ππ°π΅π΄
Please open Telegram to view this post
VIEW IN TELEGRAM
π₯7π’5β€2
ππ°πΆπ³π€π¦ πππ¦π’π΄π¦ ππ°π΅π΄
ββπ πππππ₯π‘π€ππππ§ππ§π€π½π€π© π±πππ ππ πΎπππππ π¦ π΅πππππππ π ππππππ πππππ πππππππππ ππ’ ππ-π³π»πΏ ππ ππππππππ. π ππππππ π·πππΏ/π·πππΏπ πππππ ππ πππππ ππ ππππππ ππ ππππππππ. π ππππππ π’ππππππ,ππππππ,πππππππππ, ππππππππππ (ππππ), ππππππ πππππ, ππππππ πππππ (ππππππ.πππ ππππππ).ππππβ¦
What's News
/setcookies/removecookiesUser Can Set Theirs Cookies file to download YT-DLP support link.
Please open Telegram to view this post
VIEW IN TELEGRAM
β€6β€βπ₯1π’1
ππ°πΆπ³π€π¦ πππ¦π’π΄π¦ ππ°π΅π΄
Media is too big
VIEW IN TELEGRAM
Please open Telegram to view this post
VIEW IN TELEGRAM
π₯7
ππ°πΆπ³π€π¦ πππ¦π’π΄π¦ ππ°π΅π΄
Please open Telegram to view this post
VIEW IN TELEGRAM
π€©6π’4β€2π2
Please open Telegram to view this post
VIEW IN TELEGRAM
β€14π₯3π’1
ππ°πΆπ³π€π¦ πππ¦π’π΄π¦ ππ°π΅π΄
ββπ πππππ₯π‘π€ππππ§ππ§π€π½π€π© π±πππ ππ πΎπππππ π¦ π΅πππππππ π ππππππ πππππ πππππππππ ππ’ ππ-π³π»πΏ ππ ππππππππ. π ππππππ π·πππΏ/π·πππΏπ πππππ ππ πππππ ππ ππππππ ππ ππππππππ. π ππππππ π’ππππππ,ππππππ,πππππππππ, ππππππππππ (ππππ), ππππππ πππππ, ππππππ πππππ (ππππππ.πππ ππππππ).ππππβ¦
Please open Telegram to view this post
VIEW IN TELEGRAM
β€5π₯1π€©1
Media is too big
VIEW IN TELEGRAM
Tutorial For Verify URL Shortenerπ€
Please open Telegram to view this post
VIEW IN TELEGRAM
π’21β€8β‘3π€―3π2