Giter Club home page Giter Club logo

Comments (19)

marcuslindblom avatar marcuslindblom commented on May 30, 2024

This is the extended log using -loglevel debug

ffmpeg version 3.3.2 Copyright (c) 2000-2017 the FFmpeg developers
  built with gcc 5.3.0 (Alpine 5.3.0)
  configuration: --bindir=/usr/local/bin --disable-debug --disable-doc --disable-ffplay --disable-static --enable-avresample --enable-gpl --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libfdk_aac --enable-libfreetype --enable-libvidstab --enable-libmp3lame --enable-libopus --enable-libtheora --enable-libvorbis --enable-libvpx --enable-libx264 --enable-libx265 --enable-libxvid --enable-nonfree --enable-openssl --enable-postproc --enable-shared --enable-small --enable-version3 --extra-cflags=-I/usr/local/include --extra-ldflags=-L/usr/local/lib --extra-libs=-ldl --prefix=/usr/local
  libavutil      55. 58.100 / 55. 58.100
  libavcodec     57. 89.100 / 57. 89.100
  libavformat    57. 71.100 / 57. 71.100
  libavdevice    57.  6.100 / 57.  6.100
  libavfilter     6. 82.100 /  6. 82.100
  libavresample   3.  5.  0 /  3.  5.  0
  libswscale      4.  6.100 /  4.  6.100
  libswresample   2.  7.100 /  2.  7.100
  libpostproc    54.  5.100 / 54.  5.100
