Skip to content

Instantly share code, notes, and snippets.

@ssp
Last active July 7, 2022 17:54
Show Gist options
  • Save ssp/4452136 to your computer and use it in GitHub Desktop.
Save ssp/4452136 to your computer and use it in GitHub Desktop.
Command to repackage a MP4 video from a FLV container to a MP4 container.
#!/usr/bin/env sh
# Stored at: https://gist.github.com/4452136
# Assumes the given path points to a FLV file with MP4 video.
# Use ffmpeg to repackage the file.
ffmpeg -i "$1" -acodec copy -vcodec copy "$1".mp4
# old version:
# Not used anymore as VLC seems to have a bug that creates broken
# MP4 files which do not play back correctly.
#
# Call VLC to repackage the video/audio to a MP4 container.
# Path to VLC executable
#VLCPATH=/Applications/Vision/VLC.app/Contents/MacOS/VLC
# Call VLC:
# * -I dummy: without a graphical interface
# * $1: input file name
# * conversion specification
# ** mp4 container, no change to the streams
# ** write to original file name with ».mp4« appended
# * vlc://quit: exit vlc when done
#$VLCPATH -I dummy "$1" ":sout=#standard{mux=mp4,dst=$1.mp4,access=file}" vlc://quit
@roevason
Copy link

Why Convert FLV to MP4? Here is the answer: http://www.faasoft.com/articles/flv-to-mp4-on-mac-and-windows.html

FLV format is one kind of Flash video file formats, which is used to deliver video over the Internet in the same manner as F4V, which is the other Flash video format. Numerous famous video sharing sites such as YouTube choose .flv as one of the uploaded or downloaded formats. Since it is getting easier to extract the FLV content from video-sharing website nowadays, the number of FLV files floating around is booming and many people obtain a ton of video clips in this format on their computer.

With that comes an issue when you try to play these clips on your iPad, iPhone, iPod, iTunes, QuickTime, Android, PS3, Archos etc, or edit them in iMovie, since FLV is not compatible with the above players or devices. That's the reason people dig around in order to find out a way to convert FLV to MP4 or other more popular formats.

This article aims to introduce a professional FLV to MP4 Converter and a step by step guide to help you convert FLV to MP4 smoothly.

@DavidHernry
Copy link

Free method: Handbrake, Freemake Video Converter, Formatfactory
Paid yet professional and easy method: iDealshare VideoGo https://www.idealshare.net/video-converter/convert-flv-to-mp4-on-mac-windows.html

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment