I posted about this on Stack Overflow, but I actually got zero responses, so hopefully I can get help here.
I wasn't sure if this should be posted under Video Streaming or Conversion, so if it needs to be moved I understand.
First let me paste what I posted at SO:
Ultimately, all I need is to make sure that the videos can be played across all major browsers and such (of course), so any help to lead me toward that goal is very much appreciated. Hopefully it can be as simple as having a working ffmpeg command line.I have a media site where I can upload video files. After upload, they are converted to MP4 using ffmpeg and then ffmpeg2theora converts that to OGV.
I have recently discovered that some videos that I upload do not play any sound when using the HTML5 player in Firefox/Chrome, but do have sound when using the fallback Flash player in IE.
I've downloaded and checked the processed files and they both still have sound, so the issue seems to be related to the HTML5 player rather than loss of audio during processing.
I double-checked my ffmpeg command line and realized I didn't specify any audio options:
ffmpeg2 -i "inputfile" -vcodec libx264 -profile:v baseline -level 3 "outputfile" 2>&1'
Since only some of the files didn't play audio while some did, this led me to believe that the audio track was being copied directly during the processing and if the original file didn't have audio supported by HTML5, then it output file would have the same result.
I realized this means I have to force re-encoding of the audio stream, so I tried a few things but had no success with any.
I tried 'libfaac' as many online posts suggested, but this resulted in an 'unknown codec' error. Further reading led me to find that 'libfaac' was no longer included with ffmpeg builds. I must have gotten mine after that.
I tried the "Native AAC" codec by simply using the following options:
ffmpeg2 -i "inputfile" -vcodec libx264 -profile:v baseline -level 3 -acodec aac "outputfile" 2>&1'
With this I got the following error: "Error while opening encoder for output stream #0:1 - maybe incorrect parameters such as bit_rate, rate, width or height".
The only codec that didn't give me some sort of error was 'libvo_aacenc'. However, even though the processing completed without error, I still got no audio when played in the HTML5 player.
What am I doing wrong?
NOTE (just in case this is relevant): This is currently being run on a Windows host using the ffmpeg executable, but we will soon be moving to a Linux host.
Thanks.
UPDATE:
I just noticed that I'm having the same problem with audio files. Some I can hear and some I can't.
+ Reply to Thread
Results 1 to 5 of 5
-
Last edited by vertigoelectric; 9th May 2013 at 14:26.
-
I tried 'libfaac' as many online posts suggested, but this resulted in an 'unknown codec' error. Further reading led me to find that 'libfaac' was no longer included with ffmpeg builds.
ffmpeg2 -i "inputfile" -vcodec libx264 -profile:v baseline -level 3 -acodec aac "outputfile" 2>&1'
With this I got the following error: "Error while opening encoder for output stream #0:1 - maybe incorrect parameters such as bit_rate, rate, width or height".
The only codec that didn't give me some sort of error was 'libvo_aacenc'. However, even though the processing completed without error, I still got no audio when played in the HTML5 player.
What am I doing wrong?
+ I Agree with Budman1 a working and a not working sample could help.
Cu Selur
Ps.: I would recommend to remux the output with mp4box since, ffmpegs mp4s tend to cause problems. -
Hey guys. I really appreciate your help, but after jumping the gun in assuming that something was wrong with the file, it seems that it's only doing this on MY computer... so it's my browser or PC that is the culprit. I'm so sorry for wasting your time and sincerely appreciate the time you put into trying to help.
-
This probably doesn't help, but I've found a lot of inconsistency with ffmpeg based encoders. For a linux example, I've found that using the file export/convert function in openshot has successfully converted a number of video files that nothing else I've tried would work on. Including other encoders that use ffmpeg.
Similar Threads
-
My Galaxy S II phone doesn't play video (html5)
By yunakokimama in forum Portable VideoReplies: 6Last Post: 5th Mar 2013, 10:01 -
HTML5 Video Between Browsers
By kerb in forum Video Streaming DownloadingReplies: 10Last Post: 4th May 2012, 01:24 -
Can I save a Video/Audio being played on WMP/VLC/KMPlayer?
By ConverterCrazy in forum Newbie / General discussionsReplies: 2Last Post: 12th Jul 2011, 00:27 -
Capturing a video with ffmpeg does not output audio when played
By oban in forum Capturing and VCRReplies: 0Last Post: 3rd Jun 2011, 10:11 -
Audio goes out of sync as video is played
By Ensign in forum AudioReplies: 6Last Post: 19th May 2008, 16:51