Skip to content
Ching Yi, Chan edited this page Mar 4, 2020 · 9 revisions

Cut Video

ffmpeg -i input.flv -acodec copy -vcodec copy -ss 00:03:00:00 output.flv

using -t to give a duration in seconds

ffmpeg -i input.flv -acodec copy -vcodec copy -ss 00:03:00:00 -t 60 output.flv

Dump Stream

ffmpeg -i mmsh://72.13.93.186/campcartoon -acodec copy -vcodec copy output.asf
mplayer -dumpstream mms://something_in_the_streams -dumpfile saved_streams.asf

Dump Audio Stream only

ffmpeg -i video.mp4 -vn -acodec copy audio_only.m4a

Get Image

ffmpeg -vframes 1 -i [URL] -timelimit 60 -f image2 [IMAGE.PNG]
ffmpeg -vframes 1 -ss [SECONDS OR TIME_FORMAT] -i [URL] -timelimit 60 -f image2 [IMAGE.PNG]

--

MP4 Transcode Tips

from http://stackoverflow.com/questions/8616855/how-to-output-fragmented-mp4-with-ffmpeg/9734251#9734251

ffmpeg -re -i sample.mp4 -g 52 \
-acodec copy -vcodec copy \
-f mp4 -movflags frag_keyframe+empty_moov+default_base_moof \
output.mp4

move moov to the head of the mp4 file

ffmpeg -i sample.mp4 \
-acodec copy -vcodec copy \
-f mp4 -movflags frag_keyframe+empty_moov+default_base_moof \
output.mp4