Coder Social home page Coder Social logo

nschlia / ffmpegfs Goto Github PK

View Code? Open in Web Editor NEW
195.0 13.0 14.0 231.66 MB

FUSE-based transcoding filesystem with video support from many formats to FLAC, MP4, TS, WebM, OGG, MP3, HLS, and others.

Home Page: https://nschlia.github.io/ffmpegfs/

License: GNU General Public License v3.0

Makefile 0.95% Shell 2.44% M4 0.75% C 3.27% C++ 92.02% PHP 0.36% HTML 0.10% Dockerfile 0.11%
fuse-filesystem fuse ffmpeg multimedia aac hls mp3 mp4 video

ffmpegfs's People

Contributors

14mrh4x0r avatar david-collett avatar gzurowski avatar igor-epam avatar khenriks avatar lenzj avatar longhao-chen avatar martin2112 avatar nschlia avatar robertyseward avatar sdrik avatar ss23 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

ffmpegfs's Issues

HLS playback stops on DVD chapters with exactly 10 seconds

HLS playback stops on DVD chapters with exactly 10 seconds , and probably if duration is multiples of that.

Seems that one more segment is created than required, and that segment is invalid:

# ll "/mnt/ffmpegfs/hls/1M/multimedia1/DVD/Musik/Summer Breeze/Summer Breeze (2010)/05. Chapter 001 [00-10.000].ts/" 
insgesamt 6144
-rwxr-xr-x 1 norbert norbert 1874924 Sep 27  2011 000001.ts
-rwxr-xr-x 1 norbert norbert    4096 Sep 27  2011 000002.ts
-rwxr-xr-x 1 norbert norbert    1285 Sep 27  2011 hls.html
-rwxr-xr-x 1 norbert norbert     188 Sep 27  2011 index_0_av.m3u8
-rwxr-xr-x 1 norbert norbert      55 Sep 27  2011 master.m3u8

Should be 1 segment actually.

Source files with different extensions create duplicate entries

If files have the same name, but a different extension, this creates duplicate output names:

Source:

America - A Horse With No Name-05.flac
America - A Horse With No Name-05.mp4
America - A Horse With No Name-05.mp3

Mount:

America - A Horse With No Name-05.webm
America - A Horse With No Name-05.webm
America - A Horse With No Name-05.webm

This is a problem, it is not clear which source file is used when opening such an entry.

The output files must have a unique name.

Problem:

The best solution would be to use the full source name with extension, e.g.

America - A Horse With No Name-05.flac.webm
America - A Horse With No Name-05.mp4.webm
America - A Horse With No Name-05.mp3.webm

This makes sure no duplicate entries are created. But this means that all output filenames change with this fix.

If directory is mounted twice wrong error message is printed

If an already mounted directory is tried to mount over, this is printed:

FFMPEGFS V1.6
Copyright (C) 2006-2008 David Collett
Copyright (C) 2008-2012 K. Henriksson
Copyright (C) 2017-2018 FFmpeg support by Norbert Schlia ([email protected])

ERROR: mountpath is not a valid directory: /mnt/ffmpegfs/webm_NONE/mp3base1/

Should be:

/mnt/ffmpegfs/webm_NONE/mp3base1/: already mounted

Sqlite 3 could not step (execute) insert stmt: 5, database is locked

When multiple instances of ffmpegfs run sometimes sqlite lock errors occur.

These errors are not passed to the accessing process (transcoding reported as success) but the files sometimes are garbled (e.g. "make check" fails).

pr 11 07:12:42 MOBILMOPS ffmpegfs[4403]: [2018-04-11 07:12:42] DEBUG: Starting decoder thread for '/home/norbert/test/in/checks/obama.FLAC.flac'.
Apr 11 07:12:42 MOBILMOPS ffmpegfs[4403]: [2018-04-11 07:12:42] INFO: Transcoding '/home/norbert/test/in/checks/obama.FLAC.flac' to mp4.
Apr 11 07:12:42 MOBILMOPS ffmpegfs[4403]: [2018-04-11 07:12:42] DEBUG: Successfully opened Motion JPEG input codec.
Apr 11 07:12:42 MOBILMOPS ffmpegfs[4403]: [2018-04-11 07:12:42] DEBUG: Successfully opened FLAC (Free Lossless Audio Codec) input codec.
Apr 11 07:12:42 MOBILMOPS ffmpegfs[4403]: [2018-04-11 07:12:42] DEBUG: Opening format type 'mp4' for '/home/norbert/test/in/checks/obama.FLAC.flac'.
Apr 11 07:12:42 MOBILMOPS ffmpegfs[4403]: [2018-04-11 07:12:42] INFO: Limiting audio bit rate to 128.0 kbps for '/home/norbert/test/in/checks/obama.FLAC.flac'.
Apr 11 07:12:42 MOBILMOPS ffmpegfs[4403]: [2018-04-11 07:12:42] DEBUG: Successfully opened audio output codec AAC (Advanced Audio Coding) for '/home/norbert/test/in/checks/obama.FLAC.flac'.
Apr 11 07:12:43 MOBILMOPS ffmpegfs[4403]: [2018-04-11 07:12:43] DEBUG: Finishing file. Predicted size: 98399, final size: 100191, diff: 1792 (102.3%).
Apr 11 07:12:43 MOBILMOPS ffmpegfs[4394]: [2018-04-11 07:12:43] ERROR: Sqlite 3 could not step (execute) insert stmt: 5, database is locked
Apr 11 07:12:43 MOBILMOPS ffmpegfs[4394]: [2018-04-11 07:12:43] ERROR: Sqlite 3 could not step (execute) select statement: 5, database is locked
Apr 11 07:12:43 MOBILMOPS ffmpegfs[4394]: [2018-04-11 07:12:43] DEBUG: Reading file from cache: '/home/norbert/test/in/checks/raven.OGG.ogg'.
Apr 11 07:12:43 MOBILMOPS ffmpegfs[4394]: [2018-04-11 07:12:43] ERROR: Sqlite 3 could not step (execute) select statement: 5, database is locked
Apr 11 07:12:43 MOBILMOPS ffmpegfs[4403]: [2018-04-11 07:12:43] DEBUG: Reading file from cache: '/home/norbert/test/in/checks/raven.OGG.ogg'.
Apr 11 07:12:43 MOBILMOPS ffmpegfs[4403]: [2018-04-11 07:12:43] DEBUG: Reading file from cache: '/home/norbert/test/in/checks/obama.FLAC.flac'.
Apr 11 07:12:43 MOBILMOPS ffmpegfs[4394]: [2018-04-11 07:12:43] ERROR: Sqlite 3 could not step (execute) insert stmt: 5, database is locked
Apr 11 07:12:43 MOBILMOPS ffmpegfs[4394]: [2018-04-11 07:12:43] ERROR: Sqlite 3 could not step (execute) select statement: 5, database is locked
Apr 11 07:12:43 MOBILMOPS ffmpegfs[4394]: [2018-04-11 07:12:43] DEBUG: Reading file from cache: '/home/norbert/test/in/checks/raven.OGG.ogg'.
Apr 11 07:12:43 MOBILMOPS ffmpegfs[4394]: [2018-04-11 07:12:43] ERROR: Sqlite 3 could not step (execute) select statement: 5, database is locked
Apr 11 07:12:43 MOBILMOPS ffmpegfs[4403]: [2018-04-11 07:12:43] DEBUG: Reading file from cache: '/home/norbert/test/in/checks/raven.OGG.ogg'.
Apr 11 07:12:43 MOBILMOPS ffmpegfs[4403]: [2018-04-11 07:12:43] DEBUG: [aac @ 0x7f961c009440] Qavg: 1025.348
Apr 11 07:12:44 MOBILMOPS ffmpegfs[4403]: [2018-04-11 07:12:43] DEBUG: FFmpeg trancoder: closed.
Apr 11 07:12:44 MOBILMOPS ffmpegfs[4403]: [2018-04-11 07:12:43] INFO: Transcoding complete for '/home/norbert/test/in/checks/obama.FLAC.flac'. Result SUCCESS

