2

I am distributing an exe file that contains a video that needs to be able to be played on Windows XP & Windows 7 without ANY other software or codecs installed. This includes Windows Media Player, which many of my customers don't have installed.

Formats – bear with me, I mostly develop apps for other platforms. I don't normally deal with a/v stuff or Windows stuff so my terminology is probably off – I've tried and had no success with:

  • .mp4
  • .ogv
  • .wmv (ironic, isn't it?)

I have been able to play the video in a .mpg format, but it has two issues:

  • Audio doesn't play
  • The file is really big. It's 80 MB and I'd rather have it be no more than 30 MB. I'm okay with putting it in a zip to keep the size down, but that only gets it down to 50 MB.

When I open the file on my Mac, it plays, audio and all.

This is what the QuickTime X movie inspector says about the file format:

MPEG-1 Video, 1,280 x 720
MPEG Layer 3, 48000 Hz, Stereo (L R)

I'd like an FFMPEG command that I can feed my video to and end up with an outputted file that will play on Windows 7, both audio and visual, without any dependencies on other codecs or applications. I'd like it if it also played on fresh installs of Windows XP although I can live with it if it doesn't, and ideally I'd like it to also be within my size constraints.

Edit with details on the output of ffmpeg when I attempted to follow Darth Android's answer:

ffmpeg version 2.0.1 Copyright (c) 2000-2013 the FFmpeg developers
built on Aug 15 2013 10:56:46 with llvm-gcc 4.2.1 (LLVM build 2336.11.00)
configuration: --prefix=/Volumes/Ramdisk/sw --enable-gpl --enable-pthreads
--enable-version3 --enable-libspeex --enable-libvpx --disable-decoder=libvpx
--enable-libmp3lame --enable-libtheora --enable-libvorbis --enable-libx264
--enable-avfilter --enable-libopencore_amrwb --enable-libopencore_amrnb
--enable-filters --enable-libgsm --arch=x86_64 --enable-runtime-cpudetect

libavutil      52. 38.100 / 52. 38.100
libavcodec     55. 18.102 / 55. 18.102
libavformat    55. 12.100 / 55. 12.100
libavdevice    55.  3.100 / 55.  3.100
libavfilter     3. 79.101 /  3. 79.101
libswscale      2.  3.100 /  2.  3.100
libswresample   0. 17.102 /  0. 17.102
libpostproc    52.  3.100 / 52.  3.100
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'my-video.mp4':
Metadata:
major_brand     : mp42
minor_version   : 0
compatible_brands: mp42isomavc1
creation_time   : 2013-06-10 18:21:11
encoder         : HandBrake 0.9.9 2013051800
Duration: 00:01:33.95, start: 0.000000, bitrate: 954 kb/s
Stream #0:0(und): Video: h264 (Main) (avc1 / 0x31637661), yuv420p, 1280x720 [SAR 1:1 DAR 16:9], 813 kb/s, 29.97 fps, 29.97 tbr, 90k tbn, 180k tbc
Metadata:
  creation_time   : 2013-06-10 18:21:11
Stream #0:1(eng): Audio: aac (mp4a / 0x6134706D), 48000 Hz, stereo, fltp, 136 kb/s
Metadata:
  creation_time   : 2013-06-10 18:21:11
[vob @ 0x7f8278821000] VBV buffer size not set, muxing may fail
Output #0, vob, to 'my-video.mpg':
Metadata:
major_brand     : mp42
minor_version   : 0
compatible_brands: mp42isomavc1
encoder         : Lavf55.12.100
Stream #0:0(und): Video: mpeg2video, yuv420p, 1280x720 [SAR 1:1 DAR 16:9], q=2-31, 200 kb/s, 90k tbn, 29.97 tbc
Metadata:
  creation_time   : 2013-06-10 18:21:11
Stream #0:1(eng): Audio: mp2, 48000 Hz, stereo, s16, 128 kb/s
Metadata:
  creation_time   : 2013-06-10 18:21:11
Stream mapping:
Stream #0:0 -> #0:0 (h264 -> mpeg2video)
Stream #0:1 -> #0:1 (aac -> mp2)
Press [q] to stop, [?] for help
frame=  182 fps=0.0 q=24.8 size=     528kB time=00:00:06.25 bitrate= 691.6kbits
frame=  380 fps=379 q=31.0 size=    1076kB time=00:00:12.97 bitrate= 679.4kbits
frame=  548 fps=364 q=31.0 size=    1704kB time=00:00:18.49 bitrate= 754.8kbits
frame=  692 fps=345 q=31.0 size=    2390kB time=00:00:23.26 bitrate= 841.4kbits
frame=  815 fps=325 q=31.0 size=    3170kB time=00:00:27.30 bitrate= 951.2kbits
frame=  950 fps=316 q=24.8 size=    4146kB time=00:00:31.78 bitrate=1068.4kbits
frame= 1079 fps=307 q=31.0 size=    5154kB time=00:00:36.13 bitrate=1168.5kbits
frame= 1242 fps=309 q=31.0 size=    5868kB time=00:00:41.65 bitrate=1154.0kbits
frame= 1413 fps=313 q=31.0 size=    6586kB time=00:00:47.31 bitrate=1140.2kbits
frame= 1587 fps=316 q=31.0 size=    7346kB time=00:00:53.14 bitrate=1132.2kbits
frame= 1753 fps=318 q=31.0 size=    8026kB time=00:00:58.66 bitrate=1120.7kbits
frame= 1925 fps=320 q=31.0 size=    8798kB time=00:01:04.35 bitrate=1119.9kbits
frame= 2091 fps=321 q=31.0 size=    9646kB time=00:01:10.02 bitrate=1128.5kbits
frame= 2226 fps=317 q=31.0 size=   10484kB time=00:01:14.48 bitrate=1153.0kbits
frame= 2386 fps=317 q=31.0 size=   11232kB time=00:01:19.86 bitrate=1152.1kbits
frame= 2554 fps=318 q=31.0 size=   11852kB time=00:01:25.40 bitrate=1136.8kbits
frame= 2759 fps=324 q=31.0 size=   12396kB time=00:01:32.14 bitrate=1102.0kbits
frame= 2813 fps=325 q=31.0 Lsize=   12546kB time=00:01:33.94 bitrate=1094.0kbits/s    
video:10904kB audio:1468kB subtitle:0 global headers:0kB muxing overhead 1.402856%
6
  • 2
    You want MPEG-2 Video with MPEG Layer 2 audio, as those are both included in the default DirectShow Filters that come with Windows. (And MPEG-2 Video will give you better results than MPEG-1) Commented Aug 21, 2013 at 19:25
  • @DarthAndroid - That sounds promising. Can you give me an example ffmpeg command that would go from the type of file I have to that type (possibly as an answer so I can mark it as correct?) Commented Aug 21, 2013 at 20:05
  • I won't leave an answer for a day or so in case @DarthAndroid wishes to do so, but you'll want to use -c:v mpeg2video and -c:a mp2 to use these codecs. You can set the quality of mpeg2video with -q:v 4 (the range is 1-31, where lower number=better quality and 3-6 is a useful range), I'm not sure how to set it for the audio (it would be -q:a, but I'm not sure what the range is).
    – evilsoup
    Commented Aug 21, 2013 at 20:42
  • Isn't AVI a standard format out of the box for XP/7? Commented Aug 21, 2013 at 20:49
  • @evilsoup I believe mp2 ignores -q:a and will use the default of -b:a 128k, and mp2 is picky about what bitrates it will accept.
    – llogan
    Commented Aug 21, 2013 at 20:52

