<html>
  <head>
    <meta content="text/html; charset=utf-8" http-equiv="Content-Type">
  </head>
  <body text="#000000" bgcolor="#FFFFFF">
    <div class="moz-cite-prefix">Finnaly i was able to set up timing
      data in h264 stream.<br>
      Trying to save this as -f test.h264 produces good file, trying to
      mux it drops FPS to tenth of original (25 fps becomes 2.5 fps and
      bitrate from 1024 kb/s to little more than 100 kbs).<br>
      PTS of every NAL unit is different exactly by 40000 (sometimes
      40001).<br>
      What am i doing wrong?<br>
      <br>
      Input #0, hisi, from '/dev/video':<br>
        Duration: N/A, start: 895789.311044, bitrate: N/A<br>
          Stream #0:0: Video: h264 (Main), yuvj420p(pc, bt709,
      progressive), 1920x1080, 25 fps, 25 tbr, 90k tbn, 50 tbc<br>
      File 'out.mkv' already exists. Overwrite ? [y/N] getchnattr worksy<br>
      Output #0, matroska, to 'out.mkv':<br>
        Metadata:<br>
          encoder         : Lavf57.83.100<br>
          Stream #0:0: Video: h264 (Main) (H264 / 0x34363248),
      yuvj420p(pc, bt709, progressive), 1920x1080, q=2-31, 25 fps, 25
      tbr, 1k tbn, 90k tbc<br>
      Stream mapping:<br>
        Stream #0:0 -> #0:0 (copy)<br>
      Press [q] to stop, [?] for help<br>
      [matroska @ 0x1a1c4b0] Non-monotonous DTS in output stream 0:0;
      previous: 0, current: -2627; changing to 0. This may result in
      incorrect timestamps in the output file.<br>
      [matroska @ 0x1a1c4b0] Non-monotonous DTS in output stream 0:0;
      previous: 0, current: -2182; changing to 0. This may result in
      incorrect timestamps in the output file.<br>
      [matroska @ 0x1a1c4b0] Non-monotonous DTS in output stream 0:0;
      previous: 0, current: -1738; changing to 0. This may result in
      incorrect timestamps in the output file.<br>
      [matroska @ 0x1a1c4b0] Non-monotonous DTS in output stream 0:0;
      previous: 0, current: -1293; changing to 0. This may result in
      incorrect timestamps in the output file.<br>
      [matroska @ 0x1a1c4b0] Non-monotonous DTS in output stream 0:0;
      previous: 0, current: -849; changing to 0. This may result in
      incorrect timestamps in the output file.<br>
      [matroska @ 0x1a1c4b0] Non-monotonous DTS in output stream 0:0;
      previous: 0, current: -404; changing to 0. This may result in
      incorrect timestamps in the output file.<br>
      frame=   24 fps=3.5 q=-1.0 Lsize=      94kB time=00:00:07.15
      bitrate= 107.6kbits/s speed=1.04x<br>
      video:93kB audio:0kB subtitle:0kB other streams:0kB global
      headers:0kB muxing overhead: 0.929940%<br>
      <br>
      Marcin<br>
      <br>
      <br>
      W dniu 04.02.2018 o 16:24, Marcin Woźniak pisze:<br>
    </div>
    <blockquote cite="mid:5A7725B9.1030703@intermania.pl" type="cite">Hello,
      <br>
      I try to implement an HiSilicon H264 encoder direct input as
      ffmpeg libavdevice source (someking like V4L linux for cameras
      with H264 source driver).
      <br>
      I successfully recieve H264 packets with NAL units and set correct
      PTS according to source packet.
      <br>
      I am stuck at the moment where timing data is not extracted from
      raw H264 paassed data and looks like this:
      <br>
      <br>
      Input #0, armdevice, from '/dev/video':
      <br>
        Duration: N/A, start: 0.000000, bitrate: N/A
      <br>
          Stream #0:0: Video: h264 (High), yuvj420p(pc, bt709,
      progressive), 1920x1080, 1000k tbr, 1000k tbn, 2000k tbc
      <br>
      <br>
      Resolution is okay but timing data is wrong. I passed SPS and PPS
      of incomming data in "read_packet".
      <br>
      <br>
      In shotcut:
      <br>
      1. Open H264 encoder using low-level API in device_open
      <br>
      2. Initialize encoder with fps and resolution using API in
      device_init
      <br>
      3. In read_packet i get NAL units from buffer and:
      <br>
      av_new_packet(pkt,total);
      <br>
      memcpy(pkt->data,buffer) -> stub
      <br>
       pkt->pts = buffer.u64PTS;
      <br>
      pkt->size = size
      <br>
      and return packet.
      <br>
      <br>
      Profile level is guessed okay but not the timing data.
      <br>
      <br>
      What am i doing wrong?
      <br>
       Marcin
      <br>
      <br>
      <fieldset class="mimeAttachmentHeader"></fieldset>
      <br>
      <pre wrap="">_______________________________________________
Libav-user mailing list
<a class="moz-txt-link-abbreviated" href="mailto:Libav-user@ffmpeg.org">Libav-user@ffmpeg.org</a>
<a class="moz-txt-link-freetext" href="http://ffmpeg.org/mailman/listinfo/libav-user">http://ffmpeg.org/mailman/listinfo/libav-user</a>
</pre>
    </blockquote>
    <br>
  </body>
</html>