<?xml version="1.0" encoding="UTF-8" ?>

<bugzilla version="5.2"
          urlbase="https://bugzilla.altlinux.org/"
          
          maintainer="jenya@basealt.ru"
>

    <bug>
          <bug_id>29533</bug_id>
          
          <creation_ts>2013-10-28 20:24:21 +0400</creation_ts>
          <short_desc>Утечка памяти при стриминге с перекодированием</short_desc>
          <delta_ts>2018-11-08 15:12:51 +0300</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>4</classification_id>
          <classification>Development</classification>
          <product>Sisyphus</product>
          <component>vlc</component>
          <version>unstable</version>
          <rep_platform>all</rep_platform>
          <op_sys>Linux</op_sys>
          <bug_status>CLOSED</bug_status>
          <resolution>WORKSFORME</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>P3</priority>
          <bug_severity>critical</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Alexei Takaseev">taf</reporter>
          <assigned_to name="Anton Farygin">rider</assigned_to>
          <cc>darktemplar</cc>
    
    <cc>rider</cc>
    
    <cc>sbolshakov</cc>
          
          <qa_contact>qa-sisyphus</qa_contact>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>143510</commentid>
    <comment_count>0</comment_count>
    <who name="Alexei Takaseev">taf</who>
    <bug_when>2013-10-28 20:24:21 +0400</bug_when>
    <thetext>стриминг с перекодированием производится такой командой:

cvlc -vvvvv udp://@233.0.0.101:16384 --sout &apos;#transcode{vcodec=mp2v,vb=30,fps=25}:rtp{mux=ts,dst=233.0.0.21,port=16384,sdp=sap://}&apos;

Через какое-то время в консоль начинает активно сыпать ошибками:

[0x7f94e4001188] avcodec encoder warning: almost fed libavcodec with two frames with the same PTS (31636825825)
[0x7f94e4001188] avcodec encoder warning: almost fed libavcodec with two frames with the same PTS (31636865825)
[0x7f94e4001188] avcodec encoder warning: almost fed libavcodec with two frames with the same PTS (31636905825)
[0x7f94e4001188] avcodec encoder warning: almost fed libavcodec with two frames with the same PTS (31636945825)
[0x7f94e4001188] avcodec encoder warning: almost fed libavcodec with two frames with the same PTS (31636985825)
[0x7fc84c008be8] stream_out_transcode stream out debug: drift is too high (100053, resetting master sync


В момент появления этих ожибок процесс vlc скачкообразно занимает себе виртуальную память до совсем неприличных размеров (фиксировались случаи до 300 Гигабайт). 

После появления сообщения &quot;resetting master sync&quot; занимаемая память расти перестает, но и не освобождается. При последующих потоках ошибок снова начинается рост.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>143515</commentid>
    <comment_count>1</comment_count>
    <who name="Sergey Bolshakov">sbolshakov</who>
    <bug_when>2013-10-29 14:19:49 +0400</bug_when>
    <thetext>это актуальный сизиф ?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>143522</commentid>
    <comment_count>2</comment_count>
    <who name="Alexei Takaseev">taf</who>
    <bug_when>2013-10-30 04:53:39 +0400</bug_when>
    <thetext>Да.
vlc-2.1.0-alt1

Аналогичная проблема и на p7.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>143525</commentid>
    <comment_count>3</comment_count>
    <who name="Sergey Bolshakov">sbolshakov</who>
    <bug_when>2013-10-30 13:58:03 +0400</bug_when>
    <thetext>поток откуда ? (какое устройство или что там)
если делать в два приёма: капчить на диск, потом транскодировать -- повторяется ?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>143549</commentid>
    <comment_count>4</comment_count>
    <who name="Alexei Takaseev">taf</who>
    <bug_when>2013-10-31 08:08:13 +0400</bug_when>
    <thetext>Источник стример IPTV IPS-01 (http://www.stv.odessa.ua/ru/oborudovanie-dlja-organizatsii-tsifrovogo-veschanija/39-uncategorised/58-ip-streamer-ips-01.html) Потребитель выходного потока модулятор DVB-C.

Попробовал сохранять поток в файл и перекодировать.

На этапе сохранения утечки нет.

cvlc -vvvvvv udp://@233.0.0.101:16384 --clock-synchro 0 --packetizer-mpegvideo-sync-iframe --sout &apos;#standard{mux=ts,dst=out.ts,access=file}&quot;&apos;

На этапе кодирования в какой-то момент так же появляются ошибки

cvlc -vvvvvv out.ts --clock-synchro 0 --packetizer-mpegvideo-sync-iframe --sout &apos;#transcode{vcodec=mp2v,vb=4500,fps=25,scale=1}:rtp{mux=ts,dst=233.0.0.21,port=16384,sdp=sap://}&apos;

[0x7feaa0001048] avcodec encoder warning: almost fed libavcodec with two frames with the same PTS (244430067253)

и последующее разрастание процесса в памяти. Проверил на последнем Сизифе и на p7

Если нужно, то могу выложить куда-нибудь на файлообменник записаный файл для теста.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>143564</commentid>
    <comment_count>5</comment_count>
    <who name="Sergey Bolshakov">sbolshakov</who>
    <bug_when>2013-10-31 17:04:35 +0400</bug_when>
    <thetext>а если ещё попробовать перекодировать с диска на диск же,
а потом постримить с диcка ?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>143567</commentid>
    <comment_count>6</comment_count>
    <who name="Alexei Takaseev">taf</who>
    <bug_when>2013-11-01 04:38:32 +0400</bug_when>
    <thetext>cvlc -vvvvvv out.ts --clock-synchro 0 --packetizer-mpegvideo-sync-iframe --sout &apos;#transcode{vcodec=mp2v,vb=4500,fps=25,scale=1}:standard{mux=ts,dst=qqqq.mpg,access=file}&apos;

точно так же в какого-то момента отжирает 11 гигов памяти.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>175639</commentid>
    <comment_count>7</comment_count>
    <who name="Anton Farygin">rider</who>
    <bug_when>2018-11-08 15:12:51 +0300</bug_when>
    <thetext>на vlc3 у меня не воспроизвелось.</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>