2 Answers 2

1

Try:

ffmpeg.exe -i "C:/Path/to/your/video.mkv" -vcodec mpeg2video -acodec mp2 -f vob -y "C:/Path/to/output/video.mpg" 

where video.mkv is your source file and and video.mpg is your output.

-vcodec mpeg2video sets the output video format to MPEG2
-acodec mp2 sets the output audio format to MPEG2 -f vob sets the output container/file format to Vob (*.mpg)
-y overwrites target file.

10
  • @LordNeckbeard Thanks. I'm not familiar with ffmpeg so please feel free to correct/edit the answer if there are details that I missed. Also, I find it amusing that you're actually able to follow through on that comment you wrote a year ago. Commented Aug 21, 2013 at 20:47
  • Thanks. Which comment are you referring to?
    – llogan
    Commented Aug 21, 2013 at 20:54
  • I attempted this. On my Mac, the new video plays fine and is much smaller (just 12 MB), but it plays neither video nor audio on Windows 7. Quicktime (on the Mac) says that the video is MPEG-2 Video with MPEG Layer 3 audio. I'll edit my question to have more details on the output of ffmpeg. Commented Aug 21, 2013 at 21:00
  • @DarthAndroid - I have attempted this, but now the video simply doesn't play in Windows 7. I've added a log to my question showing the output from ffmpeg. Commented Aug 21, 2013 at 21:08
  • I tried putting the mpg produced through this command into ffmpeg again to convert it to something else - of note, it said the audio was mp2 even though Quicktime says it's layer 3. So perhaps Quicktime just has a typo in it. Or maybe ffmpeg does. Commented Aug 21, 2013 at 21:17
1

I finally found a format that worked for me on a fresh install of Windows 7 without Windows Media Player or any other codecs:

MPEG-1 Video, 1,280 x 720
MPEG Layer 3, 48000 Hz, Mono

(Note the only change was from Stereo to Mono compared to what I had been using when I first posted the question.)

To get it I typed:

ffmpeg -i my-video.mp4 -vcodec mpeg1video -acodec mp2 -ac 1 -f vob my-video-mono.mpg

I'd like to thank Darth Android whose answer greatly helped me with learning more about the arguments I needed to provide to ffmpeg.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .