Opened 11 years ago

Closed 9 years ago

#2513 closed defect (fixed)

ffplay stuttering on MOV file via http

Reported by: jyavenard Owned by:
Priority: normal Component: avformat
Version: git-master Keywords: mov http seek
Cc: Blocked By:
Blocking: Reproduced by developer: no
Analyzed by developer: no

Description

This is using git master as of April, 29th 2013

Summary of the bug:
When playing an iPhone MOV file over http, playback will stutter.
File plays well locally.

How to reproduce:
Sample can be found at:
http://www.avenard.org/files/media/mediatest/cutting.mov

Copy the file to a local web server.
then try:
ffplay http://server_name/path/to/cutting.mov

(sorry if it's a bit big, this is a 1 minute iPhone 5 video. Can't easily shorten it as it's a trailing moov atom file.)

Notice that it will take several seconds for playback to start (even using gigabit ethernet), once playback start, after a few seconds it will start to stutter greatly.

For background information: I'm giving the example of using ffplay. I can reproduce the issue with MythTV (that uses ffmpeg release/1.1) and is an issue I'm trying to solve there.
The issue is encountered when using AirPlay from the iPhone/iPad "Photos" application and trying to stream a video.

Change History (7)

comment:1 by jyavenard, 11 years ago

Investigating further, I found that xbmc didn't suffer the issue.
Upon investigation

this patch from them:
https://github.com/xbmc/xbmc/blob/master/lib/ffmpeg/patches/0014-changed-allow-4-second-skew-between-streams-in-mov-b.patch

From 5cc735503bfe1242606f19638bffeb686dd4d1b5 Mon Sep 17 00:00:00 2001
From: Joakim Plate <elupus@ecce.se>
Date: Wed, 8 Dec 2010 14:03:43 +0000
Subject: [PATCH 14/24] changed: allow 4 second skew between streams in mov
 before attempting to seek

---
 libavformat/mov.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/libavformat/mov.c b/libavformat/mov.c
index 9da8eab..0f9836c 100644
--- a/libavformat/mov.c
+++ b/libavformat/mov.c
@@ -2763,8 +2763,8 @@ static AVIndexEntry *mov_find_next_sample(AVFormatContext *s, AVStream **st)
             if (!sample || (!s->pb->seekable && current_sample->pos < sample->pos) ||
                 (s->pb->seekable &&
                  ((msc->pb != s->pb && dts < best_dts) || (msc->pb == s->pb &&
-                 ((FFABS(best_dts - dts) <= AV_TIME_BASE && current_sample->pos < sample->pos) ||
-                  (FFABS(best_dts - dts) > AV_TIME_BASE && dts < best_dts)))))) {
+                 ((FFABS(best_dts - dts) <= 4*AV_TIME_BASE && current_sample->pos < sample->pos) ||
+                  (FFABS(best_dts - dts) > 4*AV_TIME_BASE && dts < best_dts)))))) {
                 sample = current_sample;
                 best_dts = dts;
                 *st = avst;
-- 
1.7.9.4

is what makes it play properly

comment:2 by jyavenard, 11 years ago

Found the relevant discussion in regards to this patch: may not be the best way to do it:
http://ffmpeg.org/pipermail/ffmpeg-devel/2012-December/135017.html

comment:3 by Carl Eugen Hoyos, 11 years ago

Component: FFplayundetermined

Please provide the failing ffplay command together with the complete, uncut console output to make this a valid ticket.

comment:4 by jyavenard, 11 years ago

as requested:

$./ffplay http://192.168.10.143:7001/1/b55fc449-a3bf-51e9-80b4-7d0e77f99123.MOV
ffplay version N-52577-g2609434 Copyright (c) 2003-2013 the FFmpeg developers
  built on Apr 30 2013 15:48:48 with llvm-gcc 4.2.1 (LLVM build 2336.11.00)
  configuration: 
  libavutil      52. 27.101 / 52. 27.101
  libavcodec     55.  6.100 / 55.  6.100
  libavformat    55.  3.100 / 55.  3.100
  libavdevice    55.  0.100 / 55.  0.100
  libavfilter     3. 61.101 /  3. 61.101
  libswscale      2.  2.100 /  2.  2.100
  libswresample   0. 17.102 /  0. 17.102
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'http://192.168.10.143:7001/1/b55fc449-a3bf-51e9-80b4-7d0e77f99123.MOV':
  Metadata:
    major_brand     : qt  
    minor_version   : 0
    compatible_brands: qt  
    creation_time   : 2013-01-03 01:44:59
    model           : iPhone 5
    model-eng       : iPhone 5
    encoder         : 6.0.2
    encoder-eng     : 6.0.2
    date            : 2013-01-03T11:44:59+1000
    date-eng        : 2013-01-03T11:44:59+1000
    location        : -28.0746+153.2038+164.387/
    location-eng    : -28.0746+153.2038+164.387/
    make            : Apple
    make-eng        : Apple
  Duration: 00:00:48.07, start: 0.000000, bitrate: 17029 kb/s
    Stream #0:0(und): Video: h264 (High) (avc1 / 0x31637661), yuv420p, 1920x1080, 16955 kb/s, 29.97 fps, 29.97 tbr, 600 tbn, 1200 tbc
    Metadata:
      creation_time   : 2013-01-03 01:44:59
      handler_name    : Core Media Data Handler
    Stream #0:1(und): Audio: aac (mp4a / 0x6134706D), 44100 Hz, mono, fltp, 62 kb/s
    Metadata:
      creation_time   : 2013-01-03 01:44:59
      handler_name    : Core Media Data Handler
  11.17 A-V:  1.228 fd=  15 aq=    0KB vq=    0KB sq=    0B f=0/0   

no error are showing, you only see the value of fd= pausing for about 1-2s every few seconds, which corresponds to the time where playback stop and then resume

comment:5 by Carl Eugen Hoyos, 11 years ago

Keywords: mov added
Status: newopen

comment:6 by klpu, 10 years ago

I used ffplay playback iphone video on my server, same problem. Why dont patch this.......thanks xbmc patch

Last edited 10 years ago by klpu (previous) (diff)

comment:7 by Carl Eugen Hoyos, 9 years ago

Component: undeterminedavformat
Keywords: http seek added
Resolution: fixed
Status: openclosed

Should by fixed by Michael in 488cc0519242340b92b5c64bf7b8a774f5c504a9

Note: See TracTickets for help on using tickets.