0
votes

Initial data:

  • ffmpeg version 2.7.2-static

    built with gcc 4.9.3 (Debian 4.9.3-1)

    configuration: --enable-gpl --enable-version3 --disable-shared --disable-debug --enable-runtime-cpudetect --enable-libmp3lame --enable-libx264 --enable-libx265 --enable-libwebp --enable-libspeex --enable-libvorbis --enable-libvpx --enable-libfreetype --enable-fontconfig --enable-libxvid --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libtheora --enable-libvo-aacenc --enable-libvo-amrwbenc --enable-gray --enable-libopenjpeg --enable-libopus --enable-libass --enable-gnutls --enable-libvidstab --enable-libsoxr --cc=gcc-4.9

  • video.mp4 the file is 31000079 bytes

The problem is:

  • cat video.mp4 | ffmpeg -i pipe: -v warning -vf scale=100:100 scaled_video.mp4 produces a file of 755052 bytes
  • cat video.mp4 | ffmpeg -i pipe: -v warning -vf scale=100:100 -f h264 - > scaled_video.mp4 produces a file of 252804 bytes

ffprobe shows that initial file video stream is h264

What can't i see ?:D

1

1 Answers

1
votes

First of all, why are you piping the input instead of ffmpeg -i video.mp4?

Anyway, it's not what can't you see but rather what can't you hear.

The first command scales the video and re-encodes the whole MP4 file, including all the audio tracks it might have, using the default ffmpeg parameters. It will compress your file.

The second command where you specify -f h264 does the same but outputs just the raw H.264 video stream and no audio. The resulting file is not a valid MP4, its extension should be .h264

-f h264 is used for getting the raw H.264 stream. If you want to specify the codec then use -c:v libx264 instead.