[FFmpeg-devel] [GSoC] Qualification task, simple ffserver implementation.

Stephan Holljes klaxa1337 at googlemail.com
Tue Apr 17 04:52:29 EEST 2018

I have made the proposed changes:
  - AVFifoBuffer mutex-locking
  - Added license header to files
  - Use avio for segment_save() instead of FILE *
  - Use av_malloc()/av_free() consistently
  - Add context to logging (where possible)
  - Simplified client_log() to print without buffer
  - Simplified stat counting with enum array
I found av_dynarray to be fitting for what i was doing so:
  - Replace segment_append_ts() by using av_dynarray

I am not 100% happy with the state of how things are working right now,
but I'm running into some walls I'm having trouble fighting with.
  - segment_save() does not save a correctly playable file.
    In my tests mpv stopped playback for each file a little too early.
    They also report 1000 fps, so I think I might be missing something.
    However, the http stream has no playback problems, but also reports
    1000 fps.

  - Seemingly random conditions where incorrect dts/pts values are tried
    to be written with av_write_frame() which then fails.

  - Seemingly random playback issues where timestamps also seem
    mpv output during playback:
    > Invalid audio PTS: 27.593500 -> 32.933500
    > [ffmpeg/video] vp9: Not all references are available
    mpv manages to continue playback, but the image is a corrupted frame
    until the next keyframe.

  - Most likely related to above problems is the timestamp handling in
    general. Right now every segment just stores a dynamic array for
    these. Using the dts and pts from the muxed in-memory segment does
    not work, I'd have to do some research again why it doesn't. What
    would be a better approach for this?

  - Seemingly random segmentation faults when ungracefully disconnecting
    clients. To make it more mysterious, the segfaults occur on clients
    that were not disconnected. If no clients are disconnected no
    segfaults occur. (See:
https://gist.github.com/klaxa/3ddce28d99cab9ca45824af0942bfce3 for a


More information about the ffmpeg-devel mailing list