0

i have to append video with a audio and merge the output with anther video mp4 i use this code to append video with audio

ffmpeg -i "out1.mp4" -i "desc1.mp3" -c:v copy -c:a aac -strict experimental "output2.mp4"

its work in windows but in my server lunix i have this error

root@ns:~# ffmpeg -i /var/www/hespress/17/out1.mp4 -i /var/www/hespress/17/desc1.mp3 -c:v copy -c:a aac -strict experimental /var/www/hespress/17/output2.mp4
ffmpeg version 0.8.20-6:0.8.20-0+deb7u1, Copyright (c) 2000-2014 the Libav developers
  built on Jan 19 2017 11:13:36 with gcc 4.7.2
The ffmpeg program is only provided for script compatibility and will be removed
in a future release. It has been deprecated in the Libav project to allow for
incompatible command line syntax improvements in its replacement called avconv
(see Changelog for details). Please use avconv instead.
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from '/var/www/hespress/17/out1.mp4':
  Metadata:
    major_brand     : isom
    minor_version   : 512
    compatible_brands: isomiso2avc1mp41
    encoder         : Lavf53.21.1
  Duration: 00:00:20.03, start: 0.000000, bitrate: 1374 kb/s
    Stream #0.0(und): Video: h264 (Main), yuvj420p, 1280x720 [PAR 1:1 DAR 16:9], 1371 kb/s, 30 fps, 30 tbr, 30 tbn, 60 tbc
[mp3 @ 0xa06c40] max_analyze_duration reached
Input #1, mp3, from '/var/www/hespress/17/desc1.mp3':
  Metadata:
    encoder         : Lavf53.21.1
  Duration: 00:00:19.53, start: 0.000000, bitrate: 192 kb/s
    Stream #1.0: Audio: mp3, 44100 Hz, mono, s16, 192 kb/s
Unrecognized option 'c:v'
Failed to set value 'copy' for option 'c:v'

when i went to merge two file i use this code

ffmpeg -i intro.mp4 -c copy -bsf:v h264_mp4toannexb -f mpegts '.$dossier.'/intermediate1.ts

in windows its work but in server debian i have this error

root@ns205125:~# ffmpeg -i /var/www/hespress/intro.mp4 -c copy -bsf:v h264_mp4toannexb -f mpegts /var/www/hespress/17/intermediate1.ts
ffmpeg version 0.8.20-6:0.8.20-0+deb7u1, Copyright (c) 2000-2014 the Libav developers
  built on Jan 19 2017 11:13:36 with gcc 4.7.2
The ffmpeg program is only provided for script compatibility and will be removed
in a future release. It has been deprecated in the Libav project to allow for
incompatible command line syntax improvements in its replacement called avconv
(see Changelog for details). Please use avconv instead.
[aac @ 0x3938ba0] Input buffer exhausted before END element found

Seems stream 0 codec frame rate differs from container frame rate: 180000.00 (180000/1) -> 30.00 (30/1)
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from '/var/www/hespress/intro.mp4':
  Metadata:
    major_brand     : mp42
    minor_version   : 0
    compatible_brands: isommp42
    creation_time   : 2017-03-27 23:03:04
  Duration: 00:00:12.92, start: 0.000000, bitrate: 2598 kb/s
    Stream #0.0(eng): Video: h264 (Baseline), yuv420p, 1280x720, 2479 kb/s, 30 fps, 30 tbr, 90k tbn, 180k tbc
    Metadata:
      creation_time   : 2017-03-27 23:03:04
    Stream #0.1(eng): Audio: aac, 48000 Hz, mono, s16, 127 kb/s
    Metadata:
      creation_time   : 2017-03-27 23:03:04
Unrecognized option 'c'
Failed to set value 'copy' for option 'c'
root@ns205125:~# 
Ruydo
  • 305
  • 8
  • 18

1 Answers1

1

Problem

You're using the ancient, dead, buggy, broken, useless, counterfeit "ffmpeg" from Libav, not a modern, real ffmpeg from FFmpeg.

Solution

Fortunately you can easily download a recent version of the real thing and use it instead:

  1. Download

    wget https://johnvansickle.com/ffmpeg/builds/ffmpeg-git-64bit-static.tar.xz
    
  2. Extract

    tar xvf https://johnvansickle.com/ffmpeg/builds/ffmpeg-git-64bit-static.tar.xz
    
  3. Copy the binary files to /usr/local/bin

    sudo cp ffmpeg-git-*-64bit-static/ff* /usr/local/bin
    

Now you can run the ffmpeg command and it should use your downloaded version.

  1. (optional) To undo/uninstall just delete the FFmpeg binaries from /usr/local/bin.

    sudo rm -f /usr/local/bin/{ffmpeg,ffmpeg-10bit,ffprobe,ffserver}
    

Notes

  • You can keep any existing ffmpeg package from the repository for other packages that may depend on it.

  • If the ffmpeg command still executes the old, crappy version then your current shell session is remembering the old location. Run hash -r or just log-out/log-in. You'll only need to do that once.

  • If you prefer, you can compile ffmpeg instead of relying on a third-party to provide a binary.

  • If you only want or need a single user to execute ffmpeg then you can put it in ~/bin instead of /usr/local/bin. Then run source ~/.profile to refresh the PATH or just log-out/log-in (you'll only need to do this once). This also works if you do not have root or superuser privileges.

Community
  • 1
  • 1
llogan
  • 121,796
  • 28
  • 232
  • 243