<div dir="ltr"><div>Thanks Francois. </div><div>Well, Paul wrote that "From that conversation it is evident you are using Libav and not FFmpeg. And so we can not help you." and "From that conversation it is evident you are using Libav and not FFmpeg. And so we can not help you.". </div><div>The thing that makes me confused is that I have not installed any Libav resources, but I have installed ffmpeg and janus using this script (which is included in this conversation from which is somehow evident that I am not using FFmpeg but Libav) on a fresh install of ubuntu 14.04.2 :<br></div><div><br></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">#!/bin/bash<br>aptitude update<br>aptitude -y full-upgrade<br>aptitude -y install libmicrohttpd-dev libjansson-dev libnice-dev \<br>    libssl-dev libsrtp-dev libsofia-sip-ua-dev libglib2.0-dev \<br>    libopus-dev libogg-dev libini-config-dev libcollection-dev \<br>    pkg-config gengetopt libtool automake checkinstall git yasm<br></blockquote><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"> </blockquote><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<br>git clone git://<a href="http://source.ffmpeg.org/ffmpeg">source.ffmpeg.org/ffmpeg</a><br>cd ~/ffmpeg<br>./configure --enable-libopus<br>make<br>checkinstall -y --pkgversion="1.0.0"<br></blockquote><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"> </blockquote><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<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"<br>make configs</blockquote><div><br></div><div>Moreover, sites:</div><div><br></div><div><a href="http://trac.ffmpeg.org/wiki/Using%20libav*">http://trac.ffmpeg.org/wiki/Using%20libav*</a></div><div><a href="https://www.ffmpeg.org/libavcodec.html">https://www.ffmpeg.org/libavcodec.html</a></div><div><a href="https://www.ffmpeg.org/libavformat.html">https://www.ffmpeg.org/libavformat.html</a></div><div><br></div><div>claims that FFmpeg developers are authors of FFmpeg included libavcodec and libavformat libraries, and this libraries are part of the FFmpeg.</div><div>Name of this list stands as "libav-user - For questions about using the FFmpeg libraries and API :  This list is about using libavcodec, libavformat, libavutil, libavdevice and libavfilter."</div><div><br></div><div>To clarify - am I mailing the right list? I thought that I was using FFmpeg API. If not, I could mail Libav mail lists also.</div><div><br></div><div><br></div><div>Concerning your suggestions - I added avcodec_register_all() to the code before, but as it had not changed anything I haven't pushed that changes. Sorry for not informing you about it.</div><div><br></div><div>As you can see in the install script, I compile FFmpeg with libopus enabled, and FFmpeg general documentation (<a href="https://www.ffmpeg.org/general.html">https://www.ffmpeg.org/general.html</a>) declares that ogg support is provided out of the box.</div><div><br></div><div>I'll take a look atav_packet_rescale_ts() function, but before going to that point, I would like to generate working .opus file using FFmpeg libraries.</div><div><br></div><div>I'm wondering if ffmpeg .opus headers are created correctly in this case. After not very elegant operation, which was manually replacing in vim ffmpeg generated header by this generated by libogg, I got pretty different results.</div><div><br></div><div>opusinfo output for file generated using ffmpeg libraries:</div><div><br></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">New logical stream (#1, serial: 550f772e): type unknown<br></blockquote><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">Logical stream 1 ended</blockquote><div><br></div><div>ffprobe output for file generated using ffmpeg libraries:</div><div><br></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">[ogg @ 0x3449c40] Codec not found<br>audio_nolibogg.opus: End of file</blockquote><div><br></div><div>opusinfo output for file generated using libogg:</div><div><br></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">New logical stream (#1, serial: 6b8b4567): type opus<br>WARNING: Implausibly low preskip in Opus stream (1)<br>Encoded with Janus post-processing<br>WARNING: Sample count behind granule (35228160>35301120) in stream 1<br>WARNING: Sample count behind granule (35281920>35374080) in stream 1<br>[...]<br>[~3.5k of warnings]<br>[...]<br>WARNING: Sample count behind granule (231806400>231929280) in stream 1<br>WARNING: Sample count behind granule (231860160>231983040) in stream 1<br>WARNING: EOS not set on stream 1 (normal for live streams)<br>Opus stream 1:<br><span class="" style="white-space:pre">  </span>Pre-skip: 0<br><span class="" style="white-space:pre">     </span>Playback gain: 0 dB<br><span class="" style="white-space:pre">     </span>Channels: 2<br><span class="" style="white-space:pre">     </span>Original sample rate: 48000Hz<br><span class="" style="white-space:pre">   </span>Packet duration:   20.0ms (max),   20.0ms (avg),   20.0ms (min)<br><span class="" style="white-space:pre">      </span>Page duration:   1180.0ms (max), 1127.0ms (avg), 1000.0ms (min)<br><span class="" style="white-space:pre">        </span>Total data length: 18074102 bytes (overhead: 1.98%)<br><span class="" style="white-space:pre">     </span>Playback length: 80m:32.979s<br><span class="" style="white-space:pre">    </span>Average bitrate: 29.92 kb/s, w/o overhead: 29.33 kb/s</blockquote><div><br></div><div>ffprobe output for file generated using libogg:</div><div><br></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">Input #0, ogg, from 'rec-2215547545-audio-libogg.opus':<br>  Duration: 01:20:32.98, start: 0.000000, bitrate: 29 kb/s<br>    Stream #0:0: Audio: opus, 48000 Hz, stereo, fltp</blockquote><div><br></div><div><br></div><div>opusinfo output for file generated using ffmpeg libraries, but with header manually force-replaced with libogg header:</div><div><br></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">WARNING: Hole in data (50 bytes) found at approximate offset 9000 bytes. Corrupted Ogg.<br>WARNING: Hole in data (31 bytes) found at approximate offset 9000 bytes. Corrupted Ogg.<br>[...]<br>[~100 lines of warnings]<br>[...]<br>WARNING: Hole in data (608 bytes) found at approximate offset 22500 bytes. Corrupted Ogg.<br>WARNING: Invalid header page, no packet found<br>WARNING: Invalid header page in stream 1, contains multiple packets<br>New logical stream (#1, serial: dabc9752): type invalid<br>WARNING: stream start flag not set on stream 1<br>Logical stream 1 ended</blockquote><div><br></div><div>ffprobe output for file generated using ffmpeg libraries, but with header manually force-replaced with libogg header:</div><div><br></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">rec-2215547545-audio-nolibogg.opus: Invalid data found when processing input</blockquote><div> </div><div><br></div><div>Despite replacing headers file is still not playable. (what is not really surprising) </div><div><br></div><div><br></div><div>Best regards,</div><div><br></div><div>Mateusz </div><div><br></div><div><br></div><div><br></div><div><br></div><div><br></div><div><br></div><div><br></div><div><br></div><div><br></div><div><br></div></div><div class="gmail_extra"><br><div class="gmail_quote">2015-07-08 21:46 GMT+02:00 Talgorn François-Xavier <span dir="ltr"><<a href="mailto:fxtalgorn-at-yahoo.fr@ffmpeg.org" target="_blank">fxtalgorn-at-yahoo.fr@ffmpeg.org</a>></span>:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div style="word-wrap:break-word">I agree with you Mateusz, FFMPEG makes use of libav. If I remember well, it is built on libav + proper extensions.<div>It is true that FFMPEG does everything that libav does, and more, but that would be sectarian to say that this mailing list can not help you.</div><div>Technically, we can.</div><div><div class="h5"><div><br></div><div><br><div><br></div><div><br><div><div>Le 8 juil. 2015 à 21:17, Mateusz Koslacz <<a href="mailto:mateusz.koslacz@4vod.tv" target="_blank">mateusz.koslacz@4vod.tv</a>> a écrit :</div><br><blockquote type="cite"><div dir="ltr">Well, so why list I'm mailing is called "Libav-user -- This list is about using libavcodec, libavformat, libavutil, libavdevice and libavfilter.", if you can't help me if I use Libav?<div class="gmail_extra"><br><div class="gmail_quote">2015-07-08 19:26 GMT+02:00 Paul B Mahol <span dir="ltr"><<a href="mailto:onemda@gmail.com" target="_blank">onemda@gmail.com</a>></span>:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><p><br>
Dana 8. 7. 2015. 15:05 osoba "Mateusz Koslacz" <<a href="mailto:mateusz.koslacz@4vod.tv" target="_blank">mateusz.koslacz@4vod.tv</a>> napisala je:</p><div><div><br>
><br>
> Hi,<br>
><br>
> In our project we use janus-gateway (<a href="http://janus.conf.meetecho.com/" target="_blank">http://janus.conf.meetecho.com/</a>) as a webRTC gateway and also as a stream recorder. We are on the tests stage of our project, and after very long development time we have ecountered a bug that is a blocker for whole project. After real tests of recording streams using janus we realized that audio and video are out of sync in recordings, despite of fact, that live they are perfectly in sync.<br>
><br>
> Janus records two *.mjr files for each recording - one for video, and one for audio. Janus also provides own converter to convert this files to *.webm for video and *.opus for audio. After that, we use ffmpeg to merge this files. By recording stopwatch view on the stream we concluded, that video has correct length and speed, so most probably this is something wrong with audio recording or converting.<br>
><br>
> Firstly, janus was using libogg for converting *.mjr audio to *.opus. Regarding described issues author decided to switch to libav audio processing. You can check how it's done in this file <a href="https://github.com/meetecho/janus-gateway/blob/pprec-opus-libav/postprocessing/pp-opus.c" target="_blank">https://github.com/meetecho/janus-gateway/blob/pprec-opus-libav/postprocessing/pp-opus.c</a> starting from 90 line.<br>
><br>
> Returned data is a lil bit smaller than data obtained using libogg:<br>
><br>
>> -rw-r--r-- 1 mateusz mateusz  17987445 lip  8 11:58 rec-2215547545-audio-nolibogg.opus<br>
>> -rw-r--r-- 1 mateusz mateusz 221841174 lip  8 11:56 rec-2215547545-video.webm<br>
>> -rw-r--r-- 1 mateusz mateusz  18074102 lip  8 11:52 rec-2215547545-audio-libogg.opus<br>
><br>
><br>
> Unfortunately, returned data is somehow corrupted - ffprobe results for libav processing output:<br>
><br>
>> [ogg @ 0x4336540] Codec not found<br>
>> rec-2215547545-audio-nolibogg.opus: End of file<br>
><br>
><br>
> and for compare, for libogg version:<br>
><br>
>> Input #0, ogg, from 'rec-2215547545-audio-libogg.opus':<br>
>>   Duration: 01:20:32.98, start: 0.000000, bitrate: 29 kb/s<br>
>>     Stream #0:0: Audio: opus, 48000 Hz, stereo, fltp<br>
><br>
><br>
> Moreover, no player can play this file - VLC just does nothing, and Rythmbox says "Can't play file: {null}".<br>
><br>
><br>
> Is this because of improper use of libav api, or maybe it is some libav bug? How could we possibly overcome this problems?<br>
><br>
> For more details you can read our whole conversation with janus author here:<br>
> <a href="https://groups.google.com/forum/#!topic/meetecho-janus/lMCtBm7VbMY" target="_blank">https://groups.google.com/forum/#!topic/meetecho-janus/lMCtBm7VbMY</a><br>
><br>
></div></div><div><br></div><p>From that conversation it is evident you are using Libav and not FFmpeg. And so we can not help you.</p><p>> Regards,<br>
><br>
> Mateusz Koślacz<br>
><br>
> _______________________________________________<br>
> Libav-user mailing list<br>
> <a href="mailto:Libav-user@ffmpeg.org" target="_blank">Libav-user@ffmpeg.org</a><br>
> <a href="http://ffmpeg.org/mailman/listinfo/libav-user" target="_blank">http://ffmpeg.org/mailman/listinfo/libav-user</a><br>
><br>
</p>
<br>_______________________________________________<br>
Libav-user mailing list<br>
<a href="mailto:Libav-user@ffmpeg.org" target="_blank">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>
<br></blockquote></div><br></div></div>
_______________________________________________<br>Libav-user mailing list<br><a href="mailto:Libav-user@ffmpeg.org" target="_blank">Libav-user@ffmpeg.org</a><br><a href="http://ffmpeg.org/mailman/listinfo/libav-user" target="_blank">http://ffmpeg.org/mailman/listinfo/libav-user</a><br></blockquote></div><br></div></div></div></div></div><br>_______________________________________________<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>
<br></blockquote></div><br></div>