Let me first appologize if this is a re-post/similar-post as I did my best to search for a specific solution to my issue within the already created posts on here, and on google, but could not.
I am using ffmpeg on localhost on win64 system to create/test video conversion scripts prior to uploading them to the server.
I am able to successfully convert to/from mp4/flv/wmv/mov without issue, however, whenever I try to convert to .ogg from any other format, I run into issues.
First I tried this:
exec($ffmpegPath." -i ".$srcFile." ".$destFile);
but ended up with a corrupt file without video/sound. Then I did some reading that and found some posts that said that you must explicitly enable libvorbis/libtheora when converting to .ogg, so I tried this:
$aCodec = ' -acodec libvorbis';
$vCodec = ' -vcodec libtheora';
exec($ffmpegPath." -i ".$srcFile.$aCodec.$vCodec." ".$destFile);
This time I got a valid .ogg file, with sound, however, the video output is VERY choppy. In hopes to try and find the issue, I started making edits to the exec line and ended up with this:
$ffmpegObj = new ffmpeg_movie($srcFile);
$srcVB = intval($ffmpegObj->getVideoBitRate());
$vCodec = ' -vcodec libtheora';
exec($ffmpegPath." -i ".$srcFile.$vCodec." -vb ".$srcVB." ".$destFile);
which outputs the .ogg video in good quality but without sound.
Any ideas as to what else may be this issue prior to needing to install further software (ffmpeg2theora), etc.?
Also, if it helps, I echoed out the output from ffmpeg and when approach #2 above is used and many errors are displayed.
100 buffers queued in output stream 0:1, something may be wrong.
[ogg @ 00000000024bf780] st:0 PTS: 6743 DTS: 6743 < 7745 invalid, clipping
[ogg @ 00000000024bf780] st:0 PTS: 6871 DTS: 6871 < 7746 invalid, clipping
[ogg @ 00000000024bf780] st:0 PTS: 6999 DTS: 6999 < 7747 invalid, clipping
[ogg @ 00000000024bf780] st:0 PTS: 7127 DTS: 7127 < 7748 invalid, clipping
[ogg @ 00000000024bf780] st:0 PTS: 7255 DTS: 7255 < 7749 invalid, clipping
[ogg @ 00000000024bf780] st:0 PTS: 7383 DTS: 7383 < 7750 invalid, clipping
It seems that libvorbis and libtheora are not playing nice together?
Finally, I have changed ffmpeg.exe builds several times and still receive the same issue.
Thanks in advance.
EDIT: As a possible workaround, is there a way I can simply encode the video / audio separately and then slap them back together? Would this cause possible audio/video sync issues?