MOV support and copy mode

Hi,

I hope I'm not too forward with this feature request. Since ffmpegfs currently outputs MP4, I don't think this would be too difficult to pull off, as MP4 and MOV are basically the same format.

A lot of editing software has very extensive QuickTime support but almost no AVI support and certainly no MKV support or other more obscure formats. I'd like to ask for a MOV mode where the filesystem is presented as virtual MOV files, with transcoding only enabled for those formats that can't be directly copied into MOV. For h.264 MP4 and MKV files for instance, transcoding is completely unnecessary as MOV supports wrapping h.264. For all other formats, it would be immensely powerful to use ffmpeg to transcode into ProRes as it is extremely fast and random-access.

Let me know what you think and thanks in advance.

Partial transcode of some files

I'm having an issue and I'm not sure if it's in the settings I've chosen or if it's a bug in ffmpegfs. When transcoding a flac file to opus the last few seconds of the audio file are missing. If I recopy the file immediately afterwards it results in a flawless transcode, so it only happens during the first transcode. The second copy pulls from the ffmpegfs cache I believe. My fstab entry is as follows:

ffmpegfs#/path/to/flacdir /path/to/opusdir fuse allow_other,ro,desttype=opus,audiobitrate=96K 0 0

Any suggestions would be greatly appreciated. If you need me to run additional test scenarios to debug this just let me know.

Below is the version I'm running (git commit 95993f0).

Built with : gcc 7.3.0 (linux-gnu)
configuration : --prefix=/nix/store/0mknxlcypy082jnzq5dzp45fhf7b6nld-ffmpegfs-95993f0
FFMPEGFS Version : 1.6
FFmpeg Version : 3.4.4
Video CD Library : enabled
DVD Library : enabled
Bluray Library : 1.0.2
FUSE library version: 2.9.8
fusermount version: 2.9.8
using FUSE kernel interface version 7.19

Additional Prores Option for Quality Levels

As an extra you could have different prores quality levels depending on the
source pixformat, for instance ProRes 4:4:4 if the source is RGB and
ProRes 4:2:2 if the source is YUV.

See #9.

HLS positioning fails for DVD/Bluray sources

Positioning fails for DVD/Bluray sources:

Feb 22 23:13:35 plattenlurch ffmpegfs[13205]: 2020-02-22 23:13:35 ERROR  : [/mnt/ffmpegfs/hls/5M/multimedia1/01. Chapter 003 [05-47.547]+.ts] SEEK PTS 90000000 - duration 347547200 segment_no 10
Feb 22 23:13:35 plattenlurch ffmpegfs[13205]: 2020-02-22 23:13:35 INFO   : [/mnt/ffmpegfs/hls/5M/multimedia1/01. Chapter 003 [05-47.547]+.ts] Starting HLS segment no. 10.
Feb 22 23:13:35 plattenlurch ffmpegfs[13205]: 2020-02-22 23:13:35 ERROR  : [/mnt/ffmpegfs/hls/5M/multimedia1/01. Chapter 003 [05-47.547]+.ts] AUDIO PTS 4637050000 - duration 347547200

Probably the start time must be set. Play file sources work.

Too chatty output if mounted via fstab

If mounted via fstab line, this is printed:

FFMPEGFS V1.6
Copyright (C) 2006-2008 David Collett
Copyright (C) 2008-2012 K. Henriksson
Copyright (C) 2017-2018 FFmpeg support by Norbert Schlia ([email protected])

ffmpegfs should print nothing. The succes/fail message is printed by the OS.

Bluray chapters stop prematurely

Some chapters stop playing after 30 seconds, sometimes a few seconds early. Problem exists at least for half a year... There seems to be a problem extracting Bluray data.

Bitrate too high for H264 files

This is a new issue that came up with the #43 fix:

The selected bitrate is not properly respected, resulting files with a 1MBit rate end up between 900KBit (would be OK) and 5MBit (far too large), depending on the source. If transcoded from high bitrates, e.g. blurays, the resulting file's rate will also be higher.