Splitting the commandline.
Reading option '-i' ... matched as input url with argument 'pipe:'.
Reading option '-c' ... matched as option 'c' (codec name) with argument 'copy'.
Reading option '-loglevel' ... matched as option 'loglevel' (set logging level) with argument 'debug'.
Reading option '-f' ... matched as option 'f' (force format) with argument 'mjpeg'.
Reading option '-c:v' ... matched as option 'c' (codec name) with argument 'mjpeg'.
Reading option '-q:v' ... matched as option 'q' (use fixed quality scale (VBR)) with argument '10'.
Reading option '-frames:v' ... matched as option 'frames' (set the number of frames to output) with argument '1'.
Reading option 'pipe:' ... matched as output url.
Finished splitting the commandline.
Parsing a group of options: global .
Applying option loglevel (set logging level) with argument debug.
Successfully parsed a group of options.
Parsing a group of options: input url pipe:.
Successfully parsed a group of options.
Opening an input file: pipe:.
[NULL @ 0x55a702d16dc0] Opening 'pipe:' for reading
[pipe @ 0x55a702d17480] Setting default whitelist 'crypto'
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x55a702d16dc0] Format mov,mp4,m4a,3gp,3g2,mj2 probed with size=2048 and score=100
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x55a702d16dc0] ISO: File Type Major Brand: isom
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x55a702d16dc0] Unknown dref type 0x206c7275 size 12
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x55a702d16dc0] Offset DTS by ctts[0].duration: 1000
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x55a702d16dc0] Processing st: 0, edit list 0 - media time: 1000, duration: 13007
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x55a702d16dc0] shifted frame pts, curr_cts: 0 @ 0, ctts: 1000, ctts_count: 1
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x55a702d16dc0] shifted frame pts, curr_cts: 500 @ 0, ctts: 1000, ctts_count: 1
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x55a702d16dc0] shifted frame pts, curr_cts: 1000 @ 0, ctts: 1000, ctts_count: 1
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x55a702d16dc0] shifted frame pts, curr_cts: 1500 @ 0, ctts: 1000, ctts_count: 1
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x55a702d16dc0] shifted frame pts, curr_cts: 2000 @ 0, ctts: 1000, ctts_count: 1
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x55a702d16dc0] shifted frame pts, curr_cts: 2500 @ 0, ctts: 1000, ctts_count: 1
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x55a702d16dc0] shifted frame pts, curr_cts: 3000 @ 0, ctts: 1000, ctts_count: 1
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x55a702d16dc0] shifted frame pts, curr_cts: 3500 @ 0, ctts: 1000, ctts_count: 1
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x55a702d16dc0] shifted frame pts, curr_cts: 4000 @ 0, ctts: 1000, ctts_count: 1
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x55a702d16dc0] shifted frame pts, curr_cts: 4500 @ 0, ctts: 1000, ctts_count: 1
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x55a702d16dc0] shifted frame pts, curr_cts: 5000 @ 0, ctts: 1000, ctts_count: 1
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x55a702d16dc0] shifted frame pts, curr_cts: 5500 @ 0, ctts: 1000, ctts_count: 1
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x55a702d16dc0] shifted frame pts, curr_cts: 6000 @ 0, ctts: 1000, ctts_count: 1
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x55a702d16dc0] shifted frame pts, curr_cts: 6500 @ 0, ctts: 1000, ctts_count: 1
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x55a702d16dc0] shifted frame pts, curr_cts: 7000 @ 0, ctts: 1000, ctts_count: 1
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x55a702d16dc0] shifted frame pts, curr_cts: 7500 @ 0, ctts: 1000, ctts_count: 1
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x55a702d16dc0] shifted frame pts, curr_cts: 8000 @ 0, ctts: 1000, ctts_count: 1
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x55a702d16dc0] shifted frame pts, curr_cts: 8500 @ 0, ctts: 1000, ctts_count: 1
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x55a702d16dc0] shifted frame pts, curr_cts: 9000 @ 0, ctts: 1000, ctts_count: 1
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x55a702d16dc0] shifted frame pts, curr_cts: 9500 @ 0, ctts: 1000, ctts_count: 1
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x55a702d16dc0] shifted frame pts, curr_cts: 10000 @ 0, ctts: 1000, ctts_count: 1
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x55a702d16dc0] shifted frame pts, curr_cts: 10500 @ 0, ctts: 1000, ctts_count: 1
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x55a702d16dc0] shifted frame pts, curr_cts: 11000 @ 0, ctts: 1000, ctts_count: 1
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x55a702d16dc0] shifted frame pts, curr_cts: 11500 @ 0, ctts: 1000, ctts_count: 1
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x55a702d16dc0] shifted frame pts, curr_cts: 12000 @ 0, ctts: 1000, ctts_count: 1
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x55a702d16dc0] shifted frame pts, curr_cts: 12500 @ 0, ctts: 1000, ctts_count: 1
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x55a702d16dc0] Unknown dref type 0x206c7275 size 12
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x55a702d16dc0] Processing st: 1, edit list 0 - media time: 1105, duration: 52032
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x55a702d16dc0] skip 1105 audio samples from curr_cts: 0
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x55a702d16dc0] Before avformat_find_stream_info() pos: 670611 bytes read:670611 seeks:0 nb_streams:2
[h264 @ 0x55a702d1f6a0] nal_unit_type: 7, nal_ref_idc: 3
[h264 @ 0x55a702d1f6a0] nal_unit_type: 8, nal_ref_idc: 3
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x55a702d16dc0] stream 0, offset 0x30: partial file
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x55a702d16dc0] Could not find codec parameters for stream 0 (Video: h264, 1 reference frame (avc1 / 0x31637661), none(left), 1280x720, 1/23976, 4800 kb/s): unspecified pixel format
Consider increasing the value for the 'analyzeduration' and 'probesize' options
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x55a702d16dc0] Could not find codec parameters for stream 1 (Audio: mp3 (mp4a / 0x6134706D), 48000 Hz, 2 channels, s16p, 130 kb/s): unspecified frame size
Consider increasing the value for the 'analyzeduration' and 'probesize' options
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x55a702d16dc0] After avformat_find_stream_info() pos: 670611 bytes read:670611 seeks:0 frames:0
Guessed Channel Layout for Input Stream #0.1 : stereo
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'pipe:':
  Metadata:
    major_brand     : isom
    minor_version   : 512
    compatible_brands: isomiso2avc1mp41
    encoder         : Lavf55.12.102
  Duration: 00:00:01.11, bitrate: N/A
    Stream #0:0(eng), 0, 1/11988: Video: h264, 1 reference frame (avc1 / 0x31637661), none(left), 1280x720, 0/1, 4800 kb/s, 23.98 fps, 23.98 tbr, 11988 tbn, 23976 tbc (default)
    Metadata:
      handler_name    : VideoHandler
    Stream #0:1(eng), 0, 1/48000: Audio: mp3 (mp4a / 0x6134706D), 48000 Hz, stereo, s16p, 130 kb/s (default)
    Metadata:
      handler_name    : SoundHandler
