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
@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