This seems to be a known problem, see https://stackoverflow.com/questions/11466184/setting-video-bit-rate-through-ffmpeg-api-is-ignored-for-libx264-codec. A possible fix is mentioned in the answer:

We need to set the pts for the decoded/resized frames before they are fed to encoder. The person who found the solution has gone through ffmpeg.c source and was able to figure this out. We need to first rescale the AVFrame's pts from the stream's time_base to the codec time_base to get a simple frame number (e.g. 1, 2, 3).

pic->pts = av_rescale_q(pic->pts, ost->time_base, ovCodecCtx->time_base);

avcodec_encode_video2(ovCodecCtx, &newpkt, pic, &got_packet_ptr);

And when we receive back the encoded packet from the libx264 codec, we need to rescale the pts and dts of the encoded video packet to the stream time base

newpkt.pts = av_rescale_q(newpkt.pts, ovCodecCtx->time_base, ost->time_base);
newpkt.dts = av_rescale_q(newpkt.dts, ovCodecCtx->time_base, ost->time_base);

This fix is currently being evaluated. That's a FFmpeg API bug, if you ask me. But we'll have to bear with it anyway.

DVD transcoding stops in the middle of the chapter

DVD transcoding sometimes stops in the middle of the chapter when the chapter consists of more than 1 cell. Playback stops a the end of the cell.

Normally, the end of the cell should be marked with SRI_END_OF_CELL which seems to be sometimes missing.

This is definetly a DVD authoring error, but should be tolerated in some way.

After transcoding several files VMEM usage sometimes goes off the edge

After playing files for a while, sometimes the VME usage goes up to the machine limit, In this particular case the machine has 32 GB RAM with 13 GB free.

Never happens if the files are copied via Samba or directly, but only if played through a web server. Probably has to do with slow connections and time outs.

"make check" sometimes hangs

Related to the new thread pool feature:

"make check" sometimes hangs because a thread seems still to be running. Thread synchronisation must be checked and corrected.

H265 decoding does not work

Log shows these errors:

2019-05-28 19:24:58 ERROR  : [hevc @ 0x7f883812a100] Duplicate POC in a sequence: 4.
2019-05-28 19:24:58 WARNING: [hevc @ 0x7f883812a100] Error parsing NAL unit #0.
2019-05-28 19:24:58 ERROR  : [/home/norbert/test/in/autocopy/Accept & Orchestra - Stalingrad (H265 AAC).mp4] Could not send packet to decoder (error 'Invalid data found when processing input').
2019-05-28 19:24:58 ERROR  : [/home/norbert/test/in/autocopy/Accept & Orchestra - Stalingrad (H265 AAC).mp4] Could not decode frame (error 'Invalid data found when processing input').
2019-05-28 19:24:58 DEBUG  : [/home/norbert/test/out/Accept & Orchestra - Stalingrad (H265 AAC).webm] File transcode complete, releasing buffer early: Size 0.
2019-05-28 19:24:58 DEBUG  : [/home/norbert/test/in/autocopy/Accept & Orchestra - Stalingrad (H265 AAC).mp4] Decoder thread is running.
2019-05-28 19:24:58 WARNING: 1 video frames left in buffer and not written to target file!
2019-05-28 19:24:58 ERROR  : [/home/norbert/test/out/Accept & Orchestra - Stalingrad (H265 AAC).webm] Transcoding exited with error.
2019-05-28 19:24:58 ERROR  : [/home/norbert/test/out/Accept & Orchestra - Stalingrad (H265 AAC).webm] System error: (5) Input/output error
2019-05-28 19:24:58 ERROR  : [/home/norbert/test/out/Accept & Orchestra - Stalingrad (H265 AAC).webm] FFMpeg error: (-1094995529) Invalid data found when processing input

WAV headers invalid when accessing file the first time

Report.zip

In the WAV file header, the fields

// wav_size -> FF FF FF FF
// data_bytes -> FF FF FF FF

get written too late when the header has already been sent. Probably gets updated only when write_trailer is called. Should be filled in earlier.

typedef struct wav_header {
    // RIFF Header
    char riff_header[4]; // Contains "RIFF" 
    int wav_size; // Size of the wav portion of the file, which follows the first 8 bytes. File size - 8
    char wave_header[4]; // Contains "WAVE" 

    // Format Header
    char fmt_header[4]; // Contains "fmt " (includes trailing space)
    int fmt_chunk_size; // Should be 16 for PCM
    short audio_format; // Should be 1 for PCM. 3 for IEEE Float
    short num_channels;
    int sample_rate;
    int byte_rate; // Number of bytes per second. sample_rate * num_channels * Bytes Per Sample
    short sample_alignment; // num_channels * Bytes Per Sample
    short bit_depth; // Number of bits per sample

    // ... IDv3 header. Start LIST

    // Data
    char data_header[4]; // Contains "data" 
    int data_bytes; // Number of bytes in data. Number of samples * num_channels * sample byte size
    // uint8_t bytes[]; // Remainder of wave file is bytes
} wav_header;

Invalid VOB in "LaBrassBanda - Kiah Royal"

The DVD contains a VOB (VTS_03_0.VOB) that is not accepted by the FFmpeg API. It contains a video track only, but it is detected as invalid track:

# ffprobe VTS_03_1.VOB
ffprobe version N-92223-g18d391cffe-1 Copyright (c) 2007-2018 the FFmpeg developers
  built with gcc 6.3.0 (Debian 6.3.0-18+deb9u1) 20170516
  configuration: --prefix=/usr --extra-version=1 --toolchain=hardened --libdir=/usr/lib/x86_64-linux-gnu --incdir=/usr/include/x86_64-linux-gnu --enabl
e-shared --disable-static --enable-runtime-cpudetect --enable-nonfree --extra-cflags='-mtune=core2' --extra-cflags=-DLIBTWOLAME_STATIC --extra-cflags=-
I/usr/lib/jvm/java-8-openjdk-amd64/include/ --extra-cflags=-I/usr/lib/jvm/java-8-openjdk-amd64/include/linux/ --extra-cflags=-O3 --enable-shared --enab
le-version3 --enable-avresample --extra-libs=-lpng --extra-libs=-lstdc++ --enable-version3 --enable-ffplay --enable-gpl --enable-fontconfig --enable-av
isynth --enable-bzlib --enable-frei0r --enable-filter=frei0r --enable-gcrypt --enable-gmp --enable-gray --enable-iconv --enable-libass --enable-libblur
ay --enable-libbs2b --enable-libcaca --enable-libcdio --enable-libdc1394 --enable-libfontconfig --enable-libfreetype --enable-libfribidi --enable-libgm
e --enable-libgsm --enable-libmodplug --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-libopus -
-enable-libpulse --enable-librtmp --enable-librubberband --enable-libshine --enable-libsmbclient --enable-libsnappy --enable-libsoxr --enable-libspeex
--enable-libssh --enable-libtheora --enable-libtwolame --enable-libv4l2 --enable-libvo-amrwbenc --enable-libvorbis --enable-libwavpack --enable-libwebp
 --enable-libx264 --enable-libxcb --enable-libxcb-shape --enable-libxcb-shm --enable-libxcb-xfixes --enable-libxvid --enable-libzmq --enable-lzma --ena
ble-omx --enable-omx-rpi --enable-openal --enable-opencl --enable-opengl --enable-openssl --enable-sdl2 --enable-zlib --enable-libvpx
  libavutil      56. 19.101 / 56. 19.101
  libavcodec     58. 33.102 / 58. 33.102
  libavformat    58. 19.101 / 58. 19.101
  libavdevice    58.  4.105 / 58.  4.105
  libavfilter     7. 35.100 /  7. 35.100
  libavresample   4.  0.  0 /  4.  0.  0
  libswscale      5.  2.100 /  5.  2.100
  libswresample   3.  2.100 /  3.  2.100
  libpostproc    55.  2.100 / 55.  2.100
[mpeg @ 0x5571f3991bc0] probed stream 1 failed
[mpeg @ 0x5571f3991bc0] Could not find codec parameters for stream 1 (Video: none, none): unknown codec
Consider increasing the value for the 'analyzeduration' and 'probesize' options
Input #0, mpeg, from 'VTS_03_1.VOB':
  Duration: 00:00:00.00, start: 0.336711, bitrate: 93835636 kb/s
    Stream #0:0[0x1bf]: Data: dvd_nav_packet
    Stream #0:1[0x1e0]: Video: none, none, 90k tbr, 90k tbn
Unsupported codec with id 100357 for input stream 0
Unsupported codec with id 0 for input stream 1

This causes the transcode to fail.

cannot allocate memory

high bitrate yuv444 h264 wont decode images

2019-05-29 14:38:48 DEBUG  : [/media/zhukov/storage/clients/universal/mummy/4k/R1_235_CC.mp4] Starting decoder thread.
2019-05-29 14:38:48 INFO   : [/media/zhukov/storage/clients/universal/mummy/4k/R1_235_CC.mp4] Transcoding to png.
2019-05-29 14:38:48 DEBUG  : [/media/zhukov/storage/clients/universal/mummy/4k/R1_235_CC.mp4] Opening input file.
2019-05-29 14:38:48 DEBUG  : [/media/zhukov/storage/clients/universal/mummy/4k/R1_235_CC.mp4] Opened input codec for stream #0: H.264 / AVC / MPEG-4 AVC / MPEG-4 part 10
2019-05-29 14:38:48 INFO   : [/media/zhukov/storage/clients/universal/mummy/4k/R1_235_CC.mp4] Video in: [email protected] Mbps [21:58.832]
2019-05-29 14:38:48 INFO   : [/home/zhukov/ffmpegfs/mummy/scans/R1_235_CC.png] Opening output file.
2019-05-29 14:38:48 DEBUG  : [/home/zhukov/ffmpegfs/mummy/scans/R1_235_CC.png] Opening format type 'png'.
2019-05-29 14:38:48 DEBUG  : [/home/zhukov/ffmpegfs/mummy/scans/R1_235_CC.png] Output pixel format: rgb48be
2019-05-29 14:38:48 DEBUG  : [/media/zhukov/storage/clients/universal/mummy/4k/R1_235_CC.mp4] Decoder thread is running.
   open[140488648701424] flags: 0x8000 /R1_235_CC.mp4/00000000250.png
   unique: 34926, success, outsize: 32
unique: 34927, opcode: READ (15), nodeid: 258, insize: 80, pid: 24843
read[140488648701424] 8192 bytes from 0 flags: 0x8000
unique: 34928, opcode: LOOKUP (1), nodeid: 1, insize: 54, pid: 11041
LOOKUP /R1_235_CC.mp4
getattr /R1_235_CC.mp4
   NODEID: 2
   unique: 34928, success, outsize: 144
2019-05-29 14:38:53 ERROR  : [/home/zhukov/ffmpegfs/mummy/scans/R1_235_CC.png] Reading image frame no. 250: (12) Cannot allocate memory
   unique: 34927, error: -12 (Cannot allocate memory), outsize: 16
unique: 34929, opcode: LOOKUP (1), nodeid: 2, insize: 56, pid: 13793
LOOKUP /R1_235_CC.mp4/00000000250.png
getattr /R1_235_CC.mp4/00000000250.png
   NODEID: 258
   unique: 34929, success, outsize: 144
unique: 34930, opcode: FLUSH (25), nodeid: 258, insize: 64, pid: 13793
   unique: 34930, error: -38 (Function not implemented), outsize: 16
unique: 34931, opcode: RELEASE (18), nodeid: 258, insize: 64, pid: 0
release[140488648701424] flags: 0x8000
   unique: 34931, success, outsize: 16

Please add ALAC support

Apple Lossless is available via ffmpeg or other tools, it's pretty fast and great for iTunes users as it takes up less space than wav/aiff.

Add Apple Prores support

It would be immensely powerful to use ffmpeg to transcode into ProRes as it is extremely fast and random-access (reference #9).

Variable bitrate outputs

Hi,

I understand that fixed bitrate makes it possible to calculate the maximum filesize on 'open', so:

  1. Why is this required? - To support seeking?
  2. How much work will it take to support dynamic bitrates?

GPF and core dump if not enough disk space to transcode

It seems browsing in Explorer is now much quicker, I did run into segfaults almost immediately. Trying to open a folder containing a feature length mkv using Resolve file had the following result (with Resolve hanging for a long time before the segfault):

 # ffmpegfs -f --win_smb_fix=1 --log_stderr --max_inactive_suspend=1h --max_inactive_abort=24h --desttype=prores+aiff /mnt/datasets/lz4 /mnt/virtual/ffmpegfs -o allow_other,ro
2019-01-11 23:11:50 INFO   : FFMPEGFS V1.6 initialising.
2019-01-11 23:11:50 INFO   : Mapping '/mnt/datasets/lz4/' to '/mnt/virtual/ffmpegfs/'.
2019-01-11 23:11:50 INFO   : Process with PID 21775 is now client, master is PID 12940.
2019-01-11 23:12:45 INFO   : [/mnt/datasets/lz4/Movies/bluray/bluray.mkv] Transcoding to prores. Predicted size 137378311110 bytes.
2019-01-11 23:12:45 INFO   : [/mnt/datasets/lz4/Movies/bluray/bluray.mkv] Opening input file.
2019-01-11 23:12:45 INFO   : [/mnt/datasets/lz4/Movies/bluray/bluray.mkv] Video in: [email protected] Mbps [unset]
2019-01-11 23:12:45 INFO   : [/mnt/datasets/lz4/Movies/bluray/bluray.mkv] Audio in: [email protected] Mbps 6 Channels 48.000 kHz [unset]
2019-01-11 23:12:45 INFO   : [/mnt/virtual/ffmpegfs/bluray.mov] Opening output file.
2019-01-11 23:12:45 INFO   : [/mnt/virtual/ffmpegfs/bluray.mov] Audio out: [email protected] Mbps 2 Channels 44.100 kHz [01:43:10.4]
2019-01-11 23:12:45 INFO   : [/mnt/virtual/ffmpegfs/bluray.mov] Video out: [email protected] Mbps [01:43:10.4]
2019-01-11 23:12:46 INFO   : [/mnt/virtual/ffmpegfs/bluray.mov] Creating audio resampler: fltp -> s16 / 48.000 kHz -> 44.100 kHz / 5.1(side) -> stereo.
2019-01-11 23:12:46 WARNING: [/mnt/virtual/ffmpegfs/bluray.mov] Non-monotonous DTS in video output stream; previous: 0, current: 0; changing to 1. This may result in incorrect timestamps in the output.
2019-01-11 23:16:54 INFO   : [/mnt/virtual/ffmpegfs/bluray.mov] Client has gone away.
2019-01-11 23:16:54 ERROR  : [/tmp/ffmpegfs//mnt/virtual/ffmpegfs//mnt/datasets/lz4/Movies/bluray/bluray.mkv.cache.prores] Error calling ftruncate() to resize the file: Bad file descriptor
Segmentation fault

HLS/PNG: Listing DVD/Bluray/VCD virtual directories returns invalid files

To recreate, list a DVD directory:

# ll /mnt/multimedia/DVD/ 
insgesamt 16G
drwxr-xr-x 2 root root 16K Sep 11  2009 01. Chapter 001 [00-03.000].ts
drwxr-xr-x 2 root root 16K Sep 11  2009 02. Chapter 001 [00-17.000].ts
drwxr-xr-x 2 root root 16K Sep 11  2009 03. Chapter 001 [00-03.000].ts
drwxr-xr-x 2 root root 16K Sep 11  2009 04. Chapter 001 [00-03.000].ts
drwxr-xr-x 2 root root 16K Sep 11  2009 05. Chapter 001 [00-03.000].ts
drwxr-xr-x 2 root root 16K Sep 11  2009 06. Chapter 001 [00-01.720].ts
drwxr-xr-x 2 root root 16K Sep 11  2009 06. Chapter 002 [03-31.000].ts
drwxr-xr-x 2 root root 16K Sep 11  2009 06. Chapter 003 [00-01.680].ts
drwxr-xr-x 2 root root 16K Sep 11  2009 06. Title [03-34.400].ts
drwxr-xr-x 2 root root 16K Sep 11  2009 07. Chapter 001 [00-01.000].ts
drwxr-xr-x 2 root root 16K Sep 11  2009 07. Chapter 002 [00-37.600].ts
drwxr-xr-x 2 root root 16K Sep 11  2009 07. Chapter 003 [11-11.720].ts
drwxr-xr-x 2 root root 16K Sep 11  2009 07. Chapter 004 [11-13.040].ts
drwxr-xr-x 2 root root 16K Sep 11  2009 07. Chapter 005 [07-41.000].ts
drwxr-xr-x 2 root root 16K Sep 11  2009 07. Chapter 006 [11-46.480].ts
drwxr-xr-x 2 root root 16K Sep 11  2009 07. Chapter 007 [04-19.640].ts
drwxr-xr-x 2 root root 16K Sep 11  2009 07. Chapter 008 [00-08.680].ts
drwxr-xr-x 2 root root 16K Sep 11  2009 07. Title [46-59.160].ts
drwxr-xr-x 2 root root 16K Sep 11  2009 08. Chapter 002 [04-11.720].ts
drwxr-xr-x 2 root root 16K Sep 11  2009 08. Chapter 003 [00-01.760].ts
drwxr-xr-x 2 root root 16K Sep 11  2009 08. Title [04-14.440].ts
drwxr-xr-x 2 root root 16K Sep 11  2009 09. Chapter 001 [00-02.000].ts
drwxr-xr-x 2 root root 16K Sep 11  2009 09. Chapter 002 [04-21.000].ts
drwxr-xr-x 2 root root 16K Sep 11  2009 09. Chapter 003 [00-01.320].ts
drwxr-xr-x 2 root root 16K Sep 11  2009 09. Title [04-24.320].ts
drwxr-xr-x 2 root root 16K Sep 11  2009 10. Chapter 001 [00-06.960].ts
drwxr-xr-x 2 root root 16K Sep 11  2009 10. Chapter 002 [01-32.960].ts
drwxr-xr-x 2 root root 16K Sep 11  2009 10. Chapter 003 [04-32.960].ts
drwxr-xr-x 2 root root 16K Sep 11  2009 10. Chapter 004 [03-55.240].ts
drwxr-xr-x 2 root root 16K Sep 11  2009 10. Chapter 005 [05-11.720].ts
drwxr-xr-x 2 root root 16K Sep 11  2009 10. Chapter 006 [04-26.000].ts
drwxr-xr-x 2 root root 16K Sep 11  2009 10. Chapter 007 [03-32.000].ts
drwxr-xr-x 2 root root 16K Sep 11  2009 10. Chapter 008 [00-26.480].ts
drwxr-xr-x 2 root root 16K Sep 11  2009 10. Chapter 009 [05-09.720].ts
drwxr-xr-x 2 root root 16K Sep 11  2009 10. Chapter 010 [02-33.240].ts
drwxr-xr-x 2 root root 16K Sep 11  2009 10. Chapter 011 [05-21.240].ts
drwxr-xr-x 2 root root 16K Sep 11  2009 10. Chapter 012 [03-41.720].ts
drwxr-xr-x 2 root root 16K Sep 11  2009 10. Chapter 013 [03-25.720].ts
drwxr-xr-x 2 root root 16K Sep 11  2009 10. Chapter 014 [04-36.480].ts
drwxr-xr-x 2 root root 16K Sep 11  2009 10. Chapter 015 [03-23.240].ts
drwxr-xr-x 2 root root 16K Sep 11  2009 10. Chapter 016 [04-54.480].ts
drwxr-xr-x 2 root root 16K Sep 11  2009 10. Chapter 017 [07-33.240].ts
drwxr-xr-x 2 root root 16K Sep 11  2009 10. Chapter 018 [04-27.720].ts
drwxr-xr-x 2 root root 16K Sep 11  2009 10. Chapter 019 [02-18.000].ts
drwxr-xr-x 2 root root 16K Sep 11  2009 10. Chapter 020 [05-19.720].ts
drwxr-xr-x 2 root root 16K Sep 11  2009 10. Chapter 021 [08-05.720].ts
drwxr-xr-x 2 root root 16K Sep 11  2009 10. Chapter 022 [04-45.240].ts
drwxr-xr-x 2 root root 16K Sep 11  2009 10. Chapter 023 [03-56.960].ts
drwxr-xr-x 2 root root 16K Sep 11  2009 10. Chapter 024 [01-31.240].ts
drwxr-xr-x 2 root root 16K Sep 11  2009 10. Chapter 025 [00-03.240].ts
drwxr-xr-x 2 root root 16K Sep 11  2009 10. Title [01-34-51.240].ts

Perfectly OK. The list one of the subdirectories, e.g. with ll "/mnt/multimedia/DVD/10. Chapter 009 [05-09.720].ts"

Next repeat:

# ll /mnt/multimedia/DVD/ 
ls: Zugriff auf '/mnt/ffmpegfs/hls/5M/multimedia1/DVD/Musik/Arch Enemy/Tyrants of the Rising Sun - Live in Japan/000001.ts' nicht möglich: Datei oder Verzeichnis nicht gefunden
ls: Zugriff auf '/mnt/ffmpegfs/hls/5M/multimedia1/DVD/Musik/Arch Enemy/Tyrants of the Rising Sun - Live in Japan/hls.ts' nicht möglich: Datei oder Verzeichnis nicht gefunden
ls: Zugriff auf '/mnt/ffmpegfs/hls/5M/multimedia1/DVD/Musik/Arch Enemy/Tyrants of the Rising Sun - Live in Japan/index_0_av.ts' nicht möglich: Datei oder Verzeichnis nicht gefunden
ls: Zugriff auf '/mnt/ffmpegfs/hls/5M/multimedia1/DVD/Musik/Arch Enemy/Tyrants of the Rising Sun - Live in Japan/master.ts' nicht möglich: Datei oder Verzeichnis nicht gefunden
insgesamt 16G
-????????? ? ?    ?      ?            ? 000001.ts
drwxr-xr-x 2 root root 16K Sep 11  2009 01. Chapter 001 [00-03.000].ts
drwxr-xr-x 2 root root 16K Sep 11  2009 02. Chapter 001 [00-17.000].ts
drwxr-xr-x 2 root root 16K Sep 11  2009 03. Chapter 001 [00-03.000].ts
drwxr-xr-x 2 root root 16K Sep 11  2009 04. Chapter 001 [00-03.000].ts
drwxr-xr-x 2 root root 16K Sep 11  2009 05. Chapter 001 [00-03.000].ts
drwxr-xr-x 2 root root 16K Sep 11  2009 06. Chapter 001 [00-01.720].ts
drwxr-xr-x 2 root root 16K Sep 11  2009 06. Chapter 002 [03-31.000].ts
drwxr-xr-x 2 root root 16K Sep 11  2009 06. Chapter 003 [00-01.680].ts
drwxr-xr-x 2 root root 16K Sep 11  2009 06. Title [03-34.400].ts
drwxr-xr-x 2 root root 16K Sep 11  2009 07. Chapter 001 [00-01.000].ts
drwxr-xr-x 2 root root 16K Sep 11  2009 07. Chapter 002 [00-37.600].ts
drwxr-xr-x 2 root root 16K Sep 11  2009 07. Chapter 003 [11-11.720].ts
drwxr-xr-x 2 root root 16K Sep 11  2009 07. Chapter 004 [11-13.040].ts
drwxr-xr-x 2 root root 16K Sep 11  2009 07. Chapter 005 [07-41.000].ts
drwxr-xr-x 2 root root 16K Sep 11  2009 07. Chapter 006 [11-46.480].ts
drwxr-xr-x 2 root root 16K Sep 11  2009 07. Chapter 007 [04-19.640].ts
drwxr-xr-x 2 root root 16K Sep 11  2009 07. Chapter 008 [00-08.680].ts
drwxr-xr-x 2 root root 16K Sep 11  2009 07. Title [46-59.160].ts
drwxr-xr-x 2 root root 16K Sep 11  2009 08. Chapter 002 [04-11.720].ts
drwxr-xr-x 2 root root 16K Sep 11  2009 08. Chapter 003 [00-01.760].ts
drwxr-xr-x 2 root root 16K Sep 11  2009 08. Title [04-14.440].ts
drwxr-xr-x 2 root root 16K Sep 11  2009 09. Chapter 001 [00-02.000].ts
drwxr-xr-x 2 root root 16K Sep 11  2009 09. Chapter 002 [04-21.000].ts
drwxr-xr-x 2 root root 16K Sep 11  2009 09. Chapter 003 [00-01.320].ts
drwxr-xr-x 2 root root 16K Sep 11  2009 09. Title [04-24.320].ts
drwxr-xr-x 2 root root 16K Sep 11  2009 10. Chapter 001 [00-06.960].ts
drwxr-xr-x 2 root root 16K Sep 11  2009 10. Chapter 002 [01-32.960].ts
drwxr-xr-x 2 root root 16K Sep 11  2009 10. Chapter 003 [04-32.960].ts
drwxr-xr-x 2 root root 16K Sep 11  2009 10. Chapter 004 [03-55.240].ts
drwxr-xr-x 2 root root 16K Sep 11  2009 10. Chapter 005 [05-11.720].ts
drwxr-xr-x 2 root root 16K Sep 11  2009 10. Chapter 006 [04-26.000].ts
drwxr-xr-x 2 root root 16K Sep 11  2009 10. Chapter 007 [03-32.000].ts
drwxr-xr-x 2 root root 16K Sep 11  2009 10. Chapter 008 [00-26.480].ts
drwxr-xr-x 2 root root 16K Sep 11  2009 10. Chapter 009 [05-09.720].ts
drwxr-xr-x 2 root root 16K Sep 11  2009 10. Chapter 010 [02-33.240].ts
drwxr-xr-x 2 root root 16K Sep 11  2009 10. Chapter 011 [05-21.240].ts
drwxr-xr-x 2 root root 16K Sep 11  2009 10. Chapter 012 [03-41.720].ts
drwxr-xr-x 2 root root 16K Sep 11  2009 10. Chapter 013 [03-25.720].ts
drwxr-xr-x 2 root root 16K Sep 11  2009 10. Chapter 014 [04-36.480].ts
drwxr-xr-x 2 root root 16K Sep 11  2009 10. Chapter 015 [03-23.240].ts
drwxr-xr-x 2 root root 16K Sep 11  2009 10. Chapter 016 [04-54.480].ts
drwxr-xr-x 2 root root 16K Sep 11  2009 10. Chapter 017 [07-33.240].ts
drwxr-xr-x 2 root root 16K Sep 11  2009 10. Chapter 018 [04-27.720].ts
drwxr-xr-x 2 root root 16K Sep 11  2009 10. Chapter 019 [02-18.000].ts
drwxr-xr-x 2 root root 16K Sep 11  2009 10. Chapter 020 [05-19.720].ts
drwxr-xr-x 2 root root 16K Sep 11  2009 10. Chapter 021 [08-05.720].ts
drwxr-xr-x 2 root root 16K Sep 11  2009 10. Chapter 022 [04-45.240].ts
drwxr-xr-x 2 root root 16K Sep 11  2009 10. Chapter 023 [03-56.960].ts
drwxr-xr-x 2 root root 16K Sep 11  2009 10. Chapter 024 [01-31.240].ts
drwxr-xr-x 2 root root 16K Sep 11  2009 10. Chapter 025 [00-03.240].ts
drwxr-xr-x 2 root root 16K Sep 11  2009 10. Title [01-34-51.240].ts
-????????? ? ?    ?      ?            ? hls.ts
-????????? ? ?    ?      ?            ? index_0_av.ts
-????????? ? ?    ?      ?            ? master.ts

The contents of the subdirectory listed earlier are reflected to the DVD root. If you list one or more other directories like the above, these will also appear as invalid files, causing FFmpegfs to lock up in the end.

Smooth streaming mp4 option produces invalid files

When enable_ismv=1 is used, the resulting files do not play properly in VLC and other players. Strange enough they do play in Firefox, but get downloaded as a whole first (what is totally in contradiction what the format is supposed for).

is it possible to mount mov/mp4 as a folder with pngs/jpgs?

what would it take to implement it?

like so:
# ls /storage/videos

video1.mp4
video2.mov

# ffmpegfs /storage/videos /mnt/ffmpegfs
# find /mnt/ffmpegfs

/mnt/ffmpegfs/video1.mp4/00001.png
/mnt/ffmpegfs/video1.mp4/00002.png
...
/mnt/ffmpegfs/video1.mov/00001.png
/mnt/ffmpegfs/video1.mov/00002.png

Reencode to same file format as source file

Looks like reencoding to the same file format as the source file is not supported? I'd like to convert the video resolution and bitrate of existing mp4 files to new mp4 files. Would it be possible to add support for this?

Crash when audio format changes

In case when the audio format of the source stream changes (e.g. from 2ch stereo to 6ch surround) ffmpeg crashes because the conversion is created in the beginning (for 2ch) but suddenly changes to something else.

H264: First 12 frames are grey

Only with mp4 format the first 12 frames are simply grey, the next 2-3 frames are blurred. Happens with the H264 codec only, other codecs are not affected (mp4 and ts output format).

Memory leaks

If under heavy use, memory fills up after a while. ffmpegfs needs to stopped and restarted. There seems to be a small memory leak.

Lock ups when accessing through Samba from Windows

When a file is accessed from a Windows machine for some reason the tail of the file is accessed directly, e.g. "read 14212 bytes from 693174272". These are exactly the last 14212 bytes of the file. The number differs from file to file, but it's always exactly the number of bytes remaining.

This happens on the very CreateFile() API call which is very odd. That call should only open a file but never attempt to read anything. This read access seems to time out after 10 seconds, and the file open operation succeeds.

That causes a big problem: ffmpeg is not notified of the interrupted read and continues to transcode until the data is available, i.e. in the above case up to 690 MB. Alas, because the open does not block the app tries to access the file, but Fuse will not satisfy any read requests before the pending read request has completed. This causes another timeout, the app will receive an EPERM (Permission denied).

Same strange thing happens when Windows Explorer reads a directory. It always access the file's tail. This is a performance hog.

  1. Why does Windows access the file tail in that way?
  2. How can Fuse/ffmpegfs be notified of the interrupted read?
  3. Why does Fuse not allow access to another part of the file while a request is pending? It simply does not call fuse_read again while an earlier call blocks and waits for data.

Size of returned file after first call is wrong

When a file is opened for the first time, the resulting file has the wrong size:

  • If the file is larger than predicted, the result file is truncated to the predicted size. Excess bytes are discarded.
  • If the file is smaller a read error is returned

When the file is accessed once more (read from cache), the size is correct.

is it me or nothing happens ?

i cloned the git repo, installed all the dependancies,

./autogen.sh
./configure
make
make install

everything ok... i mount the filesystem :
ffmpegfs --audiobitrate=256K --videobitrate=1.5M /mnt/BACKUP/Video/ /mnt/ffmpegfs -o allow_other,ro

ffmpegfs

but at the end... everything is the same in the 2 test directories...

prores cant allocate memory

branch: release2.x latest checkout

  1. https://kote.videogorillas.com/vmir/ffmpegfs/Britney_Spears_Toxic.mov
  2. ffmpegfs --desttype=png -f -d /storage /ffmpegfs
  3. read pngs in 12 threads
  4. get this in logs
   open[140693263617136] flags: 0x8000 /clients/downloads/brad_rushing/Britney_Spears_Toxic.mov/00000001292.png
   unique: 1700825, success, outsize: 32
unique: 1700826, opcode: READ (15), nodeid: 508, insize: 80, pid: 14060
read[140693263617136] 1 bytes from 0 flags: 0x8000
2019-09-23 13:12:45 ERROR  : [/ffmpegfs/Britney_Spears_Toxic.png] Reading image frame no. 1288: (12) Cannot allocate memory
   unique: 1700823, error: -12 (Cannot allocate memory), outsize: 16
unique: 1700827, opcode: READ (15), nodeid: 507, insize: 80, pid: 14056
read[140693263617136] 6 bytes from 0 flags: 0x8000

HLS segments are all size 0 on first "ls"

When a directory is listed for the first time, all HLS segments have zero size. Seems that size prediction does not work as expected.

norbert@schleppmops:$ ll "/mnt/ffmpegfs/hls/1M/multimedia1/DVD/Musik/Eluveitie/Live @Summer Breeze 2008/02. Chapter 002 [04-20.160].ts" 
insgesamt 10240
-rwxr-xr-x 1 norbert norbert 6400836 Apr 19  2009 000001.ts
-rwxr-xr-x 1 norbert norbert       0 Apr 19  2009 000002.ts
-rwxr-xr-x 1 norbert norbert       0 Apr 19  2009 000003.ts
-rwxr-xr-x 1 norbert norbert       0 Apr 19  2009 000004.ts
-rwxr-xr-x 1 norbert norbert       0 Apr 19  2009 000005.ts
-rwxr-xr-x 1 norbert norbert       0 Apr 19  2009 000006.ts
-rwxr-xr-x 1 norbert norbert       0 Apr 19  2009 000007.ts
-rwxr-xr-x 1 norbert norbert       0 Apr 19  2009 000008.ts
-rwxr-xr-x 1 norbert norbert       0 Apr 19  2009 000009.ts
-rwxr-xr-x 1 norbert norbert       0 Apr 19  2009 000010.ts
-rwxr-xr-x 1 norbert norbert       0 Apr 19  2009 000011.ts
-rwxr-xr-x 1 norbert norbert       0 Apr 19  2009 000012.ts
-rwxr-xr-x 1 norbert norbert       0 Apr 19  2009 000013.ts
-rwxr-xr-x 1 norbert norbert       0 Apr 19  2009 000014.ts
-rwxr-xr-x 1 norbert norbert       0 Apr 19  2009 000015.ts
-rwxr-xr-x 1 norbert norbert       0 Apr 19  2009 000016.ts
-rwxr-xr-x 1 norbert norbert       0 Apr 19  2009 000017.ts
-rwxr-xr-x 1 norbert norbert       0 Apr 19  2009 000018.ts
-rwxr-xr-x 1 norbert norbert       0 Apr 19  2009 000019.ts
-rwxr-xr-x 1 norbert norbert       0 Apr 19  2009 000020.ts
-rwxr-xr-x 1 norbert norbert       0 Apr 19  2009 000021.ts
-rwxr-xr-x 1 norbert norbert       0 Apr 19  2009 000022.ts
-rwxr-xr-x 1 norbert norbert       0 Apr 19  2009 000023.ts
-rwxr-xr-x 1 norbert norbert       0 Apr 19  2009 000024.ts
-rwxr-xr-x 1 norbert norbert       0 Apr 19  2009 000025.ts
-rwxr-xr-x 1 norbert norbert       0 Apr 19  2009 000026.ts
-rwxr-xr-x 1 norbert norbert    1285 Apr 19  2009 hls.html
-rwxr-xr-x 1 norbert norbert     812 Apr 19  2009 index_0_av.m3u8
-rwxr-xr-x 1 norbert norbert      55 Apr 19  2009 master.m3u8

Add "Auto Stream Copy"

  • Vcodec copy and acodec copy if supported by target
  • Transcode video if source codec not supported by target
  • Transcode audio if audio source codec not supported by target

See #9.

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.