Page MenuHomePhabricator

ogv transcodes have broken audio tracks with ffmpeg2theora 0.29 (Trusty upstream)
Closed, ResolvedPublic

Description

example broken ogv transcode output

ogv transcodes of files with audio have broken audio tracks with ffmpeg2theora 0.29...

Depending on the player, either the video plays silently (Chrome) or it sort of explodes and stops immediately (VLC, ogv.js).

Tested on Mac OS X with libav 10.2 & ffmpeg2theora 0.29 installed via Homebrew.
Tested on Ubuntu Trusty (MediaWiki-Vagrant) with libav 9.13 and ffmpeg2theora 0.29 from distro packages.

Example command line as derived from wiki debug logs:

ffmpeg2theora '/srv/images/3/3f/Jarry_-_Métro_de_Montréal_(640×360).ogv' -V '160' -F '15' -a '-1' -H '44100' -c '2' --no-upscaling --keyint '128' --buf-delay '256' --width '284' --height '160' --aspect '284:160' -o out-160p.ogv

Note you can get that particular source video from https://upload.wikimedia.org/wikipedia/commons/3/3f/Jarry_-_M%C3%A9tro_de_Montr%C3%A9al_%28640%C3%97360%29.ogv

ffmpeg2theora 0.29's console output on Ubuntu Trusty:

[ogg @ 0xea7560] Multiple fisbone for the same stream is not implemented. Update your Libav version to the newest one from Git. If the problem still occurs, it means that your file has a feature which has not been implemented.
[ogg @ 0xea7560] 29 bytes of comment header remain
[ogg @ 0xea7560] truncated comment header, 1 comments not found
[ogg @ 0xea7560] max_analyze_duration reached
Input #0, ogg, from '/srv/images/3/3f/Jarry_-_Métro_de_Montréal_(640×360).ogv':

Duration: 00:01:50.12, start: 0.000000, bitrate: 1140 kb/s
  Stream #0.0: Data: skeleton
  Stream #0.1: Video: theora, yuv420p, 640x368, 23.98 fps, 23.98 tbn, 23.98 tbc
  Metadata:
    ENCODER         : ffmpeg2theora-0.26+svn16924
  Stream #0.2: Audio: vorbis, 48000 Hz, stereo, fltp, 125 kb/s
  Metadata:
    ENCODER         : ffmpeg2theora-0.26+svn16924
    SOURCE_OSHASH   : 96dc36c92cf57b6a
Pixel Aspect Ratio: 1.00/1   Frame Aspect Ratio: 1.77/1
Resize: 640x368 => 284x160
Resample Framerate: 23.976 => 15.000
Resample: 48000Hz => 44100Hz

[audioresample @ 0x104e500] Audio sample format conversion failed
[audioresample @ 0x104e500] Audio sample format conversion failed
.... lots more of these ....
[audioresample @ 0x104e500] Audio sample format conversion failed
[audioresample @ 0x104e500] Audio sample format conversion failed

0:01:49.93 audio: 0kbps video: 137kbps, ET: 00:00:00, est. size: 1.8 MB   
0:01:50.12 audio: 0kbps video: 137kbps, time elapsed: 00:00:08

Version: unspecified
Severity: normal
See Also:
https://bugzilla.wikimedia.org/show_bug.cgi?id=67951

Attached:

Details

Reference
bz67953

Event Timeline

bzimport raised the priority of this task from to Needs Triage.Nov 22 2014, 3:27 AM
bzimport set Reference to bz67953.
bzimport added a subscriber: Unknown Object (MLST).

ogginfo has the following to say about the attached file:

Negative or zero granulepos (0) on Vorbis stream outside of headers. This file was created by a buggy encoder
Vorbis stream 3:
Total data length: 29 bytes
Playback length: 0m:00.000s
Average bitrate: inf kb/s
Logical stream 3 ended

I've got a patch in progress to optionally use avconv/ffmpeg instead of ffmpeg2theora to produce the .ogv transcodes; it seems to work on Trusty, but still testing on more files.

Change 145990 had a related patch set uploaded by Brion VIBBER:
Optionally use avconv/ffmpeg for .ogv transcodes

https://gerrit.wikimedia.org/r/145990

Change 145990 merged by jenkins-bot:
Optionally use avconv/ffmpeg for .ogv transcodes

https://gerrit.wikimedia.org/r/145990

Resetting to new, as that's more a work around then a fix to the underlying issue.

Gilles subscribed.
brion renamed this task from ogv transcodes have broken audio tracks with ffmpeg2theora 0.29 to ogv transcodes have broken audio tracks with ffmpeg2theora 0.29 (Trusty upstream).Jul 25 2015, 1:53 AM
brion added a project: Upstream.

I've found that on Ubuntu 15.04 Vivid and Debian Jessie ffmpeg2theora crashes outright rather than giving the reams of error messages about resampling.

Can work around it there by removing the audio sample rate constraint option (-H) ... this may bump some output files up from 44.1 to 48kHz... but that workaround doesn't seem to fix things on Trusty. Sigh.

I tried this on trusty with ffmpeg2theora 0.29 from debian and an updated ffmpeg from T103335: Investigate impact of switching from ffmpeg to libav (ffmpeg is not in Jessie), with -H it similarly crashes, however without it I'm able to generate and play the file

filippo@filippo-test-trusty:~$ ffmpeg2theora Jarry_-_Métro_de_Montréal_\(640Ã%97360\).ogv -V '160' -F '15' -a '-1' -H '44100' -c '2' --no-upscaling --keyint '128' --buf-delay '256' --width '284' --height '160' --aspect '284:160' -o out-160p.ogv
Input #0, ogg, from 'Jarry_-_Métro_de_Montréal_(640Ã%97360).ogv':
  Duration: 00:01:50.12, start: 0.000000, bitrate: 1140 kb/s
    Stream #0:0: Data: none
    Stream #0:1: Video: theora, yuv420p, 640x360, 23.98 fps, 23.98 tbr, 23.98 tbn, 23.98 tbc
    Metadata:
      ENCODER         : ffmpeg2theora-0.26+svn16924
      SOURCE_OSHASH   : 96dc36c92cf57b6a
    Stream #0:2: Audio: vorbis, 48000 Hz, stereo, fltp, 125 kb/s
    Metadata:
      ENCODER         : ffmpeg2theora-0.26+svn16924
      SOURCE_OSHASH   : 96dc36c92cf57b6a
  Pixel Aspect Ratio: 1.00/1   Frame Aspect Ratio: 1.77/1
  Resize: 640x360 => 284x160
  Resample Framerate: 23.976 => 15.000
  Resample: 48000Hz => 44100Hz
[swscaler @ 0x2438e80] Warning: data is not aligned! This can lead to a speedloss
[AudioData @ 0x7fff88e61010] invalid NULL pointer for src[0]
Error while converting audio
filippo@filippo-test-trusty:~$ echo $?
1
filippo@filippo-test-trusty:~$ ffmpeg2theora Jarry_-_Métro_de_Montréal_\(640Ã%97360\).ogv -V '160' -F '15' -a '-1'  -c '2' --no-upscaling --keyint '128' --buf-delay '256' --width '284' --height '160' --aspect '284:160' -o out-160p.ogv
Input #0, ogg, from 'Jarry_-_Métro_de_Montréal_(640Ã%97360).ogv':
  Duration: 00:01:50.12, start: 0.000000, bitrate: 1140 kb/s
    Stream #0:0: Data: none
    Stream #0:1: Video: theora, yuv420p, 640x360, 23.98 fps, 23.98 tbr, 23.98 tbn, 23.98 tbc
    Metadata:
      ENCODER         : ffmpeg2theora-0.26+svn16924
      SOURCE_OSHASH   : 96dc36c92cf57b6a
    Stream #0:2: Audio: vorbis, 48000 Hz, stereo, fltp, 125 kb/s
    Metadata:
      ENCODER         : ffmpeg2theora-0.26+svn16924
      SOURCE_OSHASH   : 96dc36c92cf57b6a
  Pixel Aspect Ratio: 1.00/1   Frame Aspect Ratio: 1.77/1
  Resize: 640x360 => 284x160
  Resample Framerate: 23.976 => 15.000
[swscaler @ 0x7ece80] Warning: data is not aligned! This can lead to a speedloss
  0:01:50.15 audio: 38kbps video: 137kbps, time elapsed: 00:00:11            
  0:01:50.12 audio: 38kbps video: 137kbps, time elapsed: 00:00:11           
filippo@filippo-test-trusty:~$ ffmpeg2theora 
ffmpeg2theora 0.29

	Xiph.Org libtheora 1.1 20090822 (Thusnelda)
	Xiph.Org libVorbis 1.3.2
	FFmpeg	 libavcodec 56.41.100
	FFmpeg	 libavformat 56.36.100

Ok I've got a provisional patch for ffmpeg2theora master, which gets a local build of ffmpeg2theora working in MediaWiki-Vagrant for me. https://bugs.launchpad.net/ffmpeg2theora/+bug/1483861

Ok I've got a provisional patch for ffmpeg2theora master, which gets a local build of ffmpeg2theora working in MediaWiki-Vagrant for me. https://bugs.launchpad.net/ffmpeg2theora/+bug/1483861

nice! I've uploaded ffmpeg2theora_0.29.0~git+20150813-1 to our trusty repository, with that I was able to convert the video above too! Please give it a try

Confirmed working with updated packge in MediaWiki-Vagrant. :D

brion claimed this task.