Successfully opened the file.
Parsing a group of options: output url pipe:.
Applying option c (codec name) with argument copy.
Applying option f (force format) with argument mjpeg.
Applying option c:v (codec name) with argument mjpeg.
Applying option q:v (use fixed quality scale (VBR)) with argument 10.
Applying option frames:v (set the number of frames to output) with argument 1.
Successfully parsed a group of options.
Opening an output file: pipe:.
[pipe @ 0x55a702d1a240] Setting default whitelist 'crypto'
Successfully opened the file.
detected 2 logical cores
[h264 @ 0x55a702d75800] nal_unit_type: 7, nal_ref_idc: 3
[h264 @ 0x55a702d75800] nal_unit_type: 8, nal_ref_idc: 3
Stream mapping:
  Stream #0:0 -> #0:0 (h264 (native) -> mjpeg (native))
cur_dts is invalid (this is harmless if it occurs once at the start per stream)
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x55a702d16dc0] stream 0, offset 0x30: partial file
pipe:: Invalid data found when processing input
No more output streams to write to, finishing.
Finishing stream 0:0 without any data written to it.
Nothing was written into output file 0 (pipe:), because at least one of its streams received no packets.
frame=    0 fps=0.0 q=0.0 Lsize=       0kB time=-577014:32:22.77 bitrate=  -0.0kbits/s speed=N/A    
video:0kB audio:0kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: unknown
Input file #0 (pipe:):
  Input stream #0:0 (video): 0 packets read (0 bytes); 0 frames decoded; 
  Input stream #0:1 (audio): 0 packets read (0 bytes); 
  Total: 0 packets (0 bytes) demuxed
Output file #0 (pipe:):
  Output stream #0:0 (video): 0 frames encoded; 0 packets muxed (0 bytes); 
  Total: 0 packets (0 bytes) muxed
Output file is empty, nothing was encoded (check -ss / -t / -frames parameters if used)
0 frames successfully decoded, 0 decoding errors
[AVIOContext @ 0x55a702d1a340] Statistics: 0 seeks, 0 writeouts
[AVIOContext @ 0x55a702d1f5a0] Statistics: 670611 bytes read, 0 seeks

from ffmpeg.

GnaphronG avatar GnaphronG commented on May 30, 2024

Hi @marcuslindblom ,

It seems you are trying to pipe a MP4 container into FFmpeg. A standard MP4 container has its index at the end of the file (https://msdn.microsoft.com/en-us/library/windows/desktop/ee663601(v=vs.85).aspx#media_containers), so FFmpeg try to seek into the file but fails and errors with pipe:: Invalid data found when processing input.

If you are trying to stream a file over HTTP you can use the http input (http://ffmpeg.org/ffmpeg-protocols.html#http).
if not you can use Fragmented MP4 format which is a variant of MP4 designed to be streamed. or you could extract the raw streams and pipe them into ffmpeg.

from ffmpeg.

marcuslindblom avatar marcuslindblom commented on May 30, 2024

@GnaphronG Ok, I see. To use the fragmented MP4 format, do I need to convert the file in some other tool first and then stream the file to ffmpeg?

from ffmpeg.

marcuslindblom avatar marcuslindblom commented on May 30, 2024

Also, why does the same MP4 file work like this? #48

from ffmpeg.

GnaphronG avatar GnaphronG commented on May 30, 2024

@marcuslindblom, could you paste the command line you use to run the container ?

you can use -movflags faststart when you generate the MP4 to set the index at the beginning of the file

from ffmpeg.

marcuslindblom avatar marcuslindblom commented on May 30, 2024

@GnaphronG does -movflags faststar fix the problem with the incoming stream? I tried it but it didn't work. You can see the complete command below.

Im not sure how I can see the exact command. I'm using https://github.com/Microsoft/Docker.DotNet/ to create, start and attach the container. Docker.DotNet takes advantage of the remote docker api but I'm not sure how I can see the command. Do you know how I can debug the remote api?

This is the command, from my c# code:

var createContainerParameters = new Config
{
Image = "911fc62f478e",
ArgsEscaped = false,
AttachStderr = false,
AttachStdin = true,
AttachStdout = true,
Cmd = new string[] {
  "-i", "pipe:",
  "-movflags", "+faststart",
  "-c", "copy",
  "-loglevel", "debug",
  "-f", "mjpeg",
  "-c:v", "mjpeg",
  "-q:v", "10",
  "-frames:v", "1",
  "pipe:"
},
OpenStdin = true,
StdinOnce = true
};

from ffmpeg.

marcuslindblom avatar marcuslindblom commented on May 30, 2024

If I use -movflags faststart and generates a new mp4 I end up with this log even though I use -loglevel debug

ffmpeg version 3.3.2 Copyright (c) 2000-2017 the FFmpeg developers
  built with gcc 5.3.0 (Alpine 5.3.0)
  configuration: --bindir=/usr/local/bin --disable-debug --disable-doc --disable-ffplay --disable-static --enable-avresample --enable-gpl --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libfdk_aac --enable-libfreetype --enable-libvidstab --enable-libmp3lame --enable-libopus --enable-libtheora --enable-libvorbis --enable-libvpx --enable-libx264 --enable-libx265 --enable-libxvid --enable-nonfree --enable-openssl --enable-postproc --enable-shared --enable-small --enable-version3 --extra-cflags=-I/usr/local/include --extra-ldflags=-L/usr/local/lib --extra-libs=-ldl --prefix=/usr/local
  libavutil      55. 58.100 / 55. 58.100
  libavcodec     57. 89.100 / 57. 89.100
  libavformat    57. 71.100 / 57. 71.100
  libavdevice    57.  6.100 / 57.  6.100
  libavfilter     6. 82.100 /  6. 82.100
  libavresample   3.  5.  0 /  3.  5.  0
  libswscale      4.  6.100 /  4.  6.100
  libswresample   2.  7.100 /  2.  7.100
  libpostproc    54.  5.100 / 54.  5.100
Splitting the commandline.
Reading option '-i' ... matched as input url with argument 'pipe:'.
Reading option '-movflags' ... matched as AVOption 'movflags' with argument 'faststart'.
Reading option '-c' ... matched as option 'c' (codec name) with argument 'copy'.
Reading option '-loglevel' ... matched as option 'loglevel' (set logging level) with argument 'debug'.
Reading option '-f' ... matched as option 'f' (force format) with argument 'mjpeg'.
Reading option '-c:v' ... matched as option 'c' (codec name) with argument 'mjpeg'.
Reading option '-q:v' ... matched as option 'q' (use fixed quality scale (VBR)) with argument '10'.
Reading option '-frames:v' ... matched as option 'frames' (set the number of frames to output) with argument '1'.
Reading option 'pipe:' ... matched as output url.
Finished splitting the commandline.
Parsing a group of options: global .
Applying option loglevel (set logging level) with argument debug.
Successfully parsed a group of options.
Parsing a group of options: input url pipe:.
Successfully parsed a group of options.
Opening an input file: pipe:.
[NULL @ 0x55fe16a10dc0] Opening 'pipe:' for reading
[pipe @ 0x55fe16a11500] Setting default whitelist 'crypto'

from ffmpeg.

GnaphronG avatar GnaphronG commented on May 30, 2024

According to https://github.com/Microsoft/Docker.DotNet#known-issues--todo, "HTTP Hijacking is not implemented yet, therefore "Attach to Container" operation does not exist in the library (expecting pull requests!) A workaround might be using WebSockets (/attach/ws)."

So it seems piping to a container using the .Net implementation of the Remote API is not yet possible .

from ffmpeg.

marcuslindblom avatar marcuslindblom commented on May 30, 2024

Hm, maybe you are right @GnaphronG. The thing is that I use another container (ImageMagick), the same .NET api and stream image files of different types and it works fine. I'm new to the docker scene so I'm not sure but this seems like "Attach to container" operation exists and the documentation is not updated?

stream = await client.Containers.AttachContainerAsync(createContainerResponse.ID, isTTY.GetValueOrDefault(), containerAttachParameters, token);

Maybe ImageMagick and ffmpeg handles stream differently?

I used the the http api before and is seems to work with all different types of video files?

from ffmpeg.

GnaphronG avatar GnaphronG commented on May 30, 2024

@marcuslindblom could you share the mp4 file that is causing problem ?

from ffmpeg.

marcuslindblom avatar marcuslindblom commented on May 30, 2024

@GnaphronG Sure, here is one of the files I have problem with. Actually I haven't got any luck streaming any file at all. https://cl.ly/lUJf

from ffmpeg.

GnaphronG avatar GnaphronG commented on May 30, 2024

Thank you @marcuslindblom, with this file i was able to reproduce your issue using: cat A001_C009.mp4 | docker run -i jrottenberg/ffmpeg:3.3-alpine -loglevel debug -i pipe: -c copy -f mjpeg -c:v mjpeg -q:v 10 -frames:v 1 pipe: | cat > test.jpg

if you can change the encoding parameter of the source file to move the idx atom at the front it solves the problem: ffmpeg -i A001_C009.mp4 -c:v copy -c:a copy -movflags faststart A001_C009-faststart.mp4 then you can pipe it to ffmpeg to extract frames of play it.

cat A001_C009-faststart.mp4 | docker run -i jrottenberg/ffmpeg:3.3-alpine -i pipe: -c copy -f mjpeg -c:v mjpeg -q:v 10 -frames:v 1 pipe: | cat > test.jpg 
ffmpeg version 3.3.2 Copyright (c) 2000-2017 the FFmpeg developers
  built with gcc 5.3.0 (Alpine 5.3.0)
  configuration: --bindir=/usr/local/bin --disable-debug --disable-doc --disable-ffplay --disable-static --enable-avresample --enable-gpl --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libfdk_aac --enable-libfreetype --enable-libvidstab --enable-libmp3lame --enable-libopus --enable-libtheora --enable-libvorbis --enable-libvpx --enable-libx264 --enable-libx265 --enable-libxvid --enable-nonfree --enable-openssl --enable-postproc --enable-shared --enable-small --enable-version3 --extra-cflags=-I/usr/local/include --extra-ldflags=-L/usr/local/lib --extra-libs=-ldl --prefix=/usr/local
  libavutil      55. 58.100 / 55. 58.100
  libavcodec     57. 89.100 / 57. 89.100
  libavformat    57. 71.100 / 57. 71.100
  libavdevice    57.  6.100 / 57.  6.100
  libavfilter     6. 82.100 /  6. 82.100
  libavresample   3.  5.  0 /  3.  5.  0
  libswscale      4.  6.100 /  4.  6.100
  libswresample   2.  7.100 /  2.  7.100
  libpostproc    54.  5.100 / 54.  5.100
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'pipe:':
  Metadata:
    major_brand     : isom
    minor_version   : 512
    compatible_brands: isomiso2avc1mp41
    encoder         : Lavf57.56.101
  Duration: 00:00:01.11, start: 0.000000, bitrate: N/A
    Stream #0:0(eng): Video: h264 (avc1 / 0x31637661), yuv420p, 1280x720 [SAR 1:1 DAR 16:9], 4800 kb/s, 23.98 fps, 23.98 tbr, 11988 tbn, 47.95 tbc (default)
    Metadata:
      handler_name    : VideoHandler
    Stream #0:1(eng): Audio: mp3 (mp4a / 0x6134706D), 48000 Hz, stereo, s16p, 130 kb/s (default)
    Metadata:
      handler_name    : SoundHandler
Stream mapping:
  Stream #0:0 -> #0:0 (h264 (native) -> mjpeg (native))
[swscaler @ 0x5633e2260000] deprecated pixel format used, make sure you did set range correctly
Output #0, mjpeg, to 'pipe:':
  Metadata:
    major_brand     : isom
    minor_version   : 512
    compatible_brands: isomiso2avc1mp41
    encoder         : Lavf57.71.100
    Stream #0:0(eng): Video: mjpeg, yuvj420p(pc), 1280x720 [SAR 1:1 DAR 16:9], q=2-31, 200 kb/s, 23.98 fps, 23.98 tbn, 23.98 tbc (default)
    Metadata:
      handler_name    : VideoHandler
      encoder         : Lavc57.89.100 mjpeg
    Side data:
      cpb: bitrate max/min/avg: 0/0/200000 buffer size: 0 vbv_delay: -1
frame=    1 fps=0.0 q=10.0 Lsize=      32kB time=00:00:00.04 bitrate=6235.7kbits/s speed=1.42x    
video:32kB audio:0kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 0.000000%

or you can create a buffer file from which ffmpeg will read. Since ffmpeg need the full file to be able to work, it will stream the entire file. cat A001_C009.mp4 | docker run -i --entrypoint /bin/sh jrottenberg/ffmpeg:3.3-alpine -c "cat > /tmp/buffer && ffmpeg -i /tmp/buffer -c copy -f mjpeg -c:v mjpeg -q:v 10 -frames:v 1 pipe: ; rm -f /tmp/buffer" | cat > test.jpg

from ffmpeg.

GnaphronG avatar GnaphronG commented on May 30, 2024

@marcuslindblom is it working ?

from ffmpeg.

marcuslindblom avatar marcuslindblom commented on May 30, 2024

@GnaphronG I finally got some time to test this out and it seems to work if I create a temp buffer. I'm trying to develop a pretty generic solution for handling pretty much all video formats that ffmpeg supports. Do you see any disadvantages with this approach vs using the http input?

Btw, big thanks for helping me

from ffmpeg.

GnaphronG avatar GnaphronG commented on May 30, 2024

@marcuslindblom, you're welcome

The temp buffer will make the processing faster since the entire file is available locally but it takes some time to download the data, especially if the file is huge. It can also result in filling your local storage.
The HTTP approach is more flexible, since in theory it download only the part necessary to the processing. I've seen some error with certain HTTP servers when trying to access specific bytes into the file.

I'm looking at Docker Storage solution such as Flocker, or Infinit to access the data from inside a container as if it was local.

from ffmpeg.

marcuslindblom avatar marcuslindblom commented on May 30, 2024

I use ffmpeg to create a "film strip" by selecting 50 frames from the video. Todo that I need to know how many frames the video have. My approach so far is to download the file locally, stream the file to the container using the ffprobe entry point. Then I use the result and the same buffer to start a second container with the ffmpeg entry point. If I want to use the http protocol the both containers need to download the same file so that would be a lot slower.

from ffmpeg.

GnaphronG avatar GnaphronG commented on May 30, 2024

If you have access to the file locally you could mount it as volume :
docker run -i -v $PWD:/tmp/ jrottenberg/ffmpeg:3.3-alpine -i A001_C009.mp4 -c copy -f mjpeg -c:v mjpeg -q:v 10 -frames:v 1 frame.jpeg

This will mount the current folder as /tmp and export the frame into the current folder without copying anything.

from ffmpeg.

marcuslindblom avatar marcuslindblom commented on May 30, 2024

Yes, that is one option but I think downloading the file without writing it to disk would be the fastest way, don't you think? I'm thinking dusk writes and reads are unnecessary

from ffmpeg.

jrottenberg avatar jrottenberg commented on May 30, 2024

No activity since Jul 20, please reopen if it's still pending.

from ffmpeg.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.