Showing posts with label ffmpeg. Show all posts
Showing posts with label ffmpeg. Show all posts
21 June 2022
27 March 2022
.dav video files | play | convert to .mp4 | concatenate .mp4 files
1. How to play .dav video files?
Wondershare UniConverter
2. How to convert .dav files into .mp4 files?
>ffmpeg -y -i input-file.dav -c:v libx264 -crf 24 output-file.mp4
3. How to concatenate .mp4 files?
For Linux:
$ cat mylist.txt
file '/path/to/file1'
file '/path/to/file2'
file '/path/to/file3'
$ ffmpeg -f concat -safe 0 -i mylist.txt -c copy output.mp4
For Windows:
(echo file 'first file.mp4' & echo file 'second file.mp4' )>list.txt
ffmpeg -safe 0 -f concat -i list.txt -c copy output.mp4
24 March 2021
How to extract a section from a video with ffmpeg?
How to extract a section from a video with ffmpeg?
How to cut a video, without re-encoding
Use this to cut video from [start]
for [duration]
:
ffmpeg -ss [start] -i in.mp4 -t [duration] -c copy out.mp4
Here, the options mean the following:
-ss
specifies the start time, e.g.00:01:23.000
or83
(in seconds)-t
specifies the duration of the clip (same format).- Instead of
-t
you can also supply the end time with-to
. -c copy
copies the first video, audio, and subtitle bitstream from the input to the output file without re-encoding them. This won't harm the quality and make the command run within seconds.
Note that if you've used -ss
, you have to subtract this from the -to
timestamp. For example, if you cut with -ss 3 -i in.mp4 -to 5
, the output will be five seconds long.
For more info, see https://trac.ffmpeg.org/wiki/Seeking
10 September 2019
how to scale videos/images with ffmpeg?
how to scale videos/images with ffmpeg?
https://trac.ffmpeg.org/wiki/Scaling
https://trac.ffmpeg.org/wiki/Scaling
Keeping the Aspect Ratio
If we'd like to keep the aspect ratio, we need to specify only one component, either width or height, and set the other component to -1. For example, this command line:
ffmpeg -i input.jpg -vf scale=320:-1 output_320.png
will set the width of the output image to 320 pixels and will calculate the height of the output image according to the aspect ratio of the input image. The resulting image will have a dimension of 320⨉207 pixels.
13 June 2019
Convert DVD videos into mp4 files with ffmpeg
Convert DVD videos into mp4 files with ffmpeg
https://www.tech-g.com/2017/01/15/converting-dvd-to-mp4-h264-on-windows/
https://www.tech-g.com/2017/01/15/converting-dvd-to-mp4-h264-on-windows/
ffmpeg -i "concat:VTS_01_1.VOB|VTS_02_1.VOB|VTS_03_1.VOB|VTS_04_1.VOB|VTS_05_1.VOB" outfile.mp4
07 May 2019
How to convert a file into mp3 file?
How to convert a file into mp3 file?
ffmpeg -i input.wav -vn -ar 44100 -ac 2 -b:a 192k output.mp3
Explanation of the used arguments in this example:
-i
- input file-vn
- Disable video, to make sure no video (including album cover image) is included if the source would be a video file-ar
- Set the audio sampling frequency. For output streams it is set by default to the frequency of the corresponding input stream. For input streams this option only makes sense for audio grabbing devices and raw demuxers and is mapped to the corresponding demuxer options.-ac
- Set the number of audio channels. For output streams it is set by default to the number of input audio channels. For input streams this option only makes sense for audio grabbing devices and raw demuxers and is mapped to the corresponding demuxer options. So used here to make sure it is stereo (2 channels)-b:a
- Converts the audio bitrate to be exact 192kbit per second
13 March 2019
How to Concatenate media files
Concatenating media files
Using intermediate files
If you have MP4 files, these could be losslessly concatenated by first transcoding them to MPEG-2 transport streams. With H.264 video and AAC audio, the following can be used:
ffmpeg -i input1.mp4 -c copy -bsf:v h264_mp4toannexb -f mpegts intermediate1.ts
ffmpeg -i input2.mp4 -c copy -bsf:v h264_mp4toannexb -f mpegts intermediate2.ts
ffmpeg -i "concat:intermediate1.ts|intermediate2.ts" -c copy -bsf:a aac_adtstoasc output.mp4
24 July 2018
How to convert mp4 videos into flv ones with ffmpeg?
How to convert mp4 videos into flv ones with ffmpeg?
I'm late, but if this can help somebody, it's time well spent.
If I understand correctly, you want to convert MP4 to FLV using FFMPEG. Here are two command lines to help you do that; I'm currently using them myself (you can adjust them to your needs too) :
ffmpeg -i source.mp4 -c:v libx264 -crf 19 destinationfile.flv
and if the first one doesn't work :
ffmpeg -i source.mp4 -c:v libx264 -ar 22050 -crf 28 destinationfile.flv
Please note that
-crf XX
is the quality of the video you will create. It's between 0 and 51 (but between 17 and 23 is a reasonable range and the lower the number is, the better quality the video is going to be).
The
-ar 22050
is for adjusting the audio sample range (audio quality). You can choose 11025, 22050 or 44100.
I suggest you read this Tutorial for FFMPEG . It's really complete and has many useful tips.
Hope this will help you or somebody in the same situation.
31 May 2018
How to resize videos
How to resize videos?
https://www.ffmpeg.org/download.html
https://www.ffmpeg.org/download.html
Keeping the Aspect Ratio
If we'd like to keep the aspect ratio, we need to specify only one component, either width or height, and set the other component to -1. For example, this command line:
ffmpeg -i input.jpg -vf scale=320:-1 output_320.png
will set the width of the output image to 320 pixels and will calculate the height of the output image according to the aspect ratio of the input image. The resulting image will have a dimension of 320⨉207 pixels.
21 August 2015
How to download a video from a website?
1. You-Get
https://zhuanlan.zhihu.com/p/36714382
2. ffmpeg - the best!
https://www.ostechnix.com/20-ffmpeg-commands-beginners/
3. https://rg3.github.io/youtube-dl/
4. Bigasoft Video Downloader Pro
5. Install RealPlayer.
6. Well in case you ever need to download online videos and it doesn’t work with a regular video downloader, you can check audials moviebox. it has several recording options, including screen recording which works with pretty much any video (here you can find step by step instructions on how it can be used: http://audials.com/en/how_to_record_stream_capture_music_videos_movies_from/hulu.html). and it does a pretty good job in general.
https://zhuanlan.zhihu.com/p/36714382
2. ffmpeg - the best!
https://www.ostechnix.com/20-ffmpeg-commands-beginners/
3. https://rg3.github.io/youtube-dl/
4. Bigasoft Video Downloader Pro
5. Install RealPlayer.
6. Well in case you ever need to download online videos and it doesn’t work with a regular video downloader, you can check audials moviebox. it has several recording options, including screen recording which works with pretty much any video (here you can find step by step instructions on how it can be used: http://audials.com/en/how_to_record_stream_capture_music_videos_movies_from/hulu.html). and it does a pretty good job in general.
Subscribe to:
Posts (Atom)