<p>You should specify the audio codec, e.g. <code>-c:a libvo_aacenc</code>.</p>

CC BY-SA 3.0
2015-12-24T04:14:39.840Z
1) Not necessary. If not specified, AAC is implicitly effected for MP4 container. 2)The internal AAC encoder is now stable (since Dec 5 build) and preferable to the VO encoder
Gyan
CC BY-SA 3.0
2015-12-24T10:53:22.783Z
@Mulvya, that depends on the AVI's audio codec and the ffmpeg version. AAC is *not* an mp4 requirement, you can mux into an mp4 container practically any streaming format. It is true that ffmpeg will default to AAC when your source is a raw stream, but not when the source is already encoded (notwithstanding some subtle differences between ffmpeg versions). The result is a valid mp4 file which can not be played on a player that expects only h.264+aac. I usually prefer to first get the command line fixed, only if it still doesn't work then the OP should go into diagnosing by sending the dumps.
avnr
CC BY-SA 3.0
2015-12-24T11:56:12.063Z
Let me repeat for clarity: if no audio parameters are specified and the output container is MP4, then ffmpeg will encode the audio using the highest priority AAC encoder it has. This is not dependent on whether the source audio is PCM/MP3/other. I did not say AAC is a MP4 requirement, am only referring to ffmpeg's behaviour.
Gyan
CC BY-SA 3.0
2015-12-23T20:59:18.583Z
2015-12-23T20:59:18.583Z
avnr
<p>I'm trying to convert a video file from AVI to MP4 but it doesn't seem to play, my code:</p>

<pre><code>exec("ffmpeg -i ".$video." -c:v libx264 -pix_fmt yuv420p -movflags faststart ".$withoutExt.".mp4")
</code></pre>

<p>Even plain code:</p>

<pre><code>exec("ffmpeg -i ".$video." ".$withoutExt.".mp4")
</code></pre>

<p>Any ideas please and thanks in advance.</p>

CC BY-SA 3.0
2015-12-23T08:43:52.373Z
Paste full console output of the executed command.
Gyan
CC BY-SA 3.0
2015-12-23T08:55:40.453Z
@Mulvya actually with the plain version, I get Output file #0 does not contain any stream
Shina
CC BY-SA 3.0
2015-12-23T09:25:08.533Z
Can't diagnose issue without console output. Add `-report` option to generate a log file.
Gyan
CC BY-SA 3.0
2015-12-23T17:07:22.037Z
As an alternative, what's in the AVI file? Please [edit] and paste [MediaInfo](http://mediaarea.net/en/MediaInfo) of the file.
LiveWireBT
CC BY-SA 3.0
2015-12-23T18:21:31.150Z
The full, complete ffmpeg console output would be more informative than mediainfo output.
llogan
<video><ffmpeg><webvideos>
ffmpeg trying to convert AVI to MP4 but not playing
Shina
# ffmpeg trying to convert AVI to MP4 but not playing

(Asked by: username_0 on 2015-12-23)

I'm trying to convert a video file from AVI to MP4 but it doesn't seem to play, my code:
exec("ffmpeg -i ".$video." -c:v libx264 -pix_fmt yuv420p -movflags faststart ".$withoutExt.".mp4")

Even plain code:
exec("ffmpeg -i ".$video." ".$withoutExt.".mp4")

Any ideas please and thanks in advance.

**Tags:** video, ffmpeg, webvideos

> **Comments:**
> **username_1**: Paste full console output of the executed command.  
> **username_0**: @Mulvya actually with the plain version, I get Output file #0 does not contain any stream  
> **username_1**: Can't diagnose issue without console output. Add `-report` option to generate a log file.  
> **username_2**: As an alternative, what's in the AVI file? Please [edit] and paste [MediaInfo](http://mediaarea.net/en/MediaInfo) of the file.  
> **username_3**: The full, complete ffmpeg console output would be more informative than mediainfo output.  

---

## 1 answers

### Answer by username_4 on 2015-12-23. Score: 1

You should specify the audio codec, e.g. `-c:a libvo_aacenc`.

> **Comments:**
> **username_1**: 1) Not necessary. If not specified, AAC is implicitly effected for MP4 container. 2)The internal AAC encoder is now stable (since Dec 5 build) and preferable to the VO encoder  
> **username_4**: @Mulvya, that depends on the AVI's audio codec and the ffmpeg version. AAC is *not* an mp4 requirement, you can mux into an mp4 container practically any streaming format. It is true that ffmpeg will default to AAC when your source is a raw stream, but not when the source is already encoded (notwithstanding some subtle differences between ffmpeg versions). The result is a valid mp4 file which can not be played on a player that expects only h.264+aac. I usually prefer to first get the command line fixed, only if it still doesn't work then the OP should go into diagnosing by sending the dumps.  
> **username_1**: Let me repeat for clarity: if no audio parameters are specified and the output container is MP4, then ffmpeg will encode the audio using the highest priority AAC encoder it has. This is not dependent on whether the source audio is PCM/MP3/other. I did not say AAC is a MP4 requirement, am only referring to ffmpeg's behaviour.  

---

