EDIT: I have seen this question: avconv creates zero byte file while trying to downsample mp4 video Unfortunately, it's not the same problem.

I'm trying to use avconv in conjunction with a website on a Linux Ubuntu server to save an uploaded video twice, once as an ogg and again as an mp4 (trying to cover all browser compatibilities).

I've never used avconv (or heck, even used shell with PHP before), so I am quite the novice here. But I've managed to piece together a fair amount from Google.

Just to test if things are working, I'm not running a PHP shell_exec just yet - I'm running avconv directly from the command line on the server.

Here's the problem: no matter what kind of video I create, when I navigate to the video path in my browser, I'm getting the error that the video file is corrupt and can't be played.

When I download the video file(s) to check, I see their size is zero bytes, whereas the original is 4.3MB.

I'm sure I'm just missing some parameter or another - I don't think I'm specifying an exact codec to use, for example - but I'm novice enough that I just don't know where to go from here.

Here's the command I'm currently using:

avconv -i /path/video.mp4 -vn /path/video.ogg

I've also tried saving the mp4 as ANOTHER mp4, with the same result - a corrupted file.

I've tried a variety of other options, but I get a lot of results for FFmpeg rather than avconv, some of which seem to work, and others which seem not to work.

Here's the avconv output in Terminal:

avconv version 0.8.17-4:0.8.17-0ubuntu0.12.04.1, Copyright (c) 2000-2014 the Libav developers
  built on Mar 16 2015 13:26:50 with gcc 4.6.3
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from '/path/video.mp4':
    major_brand     : isom
    minor_version   : 512
    compatible_brands: isomiso2avc1mp41
    encoder         : Lavf54.4.100
  Duration: 00:00:46.54, start: 0.000000, bitrate: 741 kb/s
    Stream #0.0(und): Video: h264 (High), yuv420p, 640x264 [PAR 127:128 DAR 635:264], 608 kb/s, 23.98 fps, 23.98 tbr, 24k tbn, 47.95 tbc
Stream #0.1(und): Audio: aac, 44100 Hz, stereo, s16, 128 kb/s
File '/path/video.ogg' already exists. Overwrite ? [y/N] y
Output #0, ogg, to '/path/video.ogg':
    major_brand     : isom
    minor_version   : 512
    compatible_brands: isomiso2avc1mp41
    encoder         : Lavf53.21.1
    Stream #0.0(und): Audio: flac, 44100 Hz, stereo, s16, 200 kb/s
Stream mapping:
  Stream #0:1 -> #0:0 (aac -> flac)
Press ctrl-c to stop encoding
size=    3875kB time=46.60 bitrate= 681.2kbits/s    
video:0kB audio:3858kB global headers:0kB muxing overhead 0.445476%

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.