0

I'm trying to convert .flv to .mp4 in CentOS. I used ffmpeg -i test.flv test.mp4, which worked well in Windows, but in Linux the result has no video, just audio.

I installed ffmpeg 3.0 using yum.

ffmpeg command output:

ffmpeg version 3.0
Copyright (c) 2000-2016 the FFmpeg developers built with gcc 4.1.2 (GCC) 20080704 (Red Hat 4.1.2-55)
configuration:
libavutil      55. 17.103 / 55. 17.103
libavcodec     57. 24.102 / 57. 24.102
libavformat    57. 25.100 / 57. 25.100
libavdevice    57.  0.101 / 57.  0.101
libavfilter     6. 31.100 /  6. 31.100
libswscale      4.  0.100 /  4.  0.100
libswresample   2.  0.101 /  2.  0.101

What's wrong with my ffmpeg? Thanks in advice.

UPDATE

ffmpeg -i test.flv test.mp4

output:

ffmpeg version 3.0 Copyright (c) 2000-2016 the FFmpeg developers
  built with gcc 4.1.2 (GCC) 20080704 (Red Hat 4.1.2-55)
  configuration: 
  libavutil      55. 17.103 / 55. 17.103
  libavcodec     57. 24.102 / 57. 24.102
  libavformat    57. 25.100 / 57. 25.100
  libavdevice    57.  0.101 / 57.  0.101
  libavfilter     6. 31.100 /  6. 31.100
  libswscale      4.  0.100 /  4.  0.100
  libswresample   2.  0.101 /  2.  0.101
Input #0, flv, from 'test.flv':
  Duration: 00:09:18.71, start: 0.000000, bitrate: 3120 kb/s
    Stream #0:0: Video: flv1, yuv420p, 1000x562, 3000 kb/s, 24 fps, 24 tbr, 1k tbn, 1k tbc
    Stream #0:1: Audio: mp3, 44100 Hz, stereo, s16p, 128 kb/s
Output #0, mp4, to 'test.mp4':
  Metadata:
    encoder         : Lavf57.25.100
    Stream #0:0: Video: mpeg4 ( [0][0][0] / 0x0020), yuv420p, 1000x562, q=2-31, 200 kb/s, 24 fps, 12288 tbn, 24 tbc
    Metadata:
      encoder         : Lavc57.24.102 mpeg4
    Side data:
      unknown side data type 10 (24 bytes)
    Stream #0:1: Audio: aac (LC) ([64][0][0][0] / 0x0040), 44100 Hz, stereo, fltp, 128 kb/s
    Metadata:
      encoder         : Lavc57.24.102 aac
Stream mapping:
  Stream #0:0 -> #0:0 (flv1 (flv) -> mpeg4 (native))
  Stream #0:1 -> #0:1 (mp3 (native) -> aac (native))
Press [q] to stop, [?] for help
frame=   98 fps=0.0 q=31.0 size=     391kB time=00:00:04.08 bitrate= 784.3kbits/s speed=8.13x    
frame=  177 fps=175 q=31.0 size=     662kB time=00:00:07.37 bitrate= 735.0kbits/s speed=7.31x    
frame=  260 fps=172 q=31.0 size=     937kB time=00:00:10.83 bitrate= 708.5kbits/s speed=7.18x    
frame=  353 fps=176 q=31.0 size=    1248kB time=00:00:14.70 bitrate= 694.9kbits/s speed=7.32x    
...
frame=13303 fps=221 q=31.0 size=   48550kB time=00:09:14.29 bitrate= 717.5kbits/s speed=9.21x    
frame=13410 fps=222 q=31.0 Lsize=   49125kB time=00:09:18.75 bitrate= 720.2kbits/s speed=9.24x    
video:39978kB audio:8825kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 0.659448%
[aac @ 0xa1ba040] Qavg: 824.654

When I play it on my web browser, it plays only audio. But if I copy it to Windows, it plays well in media player.

7
  • 3
    Show the entire console output for the command.
    – Gyan
    Commented Feb 29, 2016 at 15:21
  • Edited as entire console output for "ffmpeg" command.
    – Zuiche
    Commented Mar 1, 2016 at 0:44
  • Still the same! Need console output for ffmpeg -i test.flv test.mp4
    – Gyan
    Commented Mar 1, 2016 at 4:20
  • Edited as output for "ffmpeg -i test.flv test.mp4" command.
    – Zuiche
    Commented Mar 1, 2016 at 6:55
  • 1
    ENTIRE console output!!
    – Gyan
    Commented Mar 1, 2016 at 9:11

1 Answer 1

1

Problem

Your ffmpeg was not compiled to support any H.264 encoder. This results in usage of the encoder mpeg4 which produces MPEG-4 Part 2 video, but that's not a format normally supported by web browsers.

Solution

Just download a compiled binary of ffmpeg: it has support for H.264 video encoding via libx264.

Or compile. See FFmpeg Wiki: Compile on CentOS.

Since you're viewing via a browser add -movflags +faststart to your command once you have a working ffmpeg.

3
  • It says "FATAL: kernel too old. Segmentation fault.". My system is centos 5.1_x86. Do you have any other old version?
    – Zuiche
    Commented Mar 2, 2016 at 2:47
  • @Zuiche No. You'll have to follow the compile guide that I linked to. Also, CentOS 5 reaches end-of-life 2017-3-31, so you have just over a year to plan your OS upgrade procedure.
    – llogan
    Commented Mar 2, 2016 at 6:08
  • While compiling ffmpeg, an error occurs following this link. superuser.com/questions/1047525/…
    – Zuiche
    Commented Mar 2, 2016 at 6:15

You must log in to answer this question.

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