ly2video icon indicating copy to clipboard operation
ly2video copied to clipboard

need support for libav-tools/avconv as alternative to ffmpeg

Open WebDrake opened this issue 11 years ago • 7 comments

[Issue description edited to avoid accidentally spreading false information.]

Sadly, the ffmpeg project forked into avconv, and Ubuntu and Debian switched to avconv. (Here is a reasonably unbiased version of the history behind this.)

So, for a 1.0 release ly2video should probably support avconv in addition to ffmpeg. Perhaps the best way to do this would be for ly2video to look for avconv first and, if not found, look for ffmpeg.

WebDrake avatar Feb 05 '13 15:02 WebDrake

Thanks a lot for the info; however I'm rather puzzled, since I seem to have a newer ffmpeg than you and there is no deprecation:

ffmpeg version 1.0.1 Copyright (c) 2000-2012 the FFmpeg developers
  built on Jan 20 2013 21:32:11 with gcc 4.7 (SUSE Linux)

Any ideas?

aspiers avatar Feb 05 '13 16:02 aspiers

I looked into this in more depth, and it seems like it's one of those lovely fork wars that crop up from time to time. The reason for the Ubuntu deprecation message is because the ffmpeg in Ubuntu/Debian is an old version of ffmpeg included in the libav distribution for backwards compatibility: see, http://blog.pkh.me/p/13-the-ffmpeg-libav-situation.html https://bugs.launchpad.net/ubuntu/+source/libav/+bug/939863

So, it's a Debian/Ubuntu ffmpeg package issue rather than an ffmpeg issue in general, but it may be that up-to-date ffmpeg is not being offered on other distros either.

In light of that, it looks like there may be a need to support both converters if ly2video is to be successfully packaged across distros. Which one is preferred for use might be made to depend on ffmpeg version number and/or on a config setting (e.g. if ffmpeg > 0.8.5 or if avconv is not available, then use ffmpeg; else use avconv).

WebDrake avatar Feb 05 '13 16:02 WebDrake

Sounds good. I'd be delighted to accept a pull request adding support for avconv ;-) It should be easy for you to figure out the correct avconv invocation:

  • Run ly2video with the -k option
  • cd to the resulting ly2video.tmp/notes directory
  • Experiment with avconv until you have a command-line which can build a video out of all the .png files in that directory

Once we know the right invocation, adding the appropriate logic to ly2video to use it where needed should be trivial.

aspiers avatar Feb 05 '13 17:02 aspiers

I'll see what I can do. Python isn't one of my languages but I guess this should not be too hard in and of itself.

WebDrake avatar Feb 05 '13 17:02 WebDrake

I've changed the issue title and description, because it seems that ffmpeg being deprecated is wholly untrue (thanks for the useful links above which explain this), and I don't want this project to help spread that notion.

aspiers avatar Feb 10 '13 11:02 aspiers

Yes, the deprecation is not of FFmpeg per se, but the fact that that package is no longer being supported in Debian (and hence, its derivatives). Fortunately the two programs, ffmpeg and avconv, seem to have identical APIs. As a temporary workaround, the following seems to suffice:

  • in the line in ly2video.py which reads, ffmpeg = options.winFfmpeg + "ffmpeg", replace this with ffmpeg = options.winFfmpeg + "avconv"
  • In the function callFfmpeg, there is a line that reads, "-i", wavPath,. Immediately after this, add another entry: "-c:a:1", "libmp3lame" (I think "-acodec", "libmp3lame" may also work).

The first of these ensures that ly2video calls avconv and not ffmpeg, and the second ensures that it is using the correct audio codec. "-c", "copy" will also work, but will embed a WAV file into the video, with all the corresponding implications for size.

WebDrake avatar Feb 10 '13 12:02 WebDrake

Debian switched to FFmpeg again in 2015, with Stretch (released in 2017).

Stemby avatar Jan 06 '18 18:01 Stemby