ffmpeg video encoding for the CFD-105 car video entertainment system

From thelinuxwiki
Jump to: navigation, search

Contents

command line

This was successful and tested with great quality results.

$ ffmpeg -i inputfile.mp4 -qscale:v 1 -c:v mpeg4 -vtag xvid -vf scale=640x360 output.avi

configuration options

high quality setting (from 1 to 31, where 1 is highest). setting to 1 greatly increases file size. quality 5 is about the same size and still very good. too low a quality will cause the video to be very poor and "grainy"

-qscale:v 5 

supported resolution

-vf scale=640x360

Videos would not play without the vtag setting.

source file info

$ ffprobe -i ./inputfile.mp4
ffprobe version 2.8.8 Copyright (c) 2007-2016 the FFmpeg developers
...output trimmed...
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from './inputfile.mp4':
 Metadata:
   major_brand     : mp42
   minor_version   : 0
   compatible_brands: isommp42
   creation_time   : 2016-08-12 08:18:22
 Duration: 00:01:42.45, start: 0.000000, bitrate: 916 kb/s
   Stream #0:0(und): Video: h264 (Main) (avc1 / 0x31637661), yuv420p(tv, bt709), 1280x720 [SAR 1:1 DAR 16:9], 787 kb/s, 25 fps, 25 tbr, 90k tbn, 50 tbc (default)
   Metadata:
     creation_time   : 2016-08-12 08:18:22
     handler_name    : ISO Media file produced by Google Inc.
   Stream #0:1(und): Audio: aac (LC) (mp4a / 0x6134706D), 44100 Hz, stereo, fltp, 125 kb/s (default)
   Metadata:
     creation_time   : 2016-08-12 08:18:22
     handler_name    : ISO Media file produced by Google Inc.

output file info

$ ffprobe -i ./bob_the_train-numbers_song.avi 
ffprobe version 2.8.8 Copyright (c) 2007-2016 the FFmpeg developers
...output trimmed...
Input #0, avi, from './bob_the_train-numbers_song.avi':
 Metadata:
   encoder         : Lavf56.40.101
 Duration: 00:01:42.48, start: 0.000000, bitrate: 1696 kb/s
   Stream #0:0: Video: mpeg4 (Simple Profile) (FMP4 / 0x34504D46), yuv420p, 640x360 [SAR 1:1 DAR 16:9], 1556 kb/s, 25 fps, 25 tbr, 25 tbn, 25 tbc
   Stream #0:1: Audio: mp3 (U[0][0][0] / 0x0055), 44100 Hz, stereo, s16p, 128 kb/s