<div dir="ltr"><div><div>Francois, I know the background, thanks. I wasn't expecting correct behaviour manually changing headers ;)</div><div><br></div><div>Paul, maybe it was like that somewhere, but anyway, now I use compiled version of FFmpeg from git, and this is the setup on which this problems occur.</div><div><br></div><div>Robin, thanks, I know. Like I've said, I use compiled version of FFmpeg, in my setup there is no avconv command working, ffmpeg command works. I suppose that I'm on the right list.</div><div><br></div><div>Paul once again, let me clarify. Firstly, some background. Janus records audio and video streams separately, in two .mjr files. Only known me way to convert this files to more useful format is to use built-in janus postprocessing tool called janus-pp-rec. It turns video files into .webm ones and audio files into .opus ones. The problem is that sometimes converted files have different lengths, and combining them using ffmpeg results in out-of sync audio and video. Tests involving recording a stopwatch has shown that videos have correct length, so I assume that it's something wrong with audio. That's why we have tried to change previous way of converting .mjr audio to .opus audio from libogg (<a href="https://xiph.org/ogg/">https://xiph.org/ogg/</a>) to FFmpeg libraries, what you can check in this file: <a href="https://github.com/meetecho/janus-gateway/blob/pprec-opus-libav/postprocessing/pp-opus.c">https://github.com/meetecho/janus-gateway/blob/pprec-opus-libav/postprocessing/pp-opus.c</a> starting from 90 line. Probably it would be good to add avcodec_register_all() function call to the code before testing - I did it, but it's not yet pushed to git. Unfortunately files generated using FFmpeg libraries are corrupted - they can't be played, ffprobe and opusinfo claim that there is something wrong with them - exact output is attached to previous mail. So my question is - do you have an idea why FFmpeg generated files are corrupted and what I can possibly do to fix it.</div><div>Answering to your question "Does same problem arise with ffmpeg program?" - I suppose that you ask me what happens when I try to convert .mjr file using ffmpeg command. I couldn't manage to get it working, ffmpeg just says "Invalid data found when processing input" when you pass it .mjr file.</div><div><br></div><div>Exact steps to reproduce the issue (assuming that you have ffmpeg installed) - quick way:</div><div><br></div><div>1. Install janus from ffmpeg conversion branch, ie:</div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">cd /dir/where/you/keep/stuff/<br>git clone <a href="https://github.com/meetecho/janus-gateway.git">https://github.com/meetecho/janus-gateway.git</a><br>cd janus-gateway<br>git checkout pprec-opus-libav<br>sh autogen.sh<br>./configure --prefix=/opt/janus --enable-post-processing --disable-websockets --disable-data-channels --disable-rabbitmq --disable-docs<br>make<br>checkinstall -y --pkgversion="1.0.0" #or pure make install if you prefer<br>make configs</blockquote><div><br></div><div>2. convert sample janus data:</div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">cd /opt/janus/share/janus/recordings # it may be in some other dir in your system, it's default in mine<br>JANUS_PPREC_NOLIBOGG=1 /dir/where/you/keep/stuff/janus-gateway/janus-pp-rec ./rec-sample-audio.mjr ./rec-sample-audio-ffmpeg.opus # using ffmpeg - generated file won't work<br>/dir/where/you/keep/stuff/janus-gateway/janus-pp-rec ./rec-sample-audio.mjr ./rec-sample-audio-libogg.opus # using libogg - generated file will work, but most probably will introduce missync into merged media</blockquote><div><br></div><div>3. check out that ffmpeg generated audio doesn't work.</div><div><br></div><div><br></div><div>Exact steps to reproduce the issue (assuming that you have ffmpeg installed) generating your own files and seeing that they are out of sync:</div><div><br></div><div>1. - like before.</div><div><br></div><div>2. run janus and his demos server, ie:</div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">cd /dir/where/you/keep/stuff/janus-gateway<br>screen -dmS "janus-gateway" ./janus<br>cd /dir/where/you/keep/stuff//janus-gateway/html<br>screen -dmS "janus-web" python -m SimpleHTTPServer 8000</blockquote><div><br></div><div>3. record some stuff (you wouldn't get out-of sync media recording locally, use another host):</div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">open in your browser http://{janus-host-ip}:8000/recordplaytest.html<br>record some media (if you want to see that media lengths differs make it >40 min)<br>make yourself a tea, whatever<br>stop recording</blockquote><div><br></div><div>4. convert recorded audio and video</div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">cd /opt/janus/share/janus/recordings # it may be in some other dir in your system, it's default in mine<br>JANUS_PPREC_NOLIBOGG=1 /dir/where/you/keep/stuff/janus-gateway/janus-pp-rec ./{new-audio-filename} ./rec-audio-ffmpeg.opus # using ffmpeg - generated file won't work<br>/dir/where/you/keep/stuff/janus-gateway/janus-pp-rec ./{new-audio-filename./rec-sample-audio-libogg.opus # using libogg - generated file will work, but most probably will introduce missync into merged media<br>/dir/where/you/keep/stuff/janus-gateway/janus-pp-rec ./{new-video-filename./rec-sample-video.webm</blockquote><div><br></div><div>5. do some ffmpeg manipulation:</div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">webRTC changes video resolution to fit the stream size in presumed bitrate - that makes some players confused - ie VLC crashes - prevent it by re-encoding video:<br>ffmpeg -i rec-sample-video.webm -c:v libx264 converted.mp4<br>merge audio and video:<br>ffmpeg -i converted.mp4 -i rec-sample-audio-libogg.opus -c:v copy -c:a aac -strict experimental -y shifted2.mp4 # I used libogg audio here to show the problem - ffmpeg audio doesn't work at all</blockquote><div><br></div><div>6. check that merged data is out-of-sync, see that ffmpeg audio doesn't work, see that audio and video lengths differ, etc.</div><div><br></div><div><br></div><div>Well, that's it.</div></div><div><br></div><div><br></div><div class="gmail_extra"><br><div class="gmail_quote">2015-07-09 17:21 GMT+02:00 Robin Stevens <span dir="ltr"><<a href="mailto:rdstevens@gmail.com" target="_blank">rdstevens@gmail.com</a>></span>:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">On Thu, Jul 9, 2015 at 4:05 PM, Talgorn François-Xavier<br>
<<a href="mailto:fxtalgorn-at-yahoo.fr@ffmpeg.org">fxtalgorn-at-yahoo.fr@ffmpeg.org</a>> wrote:<br>
<br>
...some very useful stuff...<br>
<br>
<br>
<br>
The naming situation is confusing.<br>
<br>
As I understand it, it goes like this (fingers crossed this table<br>
formatting doesn't get mangled):<br>
<br>
PROJECT    COMMANDLINE    LIBS         RESIDES          MAILINGLIST<br>
FFmpeg           ffmpeg(.exe)          libav*        <a href="http://ffmpeg.org" rel="noreferrer" target="_blank">ffmpeg.org</a><br>
ffmpeg-devel, libav-user<br>
Libav                 avconv(.exe)          libav*        <a href="http://libav.org" rel="noreferrer" target="_blank">libav.org</a><br>
       libav-devel, libav-api<br>
<br>
So you can see there is a lot of overlap between names.<br>
<br>
The PROJECT known as FFmpeg came first, the Libav project was forked a<br>
while ago.<br>
<br>
Some Linux distros use FFmpeg, some use Libav.<br>
<br>
A quick and dirty test: try to run ffmpeg -i at the command line. If<br>
it works, you're probably on the right mailing list.<br>
<br>
Try to run avconv at the command line. If *that* works, you probably<br>
need to find a different mailling list.<br>
<br>
<br>
<br>
Cheers,<br>
Rob<br>
<div class=""><div class="h5">_______________________________________________<br>
Libav-user mailing list<br>
<a href="mailto:Libav-user@ffmpeg.org">Libav-user@ffmpeg.org</a><br>
<a href="http://ffmpeg.org/mailman/listinfo/libav-user" rel="noreferrer" target="_blank">http://ffmpeg.org/mailman/listinfo/libav-user</a><br>
</div></div></blockquote></div><br></div></div>