[FFmpeg-user] Video is repeated when streamed from ffserver

Jay Smith smithjay210590 at gmail.com
Sat Feb 13 01:35:37 CET 2016


So i've got some UDP video being converted to h264/AAC inside the FLV
format, i use either ffmpeg, vlc or MX player to view the video and it
works but it has a problem.
The UDP is a camera so the source is always unique.

A media player comes along and starts streaming the video at time 0
seconds, the video will play perfectly and play forever.

I've watched the video for 60 seconds, i hit stop.
I hit play again.
The video starts playing at time 0 (showing me what i've already seen, like
some sort of cache).
I need it to play from "now", if the ffserver has been running for 10
minutes, i need it to play from "now", not video encoded from 10 minutes
ago.

It's like some sort of time shift or caching.

I'm just using the URL http://myserver.com/channel1.flv to view the video
I've also tried using the URL http://myserver.com/channel1.flv?date=02:22:48
The URL is generated using php and the media player is redirected to the
URL using

<?php
>
> $_GET   = filter_input_array(INPUT_GET, FILTER_SANITIZE_STRING);
>
> $channel = $_GET['channel'];
>
> $date = date('H:i:s', strtotime('-1 second'));
>
> //echo "Location: http://185.86.160.195:4004/$channel.flv?date=$date";
>
> header("Location: http://185.86.160.195:4004/$channel.flv?date=$date");
>
> exit;
>
> ?>
>
>
So im trying to get it it play from "now" minus 1 second.

How do i stop this? Is it a bug?

ffserver.conf

Port 11100
> BindAddress 0.0.0.0
> MaxHTTPConnections 2000
> MaxClients 1000
> MaxBandwidth 300000
> CustomLog -
> #NoDaemon
> <Feed s1.ffm>
>         File /tmp/channel1.ffm
>         FileMaxSize 64M
>         ACL allow 127.0.0.1
> </Feed>
> <Stream channel1.flv>
>         Format flv
>         Feed channel1.ffm
>         VideoCodec libx264
>         VideoFrameRate 24
>          VideoBitRate 128
>         VideoSize 640x480
>         AVOptionVideo crf 23
>         AVOptionVideo preset medium
>         # for more info on crf/preset options, type: x264 --help
>         AVOptionVideo flags +global_header
>         AudioCodec aac
>         Strict -2
>         AudioBitRate 64
>         AudioChannels 2
>         AudioSampleRate 44100
>         AVOptionAudio flags +global_header
> Preroll 15
> </Stream>


Input:

ffmpeg -i 'udp://@224.2.2.1:3000?fifo_size=100000000'
> http://127.0.0.1:11100/channel1.ffm
>

ffmpeg version:

ffmpeg version 2.8.1-static http://johnvansickle.com/ffmpeg/  Copyright (c)
> 2000-2015 the FFmpeg developers

  built with gcc 4.9.3 (Debian 4.9.3-4)

  configuration: --enable-gpl --enable-version3 --disable-shared
> --disable-debug --enable-runtime-cpudetect --enable-libmp3lame
> --enable-libx264 --enable-libx265 --enable-libwebp --enable-libspeex
> --enable-libvorbis --enable-libvpx --enable-libfreetype --enable-fontconfig
> --enable-libxvid --enable-libopencore-amrnb --enable-libopencore-amrwb
> --enable-libtheora --enable-libvo-aacenc --enable-libvo-amrwbenc
> --enable-gray --enable-libopenjpeg --enable-libopus --enable-libass
> --enable-gnutls --enable-libvidstab --enable-libsoxr --enable-frei0r
> --enable-libfribidi --cc=gcc-4.9

  libavutil      54. 31.100 / 54. 31.100

  libavcodec     56. 60.100 / 56. 60.100

  libavformat    56. 40.101 / 56. 40.101

  libavdevice    56.  4.100 / 56.  4.100

  libavfilter     5. 40.101 /  5. 40.101

  libswscale      3.  1.101 /  3.  1.101

  libswresample   1.  2.101 /  1.  2.101

  libpostproc    53.  3.100 / 53.  3.100

Hyper fast Audio and Video encoder

usage: ffmpeg [options] [[infile options] -i infile]... {[outfile options]
> outfile}...




I've also tried using ffmpeg from Ubuntus repository which is version
7:2.8.6+git1~trusty


Part of my ffserver restart script i delete all FFM files to ensure that no
cache is left behind. The newly generated FFM files are repeated.


The odd thing is that this problem does not happen all the time, it seems
quite random.


More information about the ffmpeg-user mailing list