[FFmpeg-devel] [PATCH] avcodec/mjpegenc_common: always store JFIF, idependent of the aspect ratio

Reimar Döffinger Reimar.Doeffinger at gmx.de
Sat Jul 19 10:42:29 CEST 2014


On 16.07.2014, at 17:46, Andrey Utkin <andrey.krieger.utkin at gmail.com> wrote:
> 2014-07-15 21:39 GMT+03:00 Andrey Utkin <andrey.krieger.utkin at gmail.com>:
>> 2014-07-15 19:16 GMT+03:00 Nicolas George <george at nsup.org>:
>>> Le septidi 27 messidor, an CCXXII, Andrey Utkin a écrit :
>>>> Thanks, with this change streaming HTTP MJPEG stream into browsers
>>>> work (with inserting boundaries, which is easy for scripting).
>>> 
>>> Can you share your test procedure please?
>> 
>> I'll work on providing it tomorrow.
> 
> Now i see i was wrong about the difference. But still, for the
> interest of others, I'll provide HTTP MJPEG streaming example script.
> https://dl.dropboxusercontent.com/u/43104344/mjpeg.php
> https://dl.dropboxusercontent.com/u/43104344/page.php
> 
> Chromium browser doesn't playback produced HTTP MJPEG stream by direct
> URL, but it plays it fine the stream referenced from <img> tag on HTML
> page. That may be what caused my confusion. Firefox plays the produced
> streams by direct URL. All above doesn't depend on FFmpeg being
> patched with this patch.
> However, I have upgraded a lot of packages on my PC yesterday, so
> Chromium could get upgraded, causing behaviour change.
> Also maybe the script is somewhat incorrect, and Chromium actually
> plays (correct) streams by direct URLs.
> If you're interested to test your browser, feel free to try
> http://whdd.org/mjpeg.php
> http://whdd.org/mjpeg.php?patched=1
> http://whdd.org/page.php
> http://whdd.org/page.php?patched=1
> 
> Still the patch slightly improves things - now the reliable "start
> marker" can be longer (see in script).

To be honest I don't understand what goes on at all.
Is this an autodetection issue and plain JPEG without extra headers just doesn't have enough obvious markers?
Maybe the better way is to just document that in some cases an explicit aspect should be specified would help?
It seems like a bad solution to bloat generated JPEG files in all cases just because some browsers sometimes have issues otherwise - personally I almost never watch videos in browsers because the experience is still so crappy in almost all aspects.


More information about the ffmpeg-devel mailing list