├── .github └── workflows │ ├── codeql-analysis.yml │ ├── docker-image.yml │ ├── main.yml │ ├── make-clang.yml │ └── make-gcc.yml ├── .gitignore ├── .mailmap ├── COPYING ├── COPYING.CC0 ├── COPYING.DOC ├── Doxyfile ├── FEATURES.md ├── HISTORY.md ├── INSTALL.md ├── Makefile.am ├── NEWS ├── PROBLEMS.md ├── README.md ├── TODO ├── _config.yml ├── autogen.sh ├── changelog.sh ├── configure.ac ├── cppcheck-suppressions.txt ├── cppcheck.cppcheck ├── debian ├── changelog ├── control ├── copyright ├── patches │ └── series ├── rules ├── source │ └── format ├── upstream │ ├── metadata │ └── signing-key.asc └── watch ├── docker └── Dockerfile ├── ffmpegfs.1.txt ├── mkjenkins ├── sql └── ffmpegfs.sql ├── src ├── Makefile.am ├── aiff.h ├── blurayio.cc ├── blurayio.h ├── blurayparser.cc ├── blurayparser.h ├── buffer.cc ├── buffer.h ├── cache.cc ├── cache.h ├── cache_entry.cc ├── cache_entry.h ├── cache_maintenance.cc ├── cache_maintenance.h ├── cuesheetparser.cc ├── cuesheetparser.h ├── diskio.cc ├── diskio.h ├── dvdio.cc ├── dvdio.h ├── dvdparser.cc ├── dvdparser.h ├── ffmpeg_base.cc ├── ffmpeg_base.h ├── ffmpeg_compat.h ├── ffmpeg_frame.cc ├── ffmpeg_frame.h ├── ffmpeg_profiles.cc ├── ffmpeg_profiles.h ├── ffmpeg_subtitle.cc ├── ffmpeg_subtitle.h ├── ffmpeg_transcoder.cc ├── ffmpeg_transcoder.h ├── ffmpeg_utils.cc ├── ffmpeg_utils.h ├── ffmpegfs.cc ├── ffmpegfs.h ├── fileio.cc ├── fileio.h ├── fuseops.cc ├── id3v1tag.h ├── logging.cc ├── logging.h ├── makehelp.sh ├── scripts │ ├── hls.html │ ├── videotag.php │ └── videotag.txt ├── thread_pool.cc ├── thread_pool.h ├── transcode.cc ├── transcode.h ├── vcd │ ├── vcdchapter.cc │ ├── vcdchapter.h │ ├── vcdentries.cc │ ├── vcdentries.h │ ├── vcdinfo.cc │ ├── vcdinfo.h │ ├── vcdutils.cc │ └── vcdutils.h ├── vcdio.cc ├── vcdio.h ├── vcdparser.cc ├── vcdparser.h └── wave.h └── test ├── .gitignore ├── Makefile.am ├── fpcompare.c ├── funcs.sh ├── metadata.c ├── mkvid ├── srcdir.org ├── copyright ├── cuesheet │ ├── raven_e.cue │ ├── raven_e.flac │ └── raven_e_cuesheet.flac ├── raven_d.flac └── raven_e.flac ├── srcdir ├── copyright ├── cuesheet │ ├── raven_e.cue │ ├── raven_e.flac │ └── raven_e_cuesheet.flac ├── dir.flac │ └── .empty ├── frame_test_pal.mp4 ├── raven_d.ogg ├── raven_e.flac └── snowboard.mp4 ├── tags ├── ffmpeg4.0 │ ├── obama.ts.tag │ ├── raven.ts.tag │ ├── raven_d.aiff.tag │ ├── raven_d.alac.tag │ ├── raven_d.flac.tag │ ├── raven_d.mov.tag │ ├── raven_d.mp3.tag │ ├── raven_d.mp4.tag │ ├── raven_d.ogg.tag │ ├── raven_d.opus.tag │ ├── raven_d.prores.tag │ ├── raven_d.ts.tag │ ├── raven_d.wav.tag │ ├── raven_d.webm.tag │ ├── raven_e.aiff.tag │ ├── raven_e.alac.tag │ ├── raven_e.flac.tag │ ├── raven_e.mov.tag │ ├── raven_e.mp3.tag │ ├── raven_e.mp4.tag │ ├── raven_e.ogg.tag │ ├── raven_e.opus.tag │ ├── raven_e.prores.tag │ ├── raven_e.ts.tag │ ├── raven_e.wav.tag │ ├── raven_e.webm.tag │ ├── snowboard.mov.tag │ ├── snowboard.mp4.tag │ ├── snowboard.prores.tag │ ├── snowboard.ts.tag │ └── snowboard.webm.tag ├── ffmpeg4.2 │ ├── obama.ts.tag │ ├── raven.ts.tag │ ├── raven_d.aiff.tag │ ├── raven_d.alac.tag │ ├── raven_d.flac.tag │ ├── raven_d.mov.tag │ ├── raven_d.mp3.tag │ ├── raven_d.mp4.tag │ ├── raven_d.ogg.tag │ ├── raven_d.opus.tag │ ├── raven_d.prores.tag │ ├── raven_d.ts.tag │ ├── raven_d.wav.tag │ ├── raven_d.webm.tag │ ├── raven_e.aiff.tag │ ├── raven_e.alac.tag │ ├── raven_e.flac.tag │ ├── raven_e.mov.tag │ ├── raven_e.mp3.tag │ ├── raven_e.mp4.tag │ ├── raven_e.ogg.tag │ ├── raven_e.opus.tag │ ├── raven_e.prores.tag │ ├── raven_e.ts.tag │ ├── raven_e.wav.tag │ ├── raven_e.webm.tag │ ├── snowboard.mov.tag │ ├── snowboard.mp4.tag │ ├── snowboard.prores.tag │ ├── snowboard.ts.tag │ └── snowboard.webm.tag ├── ffmpeg4.3 │ ├── obama.ts.tag │ ├── raven.ts.tag │ ├── raven_d.aiff.tag │ ├── raven_d.alac.tag │ ├── raven_d.flac.tag │ ├── raven_d.mov.tag │ ├── raven_d.mp3.tag │ ├── raven_d.mp4.tag │ ├── raven_d.ogg.tag │ ├── raven_d.opus.tag │ ├── raven_d.prores.tag │ ├── raven_d.ts.tag │ ├── raven_d.wav.tag │ ├── raven_d.webm.tag │ ├── raven_e.aiff.tag │ ├── raven_e.alac.tag │ ├── raven_e.flac.tag │ ├── raven_e.mov.tag │ ├── raven_e.mp3.tag │ ├── raven_e.mp4.tag │ ├── raven_e.ogg.tag │ ├── raven_e.opus.tag │ ├── raven_e.prores.tag │ ├── raven_e.ts.tag │ ├── raven_e.wav.tag │ ├── raven_e.webm.tag │ ├── snowboard.mov.tag │ ├── snowboard.mp4.tag │ ├── snowboard.prores.tag │ ├── snowboard.ts.tag │ └── snowboard.webm.tag └── ffmpegN │ ├── obama.ts.tag │ ├── raven.ts.tag │ ├── raven_d.aiff.tag │ ├── raven_d.alac.tag │ ├── raven_d.flac.tag │ ├── raven_d.mov.tag │ ├── raven_d.mp3.tag │ ├── raven_d.mp4.tag │ ├── raven_d.ogg.tag │ ├── raven_d.opus.tag │ ├── raven_d.prores.tag │ ├── raven_d.ts.tag │ ├── raven_d.wav.tag │ ├── raven_d.webm.tag │ ├── raven_e.aiff.tag │ ├── raven_e.alac.tag │ ├── raven_e.flac.tag │ ├── raven_e.mov.tag │ ├── raven_e.mp3.tag │ ├── raven_e.mp4.tag │ ├── raven_e.ogg.tag │ ├── raven_e.opus.tag │ ├── raven_e.prores.tag │ ├── raven_e.ts.tag │ ├── raven_e.wav.tag │ ├── raven_e.webm.tag │ ├── snowboard.mov.tag │ ├── snowboard.mp4.tag │ ├── snowboard.prores.tag │ ├── snowboard.ts.tag │ └── snowboard.webm.tag ├── test_audio ├── test_audio_aiff ├── test_audio_alac ├── test_audio_flac ├── test_audio_mov ├── test_audio_mp3 ├── test_audio_mp4 ├── test_audio_ogg ├── test_audio_opus ├── test_audio_prores ├── test_audio_ts ├── test_audio_wav ├── test_audio_webm ├── test_cuesheet ├── test_cuesheet_embedded ├── test_cuesheet_file ├── test_filecount_hls ├── test_filenames ├── test_filenames_aiff ├── test_filenames_alac ├── test_filenames_flac ├── test_filenames_hls ├── test_filenames_mov ├── test_filenames_mp3 ├── test_filenames_mp4 ├── test_filenames_ogg ├── test_filenames_opus ├── test_filenames_prores ├── test_filenames_ts ├── test_filenames_wav ├── test_filenames_webm ├── test_filesize ├── test_filesize_aiff ├── test_filesize_alac ├── test_filesize_flac ├── test_filesize_hls ├── test_filesize_mov ├── test_filesize_mp3 ├── test_filesize_mp4 ├── test_filesize_ogg ├── test_filesize_opus ├── test_filesize_prores ├── test_filesize_ts ├── test_filesize_video ├── test_filesize_video_mov ├── test_filesize_video_mp4 ├── test_filesize_video_prores ├── test_filesize_video_ts ├── test_filesize_video_webm ├── test_filesize_wav ├── test_filesize_webm ├── test_frameset ├── test_frameset_bmp ├── test_frameset_jpg ├── test_frameset_png ├── test_picture ├── test_picture_aiff ├── test_picture_alac ├── test_picture_flac ├── test_picture_mov ├── test_picture_mp3 ├── test_picture_mp4 ├── test_picture_ogg ├── test_picture_opus ├── test_picture_prores ├── test_picture_ts ├── test_picture_wav ├── test_picture_webm ├── test_tags ├── test_tags_aiff ├── test_tags_alac ├── test_tags_flac ├── test_tags_mov ├── test_tags_mp3 ├── test_tags_mp4 ├── test_tags_ogg ├── test_tags_opus ├── test_tags_prores ├── test_tags_ts ├── test_tags_wav ├── test_tags_webm ├── test_video_hw ├── test_video_hw_dec_cuda ├── test_video_hw_dec_mmal ├── test_video_hw_dec_v4l2m2m ├── test_video_hw_dec_vaapi ├── test_video_hw_enc_cuda ├── test_video_hw_enc_omx ├── test_video_hw_enc_v4l2m2m └── test_video_hw_enc_vaapi /.github/workflows/codeql-analysis.yml: -------------------------------------------------------------------------------- 1 | # For most projects, this workflow file will not need changing; you simply need 2 | # to commit it to your repository. 3 | # 4 | # You may wish to alter this file to override the set of languages analyzed, 5 | # or to provide custom queries or build logic. 6 | # 7 | # ******** NOTE ******** 8 | # We have attempted to detect the languages in your repository. Please check 9 | # the `language` matrix defined below to confirm you have the correct set of 10 | # supported CodeQL languages. 11 | # 12 | name: "CodeQL" 13 | 14 | on: 15 | push: 16 | branches: [ master ] 17 | paths-ignore: 18 | - '**.md' 19 | - '*COPYING' 20 | - '*COPYING.CC0' 21 | - '*COPYING.DOC' 22 | - '*ffmpegfs.cbp' 23 | - '*ffmpegfs.depend' 24 | - '*ffmpegfs.pro' 25 | - '*NEWS' 26 | - '*TODO' 27 | pull_request: 28 | # The branches below must be a subset of the branches above 29 | branches: [ master ] 30 | paths-ignore: 31 | - '**.md' 32 | - '*COPYING' 33 | - '*COPYING.CC0' 34 | - '*COPYING.DOC' 35 | - '*ffmpegfs.cbp' 36 | - '*ffmpegfs.depend' 37 | - '*ffmpegfs.pro' 38 | - '*NEWS' 39 | - '*TODO' 40 | schedule: 41 | # ┌───────────── minute (0 - 59) 42 | # │ ┌───────────── hour (0 - 23) 43 | # │ │ ┌───────────── day of the month (1 - 31) 44 | # │ │ │ ┌───────────── month (1 - 12 or JAN-DEC) 45 | # │ │ │ │ ┌───────────── day of the week (0 - 6 or SUN-SAT) 46 | # │ │ │ │ │ 47 | # │ │ │ │ │ 48 | # │ │ │ │ │ 49 | # * * * * * 50 | - cron: '35 22 * * 4' 51 | 52 | jobs: 53 | analyze: 54 | name: Analyze 55 | runs-on: ubuntu-latest 56 | permissions: 57 | actions: read 58 | contents: read 59 | security-events: write 60 | 61 | strategy: 62 | fail-fast: false 63 | matrix: 64 | language: [ 'cpp' ] 65 | # CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python', 'ruby' ] 66 | # Learn more about CodeQL language support at https://git.io/codeql-language-support 67 | 68 | steps: 69 | - name: Checkout repository 70 | uses: actions/checkout@v3 71 | 72 | # Initializes the CodeQL tools for scanning. 73 | - name: Initialize CodeQL 74 | uses: github/codeql-action/init@v3 75 | with: 76 | languages: ${{ matrix.language }} 77 | # If you wish to specify custom queries, you can do so here or in a config file. 78 | # By default, queries listed here will override any specified in a config file. 79 | # Prefix the list here with "+" to use these queries and those in the config file. 80 | # queries: ./path/to/local/query, your-org/your-repo/queries@main 81 | 82 | # Autobuild attempts to build any compiled languages (C/C++, C#, or Java). 83 | # If this step fails, then you should remove it and run the build manually (see below) 84 | #- name: Autobuild 85 | # uses: github/codeql-action/autobuild@v3 86 | 87 | # ℹ️ Command-line programs to run using the OS shell. 88 | # 📚 https://git.io/JvXDl 89 | 90 | # ✏️ If the Autobuild fails above, remove it and uncomment the following three lines 91 | # and modify them (or add more) to build your code if your project 92 | # uses a compiled language 93 | 94 | #- run: | 95 | # make bootstrap 96 | # make release 97 | 98 | - name: Prerequisites 99 | run: | 100 | sudo apt-get update 101 | sudo apt-get install -yq asciidoc-base w3m libchromaprint-dev doxygen graphviz 102 | sudo apt-get install -yq libcue-dev libfuse3-dev libsqlite3-dev libavcodec-dev libavformat-dev libswresample-dev libavutil-dev libswscale-dev libavfilter-dev libchardet-dev 103 | sudo apt-get install -yq libdvdread-dev libdvdnav-dev libbluray-dev 104 | - name: autogen.sh 105 | run: ./autogen.sh 106 | - name: configure 107 | run: ./configure 108 | - name: make 109 | run: make 110 | 111 | - name: Perform CodeQL Analysis 112 | uses: github/codeql-action/analyze@v3 113 | -------------------------------------------------------------------------------- /.github/workflows/docker-image.yml: -------------------------------------------------------------------------------- 1 | name: Build Docker Image CI 2 | 3 | on: 4 | push: 5 | branches: [ master ] 6 | paths-ignore: 7 | - '**.md' 8 | - '*COPYING' 9 | - '*COPYING.CC0' 10 | - '*COPYING.DOC' 11 | - '*ffmpegfs.cbp' 12 | - '*ffmpegfs.depend' 13 | - '*ffmpegfs.pro' 14 | - '*NEWS' 15 | - '*TODO' 16 | pull_request: 17 | branches: [ master ] 18 | paths-ignore: 19 | - '**.md' 20 | - '*COPYING' 21 | - '*COPYING.CC0' 22 | - '*COPYING.DOC' 23 | - '*ffmpegfs.cbp' 24 | - '*ffmpegfs.depend' 25 | - '*ffmpegfs.pro' 26 | - '*NEWS' 27 | - '*TODO' 28 | 29 | jobs: 30 | 31 | build: 32 | 33 | runs-on: ubuntu-latest 34 | 35 | steps: 36 | - uses: actions/checkout@v3 37 | - name: Build the Docker image 38 | run: docker build . --file docker/Dockerfile 39 | -------------------------------------------------------------------------------- /.github/workflows/main.yml: -------------------------------------------------------------------------------- 1 | name: C/C++ CI 2 | 3 | on: 4 | push: 5 | branches: [ master ] 6 | paths-ignore: 7 | - '**.md' 8 | - '*COPYING' 9 | - '*COPYING.CC0' 10 | - '*COPYING.DOC' 11 | - '*ffmpegfs.cbp' 12 | - '*ffmpegfs.depend' 13 | - '*ffmpegfs.pro' 14 | - '*NEWS' 15 | - '*TODO' 16 | pull_request: 17 | branches: [ master ] 18 | paths-ignore: 19 | - '**.md' 20 | - '*COPYING' 21 | - '*COPYING.CC0' 22 | - '*COPYING.DOC' 23 | - '*ffmpegfs.cbp' 24 | - '*ffmpegfs.depend' 25 | - '*ffmpegfs.pro' 26 | - '*NEWS' 27 | - '*TODO' 28 | jobs: 29 | build-make: 30 | 31 | runs-on: ubuntu-latest 32 | 33 | steps: 34 | - uses: actions/checkout@v3 35 | - name: Prerequisites 36 | run: | 37 | sudo apt-get update 38 | sudo apt-get install -yq cppcheck asciidoc-base w3m libchromaprint-dev doxygen graphviz 39 | sudo apt-get install -yq libcue-dev libfuse3-dev libsqlite3-dev libavcodec-dev libavformat-dev libswresample-dev libavutil-dev libswscale-dev libavfilter-dev libchardet-dev 40 | sudo apt-get install -yq libdvdread-dev libdvdnav-dev libbluray-dev 41 | - name: autogen.sh 42 | run: ./autogen.sh 43 | - name: configure 44 | run: ./configure 45 | - name: make 46 | run: make 47 | - name: make check 48 | run: make check 49 | - name: make cppcheck 50 | run: make cppcheck 51 | - name: Archive Build Logs 52 | if: always() 53 | uses: actions/upload-artifact@v3 54 | with: 55 | name: Archive build logs 56 | path: | 57 | *.log 58 | config.status 59 | doxyfile.inc 60 | - name: Archive Test Results 61 | if: always() 62 | uses: actions/upload-artifact@v3 63 | with: 64 | name: Collected test results 65 | path: | 66 | test/*.log 67 | test/*.trs 68 | test/*.tag 69 | -------------------------------------------------------------------------------- /.github/workflows/make-clang.yml: -------------------------------------------------------------------------------- 1 | name: Clang Build (GNU make) 2 | 3 | on: 4 | push: 5 | branches: [ master ] 6 | paths-ignore: 7 | - '**.md' 8 | - '*COPYING' 9 | - '*COPYING.CC0' 10 | - '*COPYING.DOC' 11 | - '*ffmpegfs.cbp' 12 | - '*ffmpegfs.depend' 13 | - '*ffmpegfs.pro' 14 | - '*NEWS' 15 | - '*TODO' 16 | pull_request: 17 | branches: [ master ] 18 | paths-ignore: 19 | - '**.md' 20 | - '*COPYING' 21 | - '*COPYING.CC0' 22 | - '*COPYING.DOC' 23 | - '*ffmpegfs.cbp' 24 | - '*ffmpegfs.depend' 25 | - '*ffmpegfs.pro' 26 | - '*NEWS' 27 | - '*TODO' 28 | jobs: 29 | build: 30 | 31 | runs-on: ubuntu-latest 32 | 33 | steps: 34 | - uses: actions/checkout@v3 35 | - name: Prerequisites 36 | run: | 37 | sudo apt-get update 38 | sudo apt-get install -yq cppcheck asciidoc-base w3m libchromaprint-dev doxygen graphviz 39 | sudo apt-get install -yq libcue-dev libfuse3-dev libsqlite3-dev libavcodec-dev libavformat-dev libswresample-dev libavutil-dev libswscale-dev libavfilter-dev libchardet-dev 40 | sudo apt-get install -yq libdvdread-dev libdvdnav-dev libbluray-dev 41 | - name: autogen.sh 42 | run: ./autogen.sh 43 | - name: configure 44 | run: CC=clang CXX=clang++ ./configure 45 | - name: make 46 | run: make -s -j `nproc` 47 | - name: make check 48 | run: make -s -j `nproc` check 49 | - name: Archive Clang Build Logs 50 | if: always() 51 | uses: actions/upload-artifact@v3 52 | with: 53 | name: Collected build logs 54 | path: | 55 | *.log 56 | config.status 57 | doxyfile.inc 58 | - name: Archive Test Results 59 | if: always() 60 | uses: actions/upload-artifact@v3 61 | with: 62 | name: Collected test results 63 | path: | 64 | test/*.log 65 | test/*.trs 66 | test/*.tag 67 | -------------------------------------------------------------------------------- /.github/workflows/make-gcc.yml: -------------------------------------------------------------------------------- 1 | name: GCC Build (GNU make) 2 | 3 | on: 4 | push: 5 | branches: [ master ] 6 | paths-ignore: 7 | - '**.md' 8 | - '*COPYING' 9 | - '*COPYING.CC0' 10 | - '*COPYING.DOC' 11 | - '*ffmpegfs.cbp' 12 | - '*ffmpegfs.depend' 13 | - '*ffmpegfs.pro' 14 | - '*NEWS' 15 | - '*TODO' 16 | pull_request: 17 | branches: [ master ] 18 | paths-ignore: 19 | - '**.md' 20 | - '*COPYING' 21 | - '*COPYING.CC0' 22 | - '*COPYING.DOC' 23 | - '*ffmpegfs.cbp' 24 | - '*ffmpegfs.depend' 25 | - '*ffmpegfs.pro' 26 | - '*NEWS' 27 | - '*TODO' 28 | jobs: 29 | build: 30 | 31 | runs-on: ubuntu-latest 32 | 33 | steps: 34 | - uses: actions/checkout@v3 35 | - name: Prerequisites 36 | run: | 37 | sudo apt-get update 38 | sudo apt-get install -yq cppcheck asciidoc-base w3m libchromaprint-dev doxygen graphviz 39 | sudo apt-get install -yq libcue-dev libfuse3-dev libsqlite3-dev libavcodec-dev libavformat-dev libswresample-dev libavutil-dev libswscale-dev libavfilter-dev libchardet-dev 40 | sudo apt-get install -yq libdvdread-dev libdvdnav-dev libbluray-dev 41 | - name: autogen.sh 42 | run: ./autogen.sh 43 | - name: configure 44 | run: CC=gcc CXX="g++" ./configure 45 | - name: make 46 | run: make -s -j `nproc` 47 | - name: make check 48 | run: make -s -j `nproc` check 49 | - name: make cppcheck 50 | run: make -s -j `nproc` cppcheck 51 | - name: Archive GCC Build Logs 52 | if: always() 53 | uses: actions/upload-artifact@v3 54 | with: 55 | name: Collected build logs 56 | path: | 57 | *.log 58 | config.status 59 | doxyfile.inc 60 | - name: Archive Test Results 61 | if: always() 62 | uses: actions/upload-artifact@v3 63 | with: 64 | name: Collected test results 65 | path: | 66 | test/*.log 67 | test/*.trs 68 | test/*.tag 69 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | *.o 2 | *.su 3 | *.user 4 | .directory 5 | core 6 | doxyfile.inc 7 | *.log 8 | doxygen/ 9 | /ffmpegfs.1 10 | /ffmpegfs.1.hhc 11 | /ffmpegfs.1.hhp 12 | /ffmpegfs.1.htmlhelp/ 13 | /ffmpegfs.1.pdf 14 | /ffmpegfs.1.text 15 | /ffmpegfs.1.fo 16 | /ffmpegfs.1.xml 17 | Makefile 18 | Makefile.in 19 | .deps/ 20 | /aclocal.m4 21 | /autom4te.cache 22 | /config 23 | /config.status 24 | /configure 25 | /src/.deps/ 26 | /lib/libbase64.a 27 | /libtool 28 | /src/config.h 29 | /src/config.h.in 30 | /src/ffmpegfs 31 | /src/ffmpegfshelp.h 32 | /src/stamp-h1 33 | /src/vcd/.deps/ 34 | /src/vcd/.dirstamp 35 | /test/*.trs 36 | /test/.deps/ 37 | /test/fpcompare 38 | *.autosave 39 | *.in~ 40 | /.project 41 | *.gcda 42 | gh-pages/ 43 | mkdoxy 44 | /bin 45 | /obj 46 | /*.layout 47 | /cppcheck-cppcheck-build-dir/ 48 | /CMakeCache.txt 49 | /CMakeFiles/ 50 | /*.cmake 51 | /Testing/ 52 | /_CPack_Packages/ 53 | /install_manifest.txt 54 | /CMakeDoxyfile.in 55 | /ChangeLog 56 | /.ninja_deps 57 | /.ninja_log 58 | /build.ninja 59 | /valgrind-out.txt* 60 | # Eclipse Project 61 | /.cproject 62 | /.settings 63 | # All backup files 64 | *~ 65 | /.qtc_clangd/ 66 | /CMakeCache.txt.prev 67 | 68 | -------------------------------------------------------------------------------- /.mailmap: -------------------------------------------------------------------------------- 1 | Norbert Schlia 2 | -------------------------------------------------------------------------------- /PROBLEMS.md: -------------------------------------------------------------------------------- 1 | # Fixing Problems 2 | 3 | ## General problems accessing a file 4 | 5 | Due to the nature in which FFmpegfs works, if anything goes wrong, it can only report a general error. That means, when there is a problem accessing a file, copying or opening it, you will get an "Invalid argument" or "Operation not permitted". Not really informative. There is no way to pass the original result code through the file system. 6 | 7 | What you will have to do is refer to the syslog, system journal, or to the FFmpeg log itself, optionally at a higher verbosity. If you are unable to resolve the problem yourself, feel free to create [an issue](https://github.com/nschlia/ffmpegfs/issues), stating what you have done and what has happened. Do not forget to add logs (preferably at a higher verbosity) and, if possible, a description of how to recreate the issue. It would also be helpful to have an example of the media file that is generating the error. Copyrighted material should never be sent, nevertheless. 8 | 9 | ## Transcoding too slow 10 | 11 | Slow transcoding can be caused by a variety of factors, including a slow CPU or network issues. This might help with decoding and encoding speed: [Building FFmpeg with optimisations](INSTALL.md#building-ffmpeg-with-optimisations). 12 | 13 | ## Lock ups when accessed through Samba 14 | 15 | When accessed from a Samba drive, the pending read can lock the whole share, causing Windows Explorer and even KDE Dolphin to freeze. Any access from the same machine to that share is blocked. Even "ls" is not possible and blocks until the data is returned. 16 | 17 | It seems others had the same problem: 18 | 19 | http://samba.2283325.n4.nabble.com/Hangs-Accessing-fuse-filesystem-in-Windows-through-Samba-td4681904.html 20 | 21 | Adding this to the [global] config in smb.conf fixes that: 22 | 23 | oplocks = no 24 | level2 oplocks = no 25 | aio read size = 1 26 | 27 | The "aio read size" parameter may be moved to the share config: 28 | 29 | aio read size = 1 30 | 31 | ## rsync, Beyond Compare and other tools 32 | 33 | Some copy tools do not get along very well with dynamically generated files, as in [Issue #23: Partial transcode of some files](https://github.com/nschlia/ffmpegfs/issues/22). 34 | 35 | Under Linux, it is best to use (optionally with the -r parameter) 36 | 37 | cp -upv /path/to/source /path/to/target 38 | 39 | This will copy all missing or changed files without missing parts. On the Windows side, Windows Explorer or copy/xcopy work. Beyond Compare and comparable tools might only duplicate the expected size without responding to changes in size. 40 | 41 | Please take note of the "-p" parameter, which means "—preserve=mode,ownership,timestamps." It appears that files may occasionally be copied with zero size if it is absent. 42 | 43 | ## Open hls.html from disk to play HLS output. 44 | 45 | The majority of browsers forbid playing back files from disc. You may put them into a website directory, however sometimes https must be used in order to allow playback. 46 | 47 | **To enable disk playback in Firefox:** 48 | 49 | - Open about:config 50 | - Set security.fileuri.strict_origin_policy to false. 51 | 52 | ## Songs get cut short 53 | 54 | If you are using SAMBA or NFS and songs don't play all the way through, you're in trouble. 55 | 56 | It occurs when files are transcoded live, but never when a file is retrieved from cache. This is because the final size seldom comes out exactly as expected. Size information is only available up front when a cached file is returned. 57 | 58 | If the outcome is smaller than expected, SAMBA fills files with zeros; if the outcome is larger than expected, SAMBA chops off the remaining data. 59 | 60 | Unlike SAMBA, NFS sends either the right file or one that has been chopped or padded randomly. You can do this as many times as you like, with a different result each time. 61 | 62 | There doesn't appear to be a solution to that as of now. Perhaps NFS or SAMBA can be set up to handle that, but I'm not sure how. 63 | -------------------------------------------------------------------------------- /TODO: -------------------------------------------------------------------------------- 1 | FFmpegfs TODOs 2 | ============== 3 | 4 | * I'll have many more ideas when I wake up and find them nice to have. 5 | * Any additional features that you may desire. 6 | * I am working on a Windows version. 7 | * DASH support is on my list, but the format is complicated and I currently do not have the time for that.  8 | -------------------------------------------------------------------------------- /_config.yml: -------------------------------------------------------------------------------- 1 | theme: jekyll-theme-tactile -------------------------------------------------------------------------------- /autogen.sh: -------------------------------------------------------------------------------- 1 | #! /bin/sh 2 | 3 | # We can just let autoreconf do what is needed 4 | echo 'Running autoreconf --install' 5 | autoreconf --install 6 | -------------------------------------------------------------------------------- /changelog.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | set -o pipefail 4 | 5 | echo -e 'Automatically generated by Makefile\n' > ChangeLog.tmp 6 | 7 | git log --pretty="format:%d %h / %aD%n %an <%ae>%n * %s%n" \ 8 | | sed -E -e 'N;N;N' \ 9 | -e 's|^ \(.*tag: ([0-9\.]+).*\)[^\n]* (.{5,6} [0-9]{4}) .*|Changes for version \1 (\2):\n|' \ 10 | -e 's|^ \(.*\)||' >> ChangeLog.tmp \ 11 | && mv -f ChangeLog.tmp ChangeLog \ 12 | || ( rm -f ChangeLog.tmp ; exit 1 ) 13 | 14 | -------------------------------------------------------------------------------- /cppcheck-suppressions.txt: -------------------------------------------------------------------------------- 1 | // Why would I change a const member function to static when it is not to be used outside the class??? 2 | functionStatic 3 | // Why on Earth should I replace a range based loop with an algorithm? What's the benefit to replace a c++17 built-in with code? 4 | useStlAlgorithm 5 | // readdir_r is deprecated; use readdir(3) instead. The warning is brainless. 6 | // See https://man7.org/linux/man-pages/man3/readdir_r.3.html#DESCRIPTION 7 | readdirCalled 8 | // Do not complain about not found standard headers 9 | missingInclude 10 | // This is just annoying. 11 | unusedFunction 12 | -------------------------------------------------------------------------------- /cppcheck.cppcheck: -------------------------------------------------------------------------------- 1 | 2 | 3 | cppcheck-cppcheck-build-dir 4 | unknown 5 | false 6 | true 7 | true 8 | 2 9 | 100 10 | 11 | -------------------------------------------------------------------------------- /debian/control: -------------------------------------------------------------------------------- 1 | Source: ffmpegfs 2 | Section: utils 3 | Priority: optional 4 | Maintainer: Norbert Schlia 5 | Build-Depends: 6 | asciidoc-base, 7 | automake, 8 | bc, 9 | debhelper (>=13), 10 | debhelper-compat (= 13), 11 | libavfilter-dev, 12 | libavcodec-dev, 13 | libavformat-dev, 14 | libavutil-dev, 15 | libbluray-dev, 16 | libchromaprint-dev, 17 | libdvdnav-dev, 18 | libdvdread-dev, 19 | libfuse-dev, 20 | libsqlite3-dev, 21 | libswresample-dev, 22 | libswscale-dev, 23 | libcue-dev, 24 | libchardet-dev, 25 | libtool, 26 | docbook-xml, 27 | docbook-xsl, 28 | xsltproc, 29 | xxd, 30 | w3m 31 | Standards-Version: 4.6.2 32 | Rules-Requires-Root: no 33 | Homepage: https://nschlia.github.io/ffmpegfs/ 34 | Vcs-Git: https://salsa.debian.org/nschlia/ffmpegfs.git -b master 35 | Vcs-Browser: https://salsa.debian.org/nschlia/ffmpegfs 36 | 37 | Package: ffmpegfs 38 | Architecture: linux-any 39 | Multi-Arch: foreign 40 | Depends: 41 | ${misc:Depends}, 42 | ${shlibs:Depends} 43 | Description: Fuse Multi Media Filesystem 44 | A read-only FUSE filesystem which transcodes various audio and video formats 45 | to MP4, WebM, and many more on the fly when opened and read using the FFmpeg 46 | library, thus supporting a multitude of input formats and a variety of 47 | common output formats. 48 | . 49 | This allows access to a multi-media file collection with software and/or 50 | hardware which only understands one of the supported output formats, or 51 | transcodes files through simple drag-and-drop in a file browser. 52 | -------------------------------------------------------------------------------- /debian/copyright: -------------------------------------------------------------------------------- 1 | Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/ 2 | Upstream-Name: ffmpegfs 3 | Upstream-Contact: Norbert Schlia 4 | Source: https://github.com/nschlia/ffmpegfs 5 | 6 | Files: * 7 | Copyright: 8 | 2017-2024 Norbert Schlia 9 | 2008-2013 Kristofer Henriksson 10 | 2006-2008 David Collett 11 | License: GPL-3+ 12 | 13 | Files: debian/* 14 | Copyright: 15 | 2019-2024 Norbert Schlia 16 | 2010-2012 Alessio Treglia 17 | 2008-2009 Todd A. Jacobs 18 | License: GPL-3+ 19 | 20 | Files: test/srcdir/* 21 | Copyright: 22 | 2019-2024 Norbert Schlia 23 | License: CC0-1.0 24 | 25 | Files: 26 | NEWS 27 | ffmpegfs.1.txt 28 | ffmpegfs.1 29 | README.md 30 | INSTALL.md 31 | Copyright: 32 | 2017-2024 Norbert Schlia 33 | 2010-2011 Kristofer Henriksson 34 | License: GFDL-NIV-1.3 or GPL-3+ 35 | 36 | License: GPL-3+ 37 | This program is free software: you can redistribute it and/or modify 38 | it under the terms of the GNU General Public License as published by 39 | the Free Software Foundation, either version 3 of the License, or 40 | (at your option) any later version. 41 | . 42 | This program is distributed in the hope that it will be useful, 43 | but WITHOUT ANY WARRANTY; without even the implied warranty of 44 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 45 | GNU General Public License for more details. 46 | . 47 | You should have received a copy of the GNU General Public License 48 | along with this program. If not, see . 49 | . 50 | On Debian systems, the complete text of the GNU General 51 | Public License can be found in `/usr/share/common-licenses/GPL-3'. 52 | 53 | License: GFDL-NIV-1.3 54 | Permission is granted to copy, distribute and/or modify this 55 | document under the terms of the GNU Free Documentation License, 56 | Version 1.3 or any later version published by the Free Software 57 | Foundation; with no Invariant Sections, no Front-Cover Texts, and 58 | no Back-Cover Texts. 59 | . 60 | On Debian systems, the complete text of the GNU General Public License 61 | can be found in `/usr/share/common-licenses/GPL-3', and the complete 62 | text of the GNU Free Documentation License can be found in 63 | `/usr/share/common-licenses/GFDL-1.3'. 64 | Comment: 65 | Permission is granted to copy, distribute and/or modify this document 66 | under the terms of the GNU Free Documentation License, Version 1.3 or 67 | any later version published by the Free Software Foundation; with no 68 | Invariant Sections, with no Front-Cover Texts, and with no Back-Cover 69 | Texts. A copy of the license is included in the COPYING.DOC file as 70 | part of this distribution. 71 | 72 | License: CC0-1.0 73 | To the extent possible under law, the author(s) have dedicated all copyright 74 | and related and neighboring rights to this software to the public domain 75 | worldwide. This software is distributed without any warranty. 76 | . 77 | You should have received a copy of the CC0 Public Domain Dedication along with 78 | this software. If not, see . 79 | . 80 | On Debian systems, the complete text of the CC0 1.0 Universal license can be 81 | found in ‘/usr/share/common-licenses/CC0-1.0’. 82 | -------------------------------------------------------------------------------- /debian/patches/series: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nschlia/ffmpegfs/a5645b02020eaf901a35d846ad818e48f30706ff/debian/patches/series -------------------------------------------------------------------------------- /debian/rules: -------------------------------------------------------------------------------- 1 | #!/usr/bin/make -f 2 | 3 | #export DH_VERBOSE = 1 4 | export DEB_BUILD_MAINT_OPTIONS = hardening=+all 5 | 6 | DPKG_EXPORT_BUILDFLAGS = 1 7 | include /usr/share/dpkg/buildflags.mk 8 | 9 | # Pull in DEBIAN_VERSION variable 10 | include /usr/share/dpkg/pkg-info.mk 11 | 12 | # Get the Debian version revision: 13 | DEB_REVISION := $(word 2, $(subst -, ,$(DEB_VERSION))) 14 | 15 | CONFIG := --with-extra-version="$(DEB_REVISION)" 16 | 17 | %: 18 | dh $@ 19 | 20 | # Configure with revision 21 | override_dh_auto_configure: 22 | dh_auto_configure -- $(CONFIG) 23 | 24 | # Disable tests for now, problems will be fixed up stream 25 | # Also should declare a test suite, see testsuite-autopkgtest-missing 26 | override_dh_auto_test: 27 | -------------------------------------------------------------------------------- /debian/source/format: -------------------------------------------------------------------------------- 1 | 3.0 (quilt) 2 | -------------------------------------------------------------------------------- /debian/upstream/metadata: -------------------------------------------------------------------------------- 1 | Bug-Database: https://github.com/nschlia/ffmpegfs/issues 2 | Repository: https://github.com/nschlia/ffmpegfs.git 3 | Repository-Browse: https://github.com/nschlia/ffmpegfs 4 | Reference: 5 | Authors: Norbert Schlia 6 | Organization: Oblivion Software 7 | Name: FFmpegfs - Fuse Multi Media Filesystem 8 | Year: 2021 9 | URL: https://github.com/nschlia/ffmpegfs/blob/master/README.md 10 | -------------------------------------------------------------------------------- /debian/upstream/signing-key.asc: -------------------------------------------------------------------------------- 1 | -----BEGIN PGP PUBLIC KEY BLOCK----- 2 | 3 | mQINBFzzfBYBEADGnlfnSMFIVpRPAvDP91rMmqR/Xe+Pzd1wAhV4WP+4cycCLhSC 4 | api00J/YLKj87ruYuAQGm4Ij74lzzWL1Z0ITFi3LNz5u4tZ5PvYiJZWATWfSFf4Y 5 | q9oH8eY5wAivQ3dqYUxOMtEwgi+RH7P5ViNrhv+ps+X44VF+NFQNhmWhGSs/VVR0 6 | m9upsFYsJzYdJcW4dj9EJ9ldYaoRLovF9liBzn0BUTLv4AfZ+3lI1THXYsmA612/ 7 | qi6EDqri+2NxMhhLOvN3x3lREyFPdvVuiVtcoz3DFBWudtZeqc8RNxVpm2fR3p29 8 | 4krUGoV5rzc3V4soKMeECQ3OZ8kPQmd8fo6/oAec+NcIQqo4hsYIEPAwXRnPg5+M 9 | uMIFCAncI4dKAt6AaKimH+7/+RnplikzMm1BovwRHAqGgkBdF2RnhO/HT3rRG8Vb 10 | a8all0SiLLvRTdnpjLxqZmt9Z3EWeiWu5A16jaZhilV0I3ym0uNFD5MYv+COLoDB 11 | ha5IU85uGJFy3iJTkZw+kGXWTYmw5Lt5MhSjK7sWNAXoMc8LUeiRsaSxZcKxCxcE 12 | i+VmX4XgfNVbxgOMW/n/15hOYwVLppPZdQWTA+JFeTlVsgZbpcNa+5uzDhUjrv2K 13 | UZhHgX8cIF/6JVrirN5ZsYHEV4gCmhb0sH2KZFgxIvnZE+2dOB/ZILUfXwARAQAB 14 | tC1Ob3JiZXJ0IFNjaGxpYSA8bnNjaGxpYUBvYmxpdmlvbi1zb2Z0d2FyZS5kZT6J 15 | Ak4EEwEIADgWIQTQU7bpn3Ug1MMIJ9vP+AsC7RXA4wUCXPN8FgIbAwULCQgHAgYV 16 | CAkKCwIEFgIDAQIeAQIXgAAKCRDP+AsC7RXA45XUD/0Zmkai7CCDed7/Of+ffBuU 17 | MamzrdR8FCO3s694KUWSod2G2iKfxlO9H7OS4XCe0O1IEEUlZqtSN7wnkLqQQO8T 18 | AdmqZ46nRz7hUahIA1c3itoLS2wKvZL3nrtD3m/V+EGHW0QxBH+dOal+pTx6jA1q 19 | XVgk3gnW039BFBpp7hpHBRMyiBaanZ5rV9eIE5Qa7+AbiiH26mUQiWGDdT9AxcKB 20 | MR4Z5FokxmOXheIsAmrks2ahHdan2DYRxzrr2WCRDhFtAp5/MNLu/uQ0KDS+JBH/ 21 | UBmTmKBwW6fVhjgTJ8xGgBfUxbloa26Bh1nWb0ed/HsDYp812PSm/VFEg+ZirlAM 22 | 3Tf8IlBiXibAnAMMRsdBvv29nR474R+solDv/9Yjw2baycwV5Y76wxMYkz1AjTUn 23 | dhNa3NYPGey8SFpS2jC7VusmP94TQkvl+x5G3u3Z3WtDM1JpJtEAWnkgxYQeiZ24 24 | ZOD5BP2RYRE5zq/4uYNxUqZaUMh84tr9hPBCDwymusW0vApx0NqJkyslHQURhqy+ 25 | +ZgubdjDFSW6O15hVvE5nW8b3Bx41LDLgXGs96z7oN/KFDpev2Ed0mWA+69xJjxa 26 | nGAipO7Duc7FvKTjVOjtzmQfjP5IrccGaNJO/L3H6XjjaG97lJ1j4awrTnAecuTo 27 | DeD5FNLkugoqG/ruxWrhfrkCDQRc83wWARAAmblAkg0piu8Kn3jbx2wKVpfybpIx 28 | 3bEIkLb0TOPcv3wx7nQO+EMibm+bChXJ8XDgyZ2UQvHEh+L+BuhNYO+SjXRJDx0G 29 | TM0Bqx2kVuNcq6L6TrL+d1zhv9Bdv2b2/34twtKs1HPvmKbx/NpLGpUD6s6UDHOM 30 | nErpPtaU6Ib1wnDk3i7Pkkkwv+B6Vwki9NiHXnwda5uiJChrEwk2/bdzTysrBBpn 31 | 6MflGCOVHixa9tnXvy+XBVRDNq/7FXsnp8FL79LTeBqGZKUB4V4ot/sA23soGBNw 32 | hpxU9xMnhK8UDdoTn6Z9+vTMDN7b+BHc2DzmjRUM1PzbJVBCkb9i9F3pNZZr/cG9 33 | c7ItXViO0jPIScTCVwIaDadHmX1tlMf/CG9bTYHBfGWaHT2g9kdAS2RX2W6tY7YI 34 | FMsM5NDtdjDclQWukO0TBozpGb+CEWmBeo47hcPiQxtidygd+UEwJtN5uFkPCsE3 35 | I1ktU/oZknd63VljusJ/syOgFlaBfCgLxzgrcwgXAIgzNVX4mUKwP18btAvSdMyB 36 | QAO79eeahmujcHFfZtjNgP4GkRv/LxKJyPGuNSGz6YHEiq9CXjYwMNjE8BrcW9Qb 37 | DV9wUR+3w4Rg/zq6izT8jLhLED+bVkzfiVs9AUH5x7jIMadTQCwsADZdfRzab3sb 38 | ymE92dlMfZ5U6HcAEQEAAYkCNgQYAQgAIBYhBNBTtumfdSDUwwgn28/4CwLtFcDj 39 | BQJc83wWAhsMAAoJEM/4CwLtFcDjczQP/RgYQkwsuY5SJnS7GlETcqcYE424bGNP 40 | 4/sUFWDsKI7NTr0wTaP9ZxhBFFMEWR472+scO3FbDkfGbo4HqTJYMT/JW7cVb3E5 41 | B/svf1cxNIVC0d1dJrsdF2ZCIXZuq7IY8NQD0nWHSvY/BIQA+cvI0B0AgTd6553o 42 | 5bnlcDJzjj80nAEAb/05DyGnMM3mRMbdMNJnXs4UfbZv27zGH3neS+Hy07NifOjB 43 | z/ZBhWczqkViwun0btqgGS9XcLQFZ74AM3itxc7fBbANJmqXKbGdV6cPABG0YHOY 44 | aX6s5zFBNNIuUDixueLxMCMVn1dHaUX8va9YrbBLzooYIznx9TlPWshCqhKPA0OX 45 | OAmbgtg0c3o/R0rnTeNL1r1BSXGJUGrGthpGYiulhXwxVoAFSu3WiTdKqGNE09i0 46 | iAo/U+IsHJYNaJ6PhPT/D2397hiFD3GQ7uYaoyhxC3oYuRDRUu1I52ghjCu2bYRA 47 | /isUoAMTnW6885IXRibDYvoVY2cezU6SGZh0cnDH5O57VwEz2ZkX59c8R2U0xUeC 48 | MQ9XTf82IopevY393sK3te4M2OvTc/FugwcH4WjD/uhTJzAh6lX3Xmw6ADCwYbdY 49 | yFobxvCed2AMU/nAFHWv7wOmI2h0IecO9KYa3UQIOYG6X8iuYqP9wh3BwsxKe6JT 50 | bQ3p64NvResD 51 | =Lxz8 52 | -----END PGP PUBLIC KEY BLOCK----- 53 | -------------------------------------------------------------------------------- /debian/watch: -------------------------------------------------------------------------------- 1 | version=4 2 | opts="searchmode=plain,pgpsigurlmangle=s/$/.asc/" \ 3 | https://api.github.com/repos/nschlia/ffmpegfs/releases \ 4 | https://github.com/nschlia/ffmpegfs/releases/download/v(?:\d[\d.]*)/ffmpegfs-(\d[\d.]*)\.tar\.gz 5 | -------------------------------------------------------------------------------- /docker/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM debian as common 2 | 3 | ARG DEBIAN_FRONTEND=noninteractive 4 | 5 | RUN apt-get update 6 | RUN apt-get install -yq apt-utils 7 | RUN apt-get install -yq fuse libfuse3-3 libsqlite3-0 libavcodec59 libavformat59 libswresample4 libavutil57 libswscale6 libavfilter8 libcue2 libchardet1 8 | RUN apt-get install -yq libdvdread[48] libdvdnav4 libbluray2 9 | 10 | FROM common as builder 11 | 12 | RUN apt-get install -yq gcc g++ make pkg-config autoconf asciidoc-base w3m libchromaprint-dev bc doxygen graphviz curl git xxd 13 | RUN apt-get install -yq libcue-dev libfuse3-dev libsqlite3-dev libavcodec-dev libavformat-dev libswresample-dev libavutil-dev libswscale-dev libavfilter-dev libchardet-dev 14 | RUN apt-get install -yq libdvdread-dev libdvdnav-dev libbluray-dev 15 | 16 | ARG BRANCH=master 17 | # Ensure that we get a docker image cache invalidation when there's new content available 18 | ADD https://api.github.com/repos/nschlia/ffmpegfs/compare/${BRANCH}...HEAD /dev/null 19 | 20 | RUN git clone https://github.com/nschlia/ffmpegfs.git -b ${BRANCH} 21 | WORKDIR ffmpegfs 22 | 23 | RUN chmod +x autogen.sh src/makehelp.sh 24 | RUN ./autogen.sh 25 | RUN ./configure 26 | RUN make -s 27 | RUN make -s install 28 | 29 | FROM common 30 | 31 | COPY --from=builder /usr/local/bin/ffmpegfs /usr/local/bin/ffmpegfs 32 | COPY --from=builder /usr/local/share/man/man1/ffmpegfs.1 /usr/local/share/man/man1/ffmpegfs.1 33 | 34 | ENTRYPOINT ["/usr/local/bin/ffmpegfs", "/src", "/dst"] 35 | CMD = --help 36 | -------------------------------------------------------------------------------- /mkjenkins: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | set -e 4 | 5 | #COMPILER=gcc 6 | #TOOLKIT=ffmpeg 7 | #FFMPEGVER=4.1 8 | #CONFIGUREOPT= 9 | CHECK=1 10 | 11 | COMPILER=$1 12 | TOOLKIT=$2 13 | FFMPEGVER=$3 14 | CONFIGUREOPT=$4 15 | if [ ! -z "$5" ]; 16 | then 17 | CHECK=$5 18 | fi 19 | 20 | if [ -z "${COMPILER}" ] || [ -z "${TOOLKIT}" ] 21 | then 22 | echo "Usage: mkjenkins COMPILER TOOLKIT [FFMPEGVER] [CONFIGIVERSION]" 23 | echo 24 | echo "Set toolkit to 'native' to install to system" 25 | echo 26 | echo "Example: mkjenkins gcc native [configure options]" 27 | exit 0 28 | fi 29 | 30 | # ------------------------------------------------------------------------------------------------- 31 | 32 | if [ "${HOSTNAME}" != "rasppi4dev" ]; 33 | then 34 | CPUCOUNT=`nproc` 35 | else 36 | CPUCOUNT=1 37 | fi 38 | 39 | echo "*********************************************************************************************" 40 | if [ -z "${CONFIGUREOPT}" ]; 41 | then 42 | echo "Building for ${TOOLKIT} ${FFMPEGVER} with ${COMPILER} and CPU count ${CPUCOUNT}" 43 | else 44 | echo "Building for ${TOOLKIT} ${FFMPEGVER} with ${COMPILER} (configure ${CONFIGUREOPT}) and CPU count ${CPUCOUNT}" 45 | fi 46 | echo "*********************************************************************************************" 47 | 48 | if [ ${TOOLKIT} != "native" ]; 49 | then 50 | FFMPEG_BUILD="${HOME}/dev/builds/${TOOLKIT}" 51 | 52 | if [ ! -z "$FFMPEGVER" ] 53 | then 54 | FFMPEG_BUILD="${FFMPEG_BUILD}-${FFMPEGVER}" 55 | fi 56 | 57 | if [ ! -d ${FFMPEG_BUILD} ]; 58 | then 59 | echo "*** ERROR *** FFmpeg not found in ${FFMPEG_BUILD}" 60 | exit 99 61 | fi 62 | 63 | echo "****** Using FFmpeg in ${FFMPEG_BUILD} ******" 64 | 65 | # 32+64 bit 66 | #export LIB32="${FFMPEG_BUILD}/lib" 67 | #export LIB64="${FFMPEG_BUILD}/lib64" 68 | #export LD_LIBRARY_PATH="${LIB64}:${LIB32}" 69 | #export LDFLAGS="-L${LIB64} -L${LIB32} -Wl,-rpath,${LD_LIBRARY_PATH}" 70 | #export PKG_CONFIG_PATH="${FFMPEG_BUILD}/lib/pkgconfig:${FFMPEG_BUILD}/lib64/pkgconfig" 71 | 72 | # 64 bit only 73 | export LIB="${FFMPEG_BUILD}/lib" 74 | export LD_LIBRARY_PATH="${LIB}" 75 | export LDFLAGS="-L${LIB} -Wl,-rpath,${LD_LIBRARY_PATH}" 76 | export PKG_CONFIG_PATH="${FFMPEG_BUILD}/lib/pkgconfig" 77 | 78 | export CPLUS_INCLUDE_PATH="${FFMPEG_BUILD}/include" 79 | export CFLAGS=-I"${FFMPEG_BUILD}/include" 80 | export CPPFLAGS=-I"${FFMPEG_BUILD}/include" 81 | else 82 | echo "****** Using native FFmpeg library ******" 83 | fi 84 | 85 | REBUILD=0 86 | if [ ! -f configure ]; 87 | then 88 | REBUILD=1 89 | echo "---------------------------------------------------------------------------------------------" 90 | echo "configure not present, rebuilding" 91 | echo "---------------------------------------------------------------------------------------------" 92 | elif [ configure.ac -nt configure ]; 93 | then 94 | REBUILD=1 95 | echo "---------------------------------------------------------------------------------------------" 96 | echo "configure.ac was modified" 97 | echo "---------------------------------------------------------------------------------------------" 98 | fi 99 | 100 | if [ ${REBUILD} != 0 ]; 101 | then 102 | rm -Rf autom4te.cache config 103 | ./autogen.sh 104 | if [ ${COMPILER} = "clang" ]; 105 | then 106 | echo "****** Using clang ****** " 107 | CC=clang CXX=clang++ ./configure ${CONFIGUREOPT} 108 | elif [ ${COMPILER} = "gcc" ]; 109 | then 110 | echo "****** Using gcc ****** " 111 | CC=gcc CXX="g++" ./configure ${CONFIGUREOPT} 112 | else 113 | echo "****** Using default compiler ****** " 114 | ./configure ${CONFIGUREOPT} 115 | fi 116 | 117 | echo "---------------------------------------------------------------------------------------------" 118 | echo "Running make clean" 119 | echo "---------------------------------------------------------------------------------------------" 120 | 121 | make -j ${CPUCOUNT} -s clean 122 | fi 123 | 124 | if [ ${CHECK} != 0 ]; 125 | then 126 | echo "---------------------------------------------------------------------------------------------" 127 | echo "Running make check" 128 | echo "---------------------------------------------------------------------------------------------" 129 | 130 | make -j ${CPUCOUNT} -s check 131 | #runs again with distcheck 132 | else 133 | echo "---------------------------------------------------------------------------------------------" 134 | echo "Running make" 135 | echo "---------------------------------------------------------------------------------------------" 136 | 137 | make -j ${CPUCOUNT} -s 138 | fi 139 | 140 | #echo "---------------------------------------------------------------------------------------------" 141 | #echo "Running make distcheck" 142 | #echo "---------------------------------------------------------------------------------------------" 143 | # 144 | # make -j ${CPUCOUNT} -s distcheck 145 | # 146 | #echo "---------------------------------------------------------------------------------------------" 147 | #echo "Running make cppcheck" 148 | #echo "---------------------------------------------------------------------------------------------" 149 | # 150 | # make -j ${CPUCOUNT} -s cppcheck 151 | # 152 | #echo "---------------------------------------------------------------------------------------------" 153 | # 154 | #if [ -s cppcheck.log ] 155 | #then 156 | # echo "Non-zero sized cppcheck.log found:" 157 | # cat cppcheck.log 158 | #fi 159 | 160 | echo "---------------------------------------------------------------------------------------------" 161 | 162 | 163 | -------------------------------------------------------------------------------- /sql/ffmpegfs.sql: -------------------------------------------------------------------------------- 1 | BEGIN TRANSACTION; 2 | CREATE TABLE `version` ( 3 | `min_version_major` INTEGER NOT NULL, 4 | `min_version_minor` INTEGER NOT NULL 5 | ); 6 | INSERT INTO `version` VALUES (1,97); 7 | CREATE TABLE `cache_entry` ( 8 | `filename` TEXT NOT NULL, 9 | `desttype` CHAR ( 10 ) NOT NULL, 10 | `enable_ismv` BOOLEAN NOT NULL, 11 | `audiobitrate` UNSIGNED INT NOT NULL, 12 | `audiosamplerate` UNSIGNED INT NOT NULL, 13 | `videobitrate` UNSIGNED INT NOT NULL, 14 | `videowidth` UNSIGNED INT NOT NULL, 15 | `videoheight` UNSIGNED INT NOT NULL, 16 | `deinterlace` BOOLEAN NOT NULL, 17 | `duration` UNSIGNED BIG INT NOT NULL, 18 | `predicted_filesize` UNSIGNED BIG INT NOT NULL, 19 | `encoded_filesize` UNSIGNED BIG INT NOT NULL, 20 | `video_frame_count` UNSIGNED BIG INT NOT NULL, 21 | `segment_count` UNSIGNED BIG INT NOT NULL, 22 | `finished` INT NOT NULL, 23 | `error` BOOLEAN NOT NULL, 24 | `errno` INT NOT NULL, 25 | `averror` INT NOT NULL, 26 | `creation_time` DATETIME NOT NULL, 27 | `access_time` DATETIME NOT NULL, 28 | `file_time` DATETIME NOT NULL, 29 | `file_size` UNSIGNED BIG INT NOT NULL, 30 | PRIMARY KEY(`filename`,`desttype`) 31 | ); 32 | COMMIT; 33 | -------------------------------------------------------------------------------- /src/Makefile.am: -------------------------------------------------------------------------------- 1 | EXTRA_DIST = $(wildcard scripts/*) 2 | 3 | # Add fuse3 4 | AM_CPPFLAGS = $(fuse3_CFLAGS) -D_FILE_OFFSET_BITS=64 5 | 6 | bin_PROGRAMS = ffmpegfs 7 | ffmpegfs_SOURCES = ffmpegfs.cc ffmpegfs.h fuseops.cc transcode.cc transcode.h cache.cc cache.h buffer.cc buffer.h logging.cc logging.h cache_entry.cc cache_entry.h cache_maintenance.cc cache_maintenance.h id3v1tag.h aiff.h wave.h cuesheetparser.cc cuesheetparser.h diskio.cc diskio.h fileio.cc fileio.h ffmpeg_compat.h ffmpeg_profiles.h thread_pool.cc thread_pool.h 8 | ffmpegfs_LDADD = $(libcue_LIBS) $(fuse3_LIBS) -lrt -lstdc++fs 9 | 10 | ffmpegfs_SOURCES += ffmpeg_base.cc ffmpeg_base.h ffmpeg_transcoder.cc ffmpeg_transcoder.h ffmpeg_utils.cc ffmpeg_utils.h ffmpeg_profiles.cc ffmpeg_frame.h ffmpeg_frame.cc ffmpeg_subtitle.h ffmpeg_subtitle.cc 11 | ffmpegfs_LDADD += $(libavcodec_LIBS) $(libavutil_LIBS) $(libavformat_LIBS) $(libswscale_LIBS) $(libavfilter_LIBS) $(libswresample_LIBS) 12 | AM_CPPFLAGS += $(libavcodec_CFLAGS) $(libavutil_CFLAGS) $(libavformat_CFLAGS) $(libswscale_CFLAGS) $(libavfilter_CFLAGS) $(libswresample_CFLAGS) 13 | 14 | # Add sqlite3 15 | ffmpegfs_LDADD += $(sqlite3_LIBS) 16 | # Add libchardet 17 | AM_CPPFLAGS += $(chardet_CFLAGS) 18 | ffmpegfs_LDADD += $(chardet_LIBS) 19 | 20 | # DVD support: requires both libdbdnav and libdvdread 21 | if USE_LIBDVD 22 | AM_CPPFLAGS += -DUSE_LIBDVD 23 | AM_CPPFLAGS += $(libdvdnav_CFLAGS) $(libdvdread_CFLAGS) 24 | ffmpegfs_SOURCES += dvdio.cc dvdio.h dvdparser.cc dvdparser.h 25 | ffmpegfs_LDADD += $(libdvdnav_LIBS) $(libdvdread_LIBS) 26 | endif 27 | 28 | # Blu-ray support: requires libbluray 29 | if USE_LIBBLURAY 30 | AM_CPPFLAGS += -DUSE_LIBBLURAY 31 | AM_CPPFLAGS += $(libbluray_CFLAGS) 32 | ffmpegfs_SOURCES += blurayio.cc blurayio.h blurayparser.cc blurayparser.h 33 | ffmpegfs_LDADD += $(libbluray_LIBS) 34 | endif 35 | 36 | # VCD support: uses internal code 37 | if USE_LIBVCD 38 | AM_CPPFLAGS += -DUSE_LIBVCD 39 | AM_CPPFLAGS += $(libvcd_CFLAGS) 40 | ffmpegfs_SOURCES += vcdio.cc vcdio.h vcdparser.cc vcdparser.h vcd/vcdchapter.cc vcd/vcdchapter.h vcd/vcdentries.cc vcd/vcdentries.h vcd/vcdinfo.cc vcd/vcdinfo.h vcd/vcdutils.cc vcd/vcdutils.h 41 | endif 42 | 43 | # Add conversion of manpages source. Will be used in binary. 44 | BUILT_SOURCES = ../ffmpegfs.1.text ffmpegfshelp.h 45 | 46 | ../ffmpegfs.1.text: ../ffmpegfs.1.txt 47 | $(AM_V_GEN)a2x -a revnumber="$(VERSION)" \ 48 | -a revdate="$(shell date +'%B %Y')" -D ".." -f text $< 49 | 50 | # sed in makefiles is a menace so we use a helper script 51 | ffmpegfshelp.h: ../ffmpegfs.1.text 52 | $(srcdir)/makehelp.sh $@ 53 | -------------------------------------------------------------------------------- /src/aiff.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2017-2024 by Norbert Schlia (nschlia@oblivion-software.de) 3 | * 4 | * This program is free software; you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License as published by 6 | * the Free Software Foundation; either version 3 of the License, or 7 | * (at your option) any later version. 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with this program; if not, write to the Free Software 16 | * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. 17 | * 18 | * On Debian systems, the complete text of the GNU General Public License 19 | * Version 3 can be found in `/usr/share/common-licenses/GPL-3'. 20 | */ 21 | 22 | /** 23 | * @file aiff.h 24 | * @brief AIFF file structures 25 | * http://paulbourke.net/dataformats/audio/ 26 | * 27 | * @ingroup ffmpegfs 28 | * 29 | * @author Norbert Schlia (nschlia@oblivion-software.de) 30 | * @copyright Copyright (C) 2017-2024 Norbert Schlia (nschlia@oblivion-software.de) 31 | */ 32 | 33 | #ifndef AIFF_H 34 | #define AIFF_H 35 | 36 | #pragma once 37 | 38 | #include 39 | #include 40 | 41 | #pragma pack(push, 1) 42 | 43 | typedef std::array AIFF_ID; /**< @brief AIFF fourcc ID */ 44 | 45 | #define AIFF_FORMID "FORM" /**< @brief ckID for Form Chunk */ 46 | /** 47 | * AIFF format chunk 48 | */ 49 | typedef struct 50 | { 51 | AIFF_ID m_ckID; /**< @brief Chunk ID, always "FORM" */ 52 | uint32_t m_ckSize; /**< @brief Total file size - 8 */ 53 | AIFF_ID formType; /**< @brief */ 54 | //uint8_t chunks[]; 55 | } AIFF_FORMCHUNK; 56 | 57 | /** 58 | * AIFF chunk (anything else than the special chunks like form, common etc.) 59 | */ 60 | typedef struct 61 | { 62 | AIFF_ID m_ckID; /**< @brief Chunk ID */ 63 | uint32_t m_ckSize; /**< @brief Size of this chunk - 8 */ 64 | //uint8_t data[]; 65 | } AIFF_CHUNK; 66 | 67 | #define AIFF_COMMONID "COMM" /**< @brief ckID for Common Chunk */ 68 | /** 69 | * AIFF Common chunk 70 | */ 71 | typedef struct 72 | { 73 | AIFF_ID m_ckID; /**< @brief Chunk ID, always "COMM" */ 74 | uint32_t m_ckSize; /**< @brief Size of this chunk - 8 */ 75 | uint8_t m_numChannels; /**< @brief Number of audio channels for the sound. */ 76 | uint32_t m_numSampleFrames; /**< @brief Number of sample frames in the sound data chunk. */ 77 | uint8_t m_sampleSize; /**< @brief Number of bits in each sample point. */ 78 | //extended sampleRate; 79 | } AIFF_COMMONCHUNK; 80 | 81 | #define AIFF_SOUNDATAID "SSND" /**< @brief ckID for Sound Data Chunk */ 82 | /** 83 | * AIFF sound data chunk 84 | */ 85 | typedef struct 86 | { 87 | AIFF_ID m_ckID; /**< @brief Chunk ID, always "SSND" */ 88 | uint32_t m_ckSize; /**< @brief Total size of sound data chunk - 8 */ 89 | uint32_t m_offset; /**< @brief Determines where the first sample frame in the soundData starts. */ 90 | uint32_t m_blockSize; /**< @brief Contains the size in bytes of the blocks that sound data is aligned to. */ 91 | //uint8_t soundData[]; 92 | } AIFF_SOUNDDATACHUNK; 93 | 94 | #define AIFF_NAMEID "NAME" /**< @brief ckID for Name Chunk. */ 95 | #define AIFF_AUTHORID "AUTH" /**< @brief ckID for Author Chunk. */ 96 | #define AIFF_COPYRIGHTID "(c) " /**< @brief ckID for Copyright Chunk. */ 97 | #define AIFF_ANNOTATIONID "ANNO" /**< @brief ckID for Annotation Chunk. */ 98 | /** 99 | * AIFF name chunk 100 | */ 101 | typedef struct 102 | { 103 | AIFF_ID m_ckID; /**< @brief Chunk ID, one of "NAME", "AUTH", "(c) ", "ANNO" */ 104 | uint32_t m_ckSize; /**< @brief Size of this chunk - 8 */ 105 | //uint8_t text[]; 106 | } AIFF_TEXTCHUNK; 107 | 108 | #pragma pack(pop) 109 | 110 | #endif // AIFF_H 111 | -------------------------------------------------------------------------------- /src/blurayparser.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2018-2024 by Norbert Schlia (nschlia@oblivion-software.de) 3 | * 4 | * This program is free software; you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License as published by 6 | * the Free Software Foundation; either version 3 of the License, or 7 | * (at your option) any later version. 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with this program; if not, write to the Free Software 16 | * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. 17 | * 18 | * On Debian systems, the complete text of the GNU General Public License 19 | * Version 3 can be found in `/usr/share/common-licenses/GPL-3'. 20 | */ 21 | 22 | /** 23 | * @file blurayparser.h 24 | * @brief Blu-ray parser 25 | * 26 | * This is only available if built with -DUSE_LIBBLURAY parameter. 27 | * 28 | * @ingroup ffmpegfs 29 | * 30 | * @author Norbert Schlia (nschlia@oblivion-software.de) 31 | * @copyright Copyright (C) 2018-2024 Norbert Schlia (nschlia@oblivion-software.de) 32 | */ 33 | 34 | #ifndef BLURAYPARSER_H 35 | #define BLURAYPARSER_H 36 | 37 | #pragma once 38 | 39 | #ifdef USE_LIBBLURAY 40 | 41 | #include 42 | 43 | /** 44 | * @brief Get number of titles on Blu-ray. 45 | * @param[in] path - Path to check 46 | * @param[in, out] buf - The buffer passed to the readdir() operation. 47 | * @param[in, out] filler - Function to add an entry in a readdir() operation (see https://libfuse.github.io/doxygen/fuse_8h.html#a7dd132de66a5cc2add2a4eff5d435660) 48 | * @note buf and filler can be nullptr. In that case, the call will run faster, so these parameters should only be passed if they are to be filled in. 49 | * @return -errno or number of titles on Blu-ray. 50 | */ 51 | int check_bluray(const std::string & path, void *buf = nullptr, fuse_fill_dir_t filler = nullptr); 52 | 53 | #endif // USE_LIBBLURAY 54 | #endif // BLURAYPARSER_H 55 | -------------------------------------------------------------------------------- /src/cache_maintenance.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2017-2024 Norbert Schlia (nschlia@oblivion-software.de) 3 | * 4 | * This program is free software; you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License as published by 6 | * the Free Software Foundation; either version 3 of the License, or 7 | * (at your option) any later version. 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with this program; if not, write to the Free Software 16 | * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. 17 | * 18 | * On Debian systems, the complete text of the GNU General Public License 19 | * Version 3 can be found in `/usr/share/common-licenses/GPL-3'. 20 | */ 21 | 22 | /** 23 | * @file cache_maintenance.h 24 | * @brief %Cache maintenance 25 | * 26 | * Creates a POSIX timer that starts the cache maintenance in preset 27 | * intervals. To ensure that only one instance of FFmpegfs cleans up 28 | * the cache a shared memory area and a named semaphore is also created. 29 | * 30 | * The first FFmpegfs process acts as master, all subsequently started 31 | * instances will be clients. If the master process goes away one of 32 | * the clients will automatically take over as master. 33 | * 34 | * @ingroup ffmpegfs 35 | * 36 | * @author Norbert Schlia (nschlia@oblivion-software.de) 37 | * @copyright Copyright (C) 2017-2024 Norbert Schlia (nschlia@oblivion-software.de) 38 | */ 39 | 40 | #ifndef CACHE_MAINTENANCE_H 41 | #define CACHE_MAINTENANCE_H 42 | 43 | #pragma once 44 | 45 | #include 46 | 47 | /** 48 | * @brief Start cache maintenance timer. 49 | * @param[in] interval - Interval in seconds to run timer at. 50 | * @return On success, returns true. On error, returns false. Check errno for details. 51 | */ 52 | bool start_cache_maintenance(time_t interval); 53 | /** 54 | * @brief Stop cache maintenance timer. 55 | * @return On success, returns true. On error, returns false. Check errno for details. 56 | */ 57 | bool stop_cache_maintenance(); 58 | 59 | #endif // CACHE_MAINTENANCE_H 60 | -------------------------------------------------------------------------------- /src/cuesheetparser.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2018-2024 by Norbert Schlia (nschlia@oblivion-software.de) 3 | * 4 | * This program is free software; you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License as published by 6 | * the Free Software Foundation; either version 3 of the License, or 7 | * (at your option) any later version. 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with this program; if not, write to the Free Software 16 | * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. 17 | * 18 | * On Debian systems, the complete text of the GNU General Public License 19 | * Version 3 can be found in `/usr/share/common-licenses/GPL-3'. 20 | */ 21 | 22 | /** 23 | * @file cuesheetparser.h 24 | * @brief Clue sheet parser 25 | * 26 | * @ingroup ffmpegfs 27 | * 28 | * @author Norbert Schlia (nschlia@oblivion-software.de) 29 | * @copyright Copyright (C) 2018-2024 Norbert Schlia (nschlia@oblivion-software.de) 30 | */ 31 | 32 | #ifndef CUESHEETPARSER_H 33 | #define CUESHEETPARSER_H 34 | 35 | #pragma once 36 | 37 | #include 38 | 39 | #define TRACKDIR "tracks" ///<* Extension of virtual tracks directory 40 | 41 | struct AVFormatContext; 42 | 43 | /** 44 | * @brief Get number of titles in cue sheet 45 | * @param[in] filename - Path to check 46 | * @param[in, out] buf - The buffer passed to the readdir() operation. 47 | * @param[in, out] filler - Function to add an entry in a readdir() operation (see https://libfuse.github.io/doxygen/fuse_8h.html#a7dd132de66a5cc2add2a4eff5d435660) 48 | * @note buf and filler can be nullptr. In that case the call will run faster, so these parameters should only be passed if to be filled in. 49 | * @return -errno or number or titles in cue sheet 50 | */ 51 | int check_cuesheet(const std::string & filename, void *buf = nullptr, fuse_fill_dir_t filler = nullptr); 52 | 53 | #endif // CUESHEETPARSER_H 54 | -------------------------------------------------------------------------------- /src/diskio.cc: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2017-2024 Norbert Schlia (nschlia@oblivion-software.de) 3 | * 4 | * This program is free software; you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License as published by 6 | * the Free Software Foundation; either version 3 of the License, or 7 | * (at your option) any later version. 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with this program; if not, write to the Free Software 16 | * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. 17 | * 18 | * On Debian systems, the complete text of the GNU General Public License 19 | * Version 3 can be found in `/usr/share/common-licenses/GPL-3'. 20 | */ 21 | 22 | /** 23 | * @file diskio.cc 24 | * @brief DiskIO class implementation 25 | * 26 | * @ingroup ffmpegfs 27 | * 28 | * @author Norbert Schlia (nschlia@oblivion-software.de) 29 | * @copyright Copyright (C) 2017-2024 Norbert Schlia (nschlia@oblivion-software.de) 30 | */ 31 | 32 | #include "diskio.h" 33 | #include "logging.h" 34 | 35 | #include 36 | 37 | DiskIO::DiskIO() 38 | : m_fpi(nullptr) 39 | { 40 | 41 | } 42 | 43 | DiskIO::~DiskIO() 44 | { 45 | pvt_close(); 46 | } 47 | 48 | VIRTUALTYPE DiskIO::type() const 49 | { 50 | return VIRTUALTYPE::DISK; 51 | } 52 | 53 | size_t DiskIO::bufsize() const 54 | { 55 | return (100 /* KB */ * 1024); 56 | } 57 | 58 | int DiskIO::openio(LPVIRTUALFILE virtualfile) 59 | { 60 | set_virtualfile(virtualfile); 61 | 62 | Logging::debug(virtualfile->m_origfile, "Opening the input file."); 63 | 64 | m_fpi = fopen(virtualfile->m_origfile.c_str(), "rb"); 65 | 66 | if (m_fpi != nullptr) 67 | { 68 | return 0; 69 | } 70 | else 71 | { 72 | return errno; 73 | } 74 | } 75 | 76 | size_t DiskIO::readio(void * data, size_t size) 77 | { 78 | return fread(data, 1, size, m_fpi); 79 | } 80 | 81 | int DiskIO::error() const 82 | { 83 | return ferror(m_fpi); 84 | } 85 | 86 | int64_t DiskIO::duration() const 87 | { 88 | return AV_NOPTS_VALUE; // not applicable 89 | } 90 | 91 | size_t DiskIO::size() const 92 | { 93 | if (m_fpi == nullptr) 94 | { 95 | errno = EINVAL; 96 | return 0; 97 | } 98 | 99 | struct stat stbuf; 100 | fstat(fileno(m_fpi), &stbuf); 101 | return static_cast(stbuf.st_size); 102 | } 103 | 104 | size_t DiskIO::tell() const 105 | { 106 | return static_cast(ftell(m_fpi)); 107 | } 108 | 109 | int DiskIO::seek(int64_t offset, int whence) 110 | { 111 | return fseek(m_fpi, static_cast(offset), whence); 112 | } 113 | 114 | bool DiskIO::eof() const 115 | { 116 | return feof(m_fpi) ? true : false; 117 | } 118 | 119 | void DiskIO::closeio() 120 | { 121 | pvt_close(); 122 | } 123 | 124 | void DiskIO::pvt_close() 125 | { 126 | FILE *fpi = m_fpi; 127 | if (fpi != nullptr) 128 | { 129 | m_fpi = nullptr; 130 | fclose(fpi); 131 | } 132 | } 133 | -------------------------------------------------------------------------------- /src/diskio.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2018-2024 by Norbert Schlia (nschlia@oblivion-software.de) 3 | * 4 | * This program is free software; you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License as published by 6 | * the Free Software Foundation; either version 3 of the License, or 7 | * (at your option) any later version. 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with this program; if not, write to the Free Software 16 | * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. 17 | * 18 | * On Debian systems, the complete text of the GNU General Public License 19 | * Version 3 can be found in `/usr/share/common-licenses/GPL-3'. 20 | */ 21 | 22 | /** 23 | * @file diskio.h 24 | * @brief Direct disk I/O 25 | * 26 | * @ingroup ffmpegfs 27 | * 28 | * @author Norbert Schlia (nschlia@oblivion-software.de) 29 | * @copyright Copyright (C) 2018-2024 Norbert Schlia (nschlia@oblivion-software.de) 30 | */ 31 | 32 | #ifndef DISKIO_H 33 | #define DISKIO_H 34 | 35 | #pragma once 36 | 37 | #include "fileio.h" 38 | 39 | /** @brief Disk file I/O class 40 | */ 41 | class DiskIO : public FileIO 42 | { 43 | public: 44 | explicit DiskIO(); 45 | virtual ~DiskIO(); 46 | 47 | /** 48 | * @brief Get type of the virtual file 49 | * @return Returns the type of the virtual file. 50 | */ 51 | virtual VIRTUALTYPE type() const override; 52 | /** 53 | * @brief Get the ideal buffer size. 54 | * @return Return the ideal buffer size. 55 | */ 56 | virtual size_t bufsize() const override; 57 | 58 | /** @brief Open a file 59 | * @param[in] virtualfile - LPCVIRTUALFILE of file to open 60 | * @return Upon successful completion, #openio() returns 0. @n 61 | * On error, an nonzero value is returned and errno is set to indicate the error. 62 | */ 63 | virtual int openio(LPVIRTUALFILE virtualfile) override; 64 | /** @brief Read data from file 65 | * @param[out] data - buffer to store read bytes in. Must be large enough to hold up to size bytes. 66 | * @param[in] size - number of bytes to read 67 | * @return Upon successful completion, #readio() returns the number of bytes read. @n 68 | * This may be less than size. @n 69 | * On error, the value 0 is returned and errno is set to indicate the error. @n 70 | * If at end of file, 0 may be returned by errno not set. error() will return 0 if at EOF. 71 | */ 72 | virtual size_t readio(void *data, size_t size) override; 73 | /** 74 | * @brief Get last error. 75 | * @return errno value of last error. 76 | */ 77 | virtual int error() const override; 78 | /** @brief Get the duration of the file, in AV_TIME_BASE fractional seconds. 79 | * 80 | * Not applicable to generic disk files, always returns AV_NOPTS_VALUE. 81 | */ 82 | virtual int64_t duration() const override; 83 | /** 84 | * @brief Get the file size. 85 | * @return Returns the file size. 86 | */ 87 | virtual size_t size() const override; 88 | /** 89 | * @brief Get current read position. 90 | * @return Gets the current read position. 91 | */ 92 | virtual size_t tell() const override; 93 | /** @brief Seek to position in file 94 | * 95 | * Repositions the offset of the open file to the argument offset according to the directive whence. 96 | * 97 | * @param[in] offset - offset in bytes 98 | * @param[in] whence - how to seek: @n 99 | * SEEK_SET: The offset is set to offset bytes. @n 100 | * SEEK_CUR: The offset is set to its current location plus offset bytes. @n 101 | * SEEK_END: The offset is set to the size of the file plus offset bytes. 102 | * @return Upon successful completion, #seek() returns the resulting offset location as measured in bytes 103 | * from the beginning of the file. @n 104 | * On error, the value -1 is returned and errno is set to indicate the error. 105 | */ 106 | virtual int seek(int64_t offset, int whence) override; 107 | /** 108 | * @brief Check if at end of file. 109 | * @return Returns true if at end of file. 110 | */ 111 | virtual bool eof() const override; 112 | /** 113 | * @brief Close virtual file. 114 | */ 115 | virtual void closeio() override; 116 | 117 | private: 118 | /** 119 | * @brief Close virtual file. 120 | * Non-virtual version to be safely called from constructor/destructor 121 | */ 122 | void pvt_close(); 123 | 124 | protected: 125 | FILE * m_fpi; /**< @brief File pointer to source media */ 126 | }; 127 | 128 | #endif // DISKIO_H 129 | -------------------------------------------------------------------------------- /src/dvdparser.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2018-2024 by Norbert Schlia (nschlia@oblivion-software.de) 3 | * 4 | * This program is free software; you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License as published by 6 | * the Free Software Foundation; either version 3 of the License, or 7 | * (at your option) any later version. 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with this program; if not, write to the Free Software 16 | * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. 17 | * 18 | * On Debian systems, the complete text of the GNU General Public License 19 | * Version 3 can be found in `/usr/share/common-licenses/GPL-3'. 20 | */ 21 | 22 | /** 23 | * @file dvdparser.h 24 | * @brief DVD parser 25 | * 26 | * This is only available if built with -DUSE_LIBDVD parameter. 27 | * 28 | * @ingroup ffmpegfs 29 | * 30 | * @author Norbert Schlia (nschlia@oblivion-software.de) 31 | * @copyright Copyright (C) 2018-2024 Norbert Schlia (nschlia@oblivion-software.de) 32 | */ 33 | 34 | #ifndef DVDPARSER_H 35 | #define DVDPARSER_H 36 | 37 | #pragma once 38 | 39 | #ifdef USE_LIBDVD 40 | 41 | #include 42 | 43 | /** 44 | * @brief Get number of titles on DVD 45 | * @param[in] path - Path to check 46 | * @param[in, out] buf - The buffer passed to the readdir() operation. 47 | * @param[in, out] filler - Function to add an entry in a readdir() operation (see0 48 | * @return -errno or number or titles on DVD 49 | */ 50 | int check_dvd(const std::string & path, void *buf = nullptr, fuse_fill_dir_t filler = nullptr); 51 | 52 | #endif // USE_LIBDVD 53 | #endif // DVDPARSER_H 54 | -------------------------------------------------------------------------------- /src/ffmpeg_frame.cc: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2017-2024 Norbert Schlia (nschlia@oblivion-software.de) 3 | * 4 | * This program is free software; you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License as published by 6 | * the Free Software Foundation; either version 3 of the License, or 7 | * (at your option) any later version. 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with this program; if not, write to the Free Software 16 | * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. 17 | * 18 | * On Debian systems, the complete text of the GNU General Public License 19 | * Version 3 can be found in `/usr/share/common-licenses/GPL-3'. 20 | */ 21 | 22 | /** 23 | * @file ffmpeg_frame.cc 24 | * @brief FFmpeg_Frame class implementation 25 | * 26 | * @ingroup ffmpegfs 27 | * 28 | * @author Norbert Schlia (nschlia@oblivion-software.de) 29 | * @copyright Copyright (C) 2017-2024 Norbert Schlia (nschlia@oblivion-software.de) 30 | */ 31 | 32 | #ifdef __cplusplus 33 | extern "C" { 34 | #endif 35 | // Disable annoying warnings outside our code 36 | #pragma GCC diagnostic push 37 | #pragma GCC diagnostic ignored "-Wconversion" 38 | #pragma GCC diagnostic ignored "-Wsign-conversion" 39 | #include 40 | #pragma GCC diagnostic pop 41 | #ifdef __cplusplus 42 | } 43 | #endif 44 | 45 | #include "ffmpeg_utils.h" 46 | #include "ffmpeg_frame.h" 47 | 48 | FFmpeg_Frame::FFmpeg_Frame(int stream_index) : 49 | m_frame(av_frame_alloc()), 50 | m_res(0), 51 | m_stream_idx(stream_index) 52 | { 53 | m_res = (m_frame != nullptr) ? 0 : AVERROR(ENOMEM); 54 | } 55 | 56 | FFmpeg_Frame::FFmpeg_Frame(const FFmpeg_Frame& frame) : 57 | m_frame(nullptr), 58 | m_res(0), 59 | m_stream_idx(frame.m_stream_idx) 60 | { 61 | if (frame.m_frame != nullptr) 62 | { 63 | m_frame = av_frame_clone(frame.m_frame); 64 | 65 | m_res = (m_frame != nullptr) ? 0 : AVERROR(ENOMEM); 66 | } 67 | else 68 | { 69 | m_res = AVERROR(EINVAL); 70 | } 71 | } 72 | 73 | FFmpeg_Frame::FFmpeg_Frame(const AVFrame * frame) : 74 | m_frame(nullptr), 75 | m_res(0), 76 | m_stream_idx(INVALID_STREAM) 77 | { 78 | if (frame != nullptr) 79 | { 80 | m_frame = av_frame_clone(frame); 81 | 82 | m_res = (m_frame != nullptr) ? 0 : AVERROR(ENOMEM); 83 | } 84 | else 85 | { 86 | m_res = AVERROR(EINVAL); 87 | } 88 | } 89 | 90 | FFmpeg_Frame::~FFmpeg_Frame() 91 | { 92 | free(); 93 | } 94 | 95 | AVFrame* FFmpeg_Frame::clone() 96 | { 97 | return av_frame_clone(m_frame); 98 | } 99 | 100 | void FFmpeg_Frame::unref() 101 | { 102 | if (m_frame != nullptr) 103 | { 104 | av_frame_unref(m_frame); 105 | } 106 | } 107 | 108 | void FFmpeg_Frame::free() 109 | { 110 | if (m_frame != nullptr) 111 | { 112 | av_frame_free(&m_frame); 113 | m_frame = nullptr; 114 | } 115 | } 116 | 117 | int FFmpeg_Frame::res() const 118 | { 119 | return m_res; 120 | } 121 | 122 | AVFrame* FFmpeg_Frame::get() 123 | { 124 | return m_frame; 125 | } 126 | 127 | FFmpeg_Frame::operator AVFrame*() 128 | { 129 | return m_frame; 130 | } 131 | 132 | FFmpeg_Frame::operator const AVFrame*() const 133 | { 134 | return m_frame; 135 | } 136 | 137 | AVFrame* FFmpeg_Frame::operator->() 138 | { 139 | return m_frame; 140 | } 141 | 142 | FFmpeg_Frame& FFmpeg_Frame::operator=(const FFmpeg_Frame & frame) noexcept 143 | { 144 | // Do self assignment check 145 | if (this != &frame && m_frame != frame.m_frame) 146 | { 147 | AVFrame *new_frame = av_frame_clone(frame.m_frame); 148 | 149 | free(); 150 | 151 | m_frame = new_frame; 152 | 153 | m_stream_idx = frame.m_stream_idx; 154 | 155 | m_res = (m_frame != nullptr) ? 0 : AVERROR(ENOMEM); 156 | } 157 | 158 | return *this; 159 | } 160 | 161 | FFmpeg_Frame& FFmpeg_Frame::operator=(const AVFrame * frame) noexcept 162 | { 163 | if (m_frame != frame) 164 | { 165 | AVFrame *new_frame = av_frame_clone(frame); 166 | 167 | free(); 168 | 169 | m_frame = new_frame; 170 | 171 | m_stream_idx = INVALID_STREAM; 172 | 173 | m_res = (m_frame != nullptr) ? 0 : AVERROR(ENOMEM); 174 | } 175 | 176 | return *this; 177 | } 178 | -------------------------------------------------------------------------------- /src/ffmpeg_frame.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2017-2024 by Norbert Schlia (nschlia@oblivion-software.de) 3 | * 4 | * This program is free software; you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License as published by 6 | * the Free Software Foundation; either version 3 of the License, or 7 | * (at your option) any later version. 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with this program; if not, write to the Free Software 16 | * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. 17 | * 18 | * On Debian systems, the complete text of the GNU General Public License 19 | * Version 3 can be found in `/usr/share/common-licenses/GPL-3'. 20 | */ 21 | 22 | /** 23 | * @file ffmpeg_frame.h 24 | * @brief FFmpeg AVFrame extension 25 | * 26 | * @ingroup ffmpegfs 27 | * 28 | * @author Norbert Schlia (nschlia@oblivion-software.de) 29 | * @copyright Copyright (C) 2017-2024 Norbert Schlia (nschlia@oblivion-software.de) 30 | */ 31 | 32 | #ifndef FFMPEG_FRAME_H 33 | #define FFMPEG_FRAME_H 34 | 35 | #pragma once 36 | 37 | struct AVFrame; 38 | 39 | /** 40 | * @brief The #FFmpeg_Frame class 41 | */ 42 | class FFmpeg_Frame 43 | { 44 | public: 45 | /** 46 | * @brief Construct FFmpeg_Frame object. 47 | * @param[in] stream_index - Index of stream 48 | */ 49 | explicit FFmpeg_Frame(int stream_index = INVALID_STREAM); 50 | /** 51 | * @brief Copy construct from FFmpeg_Frame object. 52 | * @param[in] frame - Pointer to source FFmpeg_Frame object. 53 | * @note Do not declare explicit, breaks use in std::variant 54 | */ 55 | FFmpeg_Frame(const FFmpeg_Frame & frame); 56 | /** 57 | * @brief Copy construct from AVFrame struct. 58 | * @param[in] frame - Pointer to source AVFrame struct. 59 | * @note Do not declare explicit, breaks use in std::variant 60 | */ 61 | FFmpeg_Frame(const AVFrame * frame); // cppcheck-suppress noExplicitConstructor 62 | /** 63 | * @brief Destruct FFmpeg_Frame object. 64 | */ 65 | virtual ~FFmpeg_Frame(); 66 | /** 67 | * @brief Get result of last operation 68 | * @return Returns 0 if last operation was successful, or negative AVERROR value. 69 | */ 70 | int res() const; 71 | /** 72 | * @brief Clone frame to a new AVFrame * struct. Needs to be freed by a av_frame_free() call. 73 | * @return Returns cloned AVFrame * struct, or nullptr on error. 74 | */ 75 | AVFrame* clone(); 76 | /** 77 | * @brief Unreference underlying frame 78 | */ 79 | void unref(); 80 | /** 81 | * @brief Free underlying frame 82 | */ 83 | void free(); 84 | /** 85 | * @brief Access the underlying frame 86 | * @return Returns the unerlying AVFrame * struct, or nullptr not valid. 87 | */ 88 | AVFrame* get(); 89 | 90 | /** 91 | * @brief operator AVFrame *: Do as if we were a pointer to AVFrame 92 | */ 93 | operator AVFrame*(); 94 | /** 95 | * @brief operator const AVFrame *: Do as if we were a const pointer to AVFrame 96 | */ 97 | operator const AVFrame*() const; 98 | /** 99 | * @brief operator ->: Do as if we were a pointer to AVFrame 100 | * @return Pointer to AVFrame struct. 101 | */ 102 | AVFrame* operator->(); 103 | /** 104 | * @brief Make copy from other FFmpeg_Frame object. 105 | * @param[in] frame - Reference to source FFmpeg_Frame object. 106 | * @return Reference to new FFmpeg_Frame object. 107 | */ 108 | FFmpeg_Frame& operator=(const FFmpeg_Frame & frame) noexcept; 109 | /** 110 | * @brief Make copy from AVFrame structure. 111 | * @param[in] frame - Pointer to source AVFrame structure. 112 | * @return Reference to new FFmpeg_Frame object. 113 | */ 114 | FFmpeg_Frame& operator=(const AVFrame * frame) noexcept; 115 | 116 | protected: 117 | AVFrame * m_frame; /**< @brief Pointer to underlying AVFrame struct */ 118 | int m_res; /**< @brief 0 if last operation was successful, or negative AVERROR value */ 119 | 120 | public: 121 | int m_stream_idx; /**< @brief Stream index frame belongs to, or -1 (INVALID_STREAM) */ 122 | }; 123 | 124 | #endif // FFMPEG_FRAME_H 125 | -------------------------------------------------------------------------------- /src/ffmpeg_profiles.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2017-2024 by Norbert Schlia (nschlia@oblivion-software.de) 3 | * 4 | * This program is free software; you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License as published by 6 | * the Free Software Foundation; either version 3 of the License, or 7 | * (at your option) any later version. 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with this program; if not, write to the Free Software 16 | * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. 17 | * 18 | * On Debian systems, the complete text of the GNU General Public License 19 | * Version 3 can be found in `/usr/share/common-licenses/GPL-3'. 20 | */ 21 | 22 | /** 23 | * @file ffmpeg_profiles.h 24 | * @brief FFmpeg encoder profiles 25 | * 26 | * @ingroup ffmpegfs 27 | * 28 | * @author Norbert Schlia (nschlia@oblivion-software.de) 29 | * @copyright Copyright (C) 2017-2024 Norbert Schlia (nschlia@oblivion-software.de) 30 | */ 31 | 32 | #ifndef FFMPEG_PROFILES_H 33 | #define FFMPEG_PROFILES_H 34 | 35 | #pragma once 36 | 37 | #include "ffmpeg_utils.h" 38 | 39 | /** 40 | * @brief The #FFmpeg_Profiles class 41 | */ 42 | class FFmpeg_Profiles 43 | { 44 | public: 45 | #define OPT_ALL 0x00000000 /**< @brief All files */ 46 | #define OPT_AUDIO 0x00000001 /**< @brief For audio only files */ 47 | #define OPT_VIDEO 0x00000002 /**< @brief For videos (not audio only) */ 48 | #define OPT_SW_ONLY 0x00000004 /**< @brief Use this option for software encoding only */ 49 | #define OPT_HW_ONLY 0x00000008 /**< @brief Use this option for hardware encoding only */ 50 | 51 | typedef struct PROFILE_OPTION /**< @brief Profiles options */ 52 | { 53 | const char * m_key; /**< @brief Key, see av_opt_set() and av_dict_set() FFmpeg API function */ 54 | const char * m_value; /**< @brief Value, see av_opt_set() and av_dict_set() FFmpeg API function */ 55 | const int m_flags; /**< @brief Flags, see av_opt_set() and av_dict_set() FFmpeg API function */ 56 | const int m_options; /**< @brief One of the OPT_* flags */ 57 | } PROFILE_OPTION; /**< @brief Profile option */ 58 | typedef PROFILE_OPTION * LPPROFILE_OPTION; /**< @brief Pointer version of PROFILE_OPTION */ 59 | typedef PROFILE_OPTION const * LPCPROFILE_OPTION; /**< @brief Pointer to const version of PROFILE_OPTION */ 60 | 61 | typedef std::vector PROFILE_OPTION_VEC; /**< @brief PROFILE_OPTION array */ 62 | 63 | typedef struct PROFILE_LIST /**< @brief List of profiles */ 64 | { 65 | FILETYPE m_filetype; /**< @brief File type this option set is for */ 66 | PROFILE m_profile; /**< @brief One of PROFILE_ */ 67 | const PROFILE_OPTION_VEC m_option_codec; /**< @brief av_opt_set() options */ 68 | const PROFILE_OPTION_VEC m_option_format; /**< @brief av_dict_set() options */ 69 | } PROFILE_LIST; /**< @brief Profile list */ 70 | typedef PROFILE_LIST * LPPROFILE_LIST; /**< @brief Pointer version of PROFILE_LIST */ 71 | typedef PROFILE_LIST const * LPCPROFILE_LIST; /**< @brief Pointer to const version of PROFILE_LIST */ 72 | 73 | typedef std::vector PROFILE_LIST_VEC; /**< @brief PROFILE_LIST array */ 74 | 75 | protected: 76 | /** 77 | * @brief Construct a FFmpeg_Profiles object. 78 | */ 79 | explicit FFmpeg_Profiles() = default; 80 | /** 81 | * @brief Destruct a FFmpeg_Profiles object. 82 | */ 83 | virtual ~FFmpeg_Profiles() = default; 84 | 85 | protected: 86 | static const PROFILE_LIST_VEC m_profile; /**< @brief List of profile options */ 87 | }; 88 | 89 | #endif // FFMPEG_PROFILES_H 90 | -------------------------------------------------------------------------------- /src/ffmpeg_subtitle.cc: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2017-2024 Norbert Schlia (nschlia@oblivion-software.de) 3 | * 4 | * This program is free software; you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License as published by 6 | * the Free Software Foundation; either version 3 of the License, or 7 | * (at your option) any later version. 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with this program; if not, write to the Free Software 16 | * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. 17 | * 18 | * On Debian systems, the complete text of the GNU General Public License 19 | * Version 3 can be found in `/usr/share/common-licenses/GPL-3'. 20 | */ 21 | 22 | /** 23 | * @file ffmpeg_subtitle.cc 24 | * @brief FFmpeg_Subtitle class implementation 25 | * 26 | * @ingroup ffmpegfs 27 | * 28 | * @author Norbert Schlia (nschlia@oblivion-software.de) 29 | * @copyright Copyright (C) 2017-2024 Norbert Schlia (nschlia@oblivion-software.de) 30 | */ 31 | 32 | #ifdef __cplusplus 33 | extern "C" { 34 | #endif 35 | // Disable annoying warnings outside our code 36 | #pragma GCC diagnostic push 37 | #pragma GCC diagnostic ignored "-Wconversion" 38 | #pragma GCC diagnostic ignored "-Wsign-conversion" 39 | #include 40 | #pragma GCC diagnostic pop 41 | #ifdef __cplusplus 42 | } 43 | #endif 44 | 45 | #include "ffmpeg_subtitle.h" 46 | 47 | FFmpeg_Subtitle::FFmpeg_Subtitle(int stream_index) : 48 | std::shared_ptr(alloc_subtitle(), &FFmpeg_Subtitle::delete_subtitle), 49 | m_res(0), 50 | m_stream_idx(stream_index) 51 | { 52 | m_res = (get() != nullptr) ? 0 : AVERROR(ENOMEM); 53 | } 54 | 55 | void FFmpeg_Subtitle::unref() noexcept 56 | { 57 | reset(); 58 | } 59 | 60 | int FFmpeg_Subtitle::res() const 61 | { 62 | return m_res; 63 | } 64 | 65 | FFmpeg_Subtitle::operator AVSubtitle*() 66 | { 67 | return get(); 68 | } 69 | 70 | FFmpeg_Subtitle::operator const AVSubtitle*() const 71 | { 72 | return get(); 73 | } 74 | 75 | AVSubtitle* FFmpeg_Subtitle::operator->() 76 | { 77 | return get(); 78 | } 79 | 80 | AVSubtitle* FFmpeg_Subtitle::alloc_subtitle() 81 | { 82 | return reinterpret_cast(av_mallocz(sizeof(AVSubtitle))); 83 | } 84 | 85 | void FFmpeg_Subtitle::delete_subtitle(AVSubtitle *subtitle) 86 | { 87 | if (subtitle != nullptr) 88 | { 89 | avsubtitle_free(subtitle); 90 | av_free(subtitle); 91 | } 92 | } 93 | -------------------------------------------------------------------------------- /src/ffmpeg_subtitle.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2017-2024 by Norbert Schlia (nschlia@oblivion-software.de) 3 | * 4 | * This program is free software; you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License as published by 6 | * the Free Software Foundation; either version 3 of the License, or 7 | * (at your option) any later version. 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with this program; if not, write to the Free Software 16 | * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. 17 | * 18 | * On Debian systems, the complete text of the GNU General Public License 19 | * Version 3 can be found in `/usr/share/common-licenses/GPL-3'. 20 | */ 21 | 22 | /** 23 | * @file ffmpeg_subtitle.h 24 | * @brief FFmpeg AVSubtitle extension 25 | * 26 | * @ingroup ffmpegfs 27 | * 28 | * @author Norbert Schlia (nschlia@oblivion-software.de) 29 | * @copyright Copyright (C) 2017-2024 Norbert Schlia (nschlia@oblivion-software.de) 30 | */ 31 | 32 | #ifndef FFMPEG_SUBTITLE_H 33 | #define FFMPEG_SUBTITLE_H 34 | 35 | #pragma once 36 | 37 | #include "ffmpeg_utils.h" 38 | 39 | #include 40 | 41 | struct AVSubtitle; 42 | 43 | /** 44 | * @brief The #FFmpeg_Subtitle class 45 | */ 46 | class FFmpeg_Subtitle : public std::shared_ptr 47 | { 48 | public: 49 | /** 50 | * @brief Construct FFmpeg_Subtitle object. 51 | * @param[in] stream_index - Index of stream 52 | */ 53 | explicit FFmpeg_Subtitle(int stream_index = INVALID_STREAM); 54 | /** 55 | * @brief Destruct FFmpeg_Subtitle object. 56 | */ 57 | virtual ~FFmpeg_Subtitle() = default; 58 | /** 59 | * @brief Get result of last operation 60 | * @return Returns 0 if last operation was successful, or negative AVERROR value. 61 | */ 62 | int res() const; 63 | /** 64 | * @brief Unreference underlying frame. Synonym for shared_ptr::reset(). 65 | */ 66 | void unref() noexcept; 67 | 68 | /** 69 | * @brief operator AVSubtitle *: Do as if we were a pointer to AVSubtitle 70 | */ 71 | operator AVSubtitle*(); 72 | /** 73 | * @brief operator const AVSubtitle *: Do as if we were a const pointer to AVSubtitle 74 | */ 75 | operator const AVSubtitle*() const; 76 | /** 77 | * @brief operator ->: Do as if we were a pointer to AVSubtitle 78 | * @return Pointer to AVSubtitle struct. 79 | */ 80 | AVSubtitle* operator->(); 81 | 82 | protected: 83 | /** 84 | * @brief Allocate a subtitle 85 | * @return Returns a newly allocated AVSubtitle field, or nullptr if out of memory. 86 | */ 87 | AVSubtitle* alloc_subtitle(); 88 | /** 89 | * @brief Delete a subtitle 90 | * @param[in] subtitle - AVSubtitle structure to delete/free. 91 | */ 92 | static void delete_subtitle(AVSubtitle *subtitle); 93 | 94 | protected: 95 | int m_res; /**< @brief 0 if last operation was successful, or negative AVERROR value */ 96 | 97 | public: 98 | int m_stream_idx; /**< @brief Stream index frame belongs to, or -1 (INVALID_STREAM) */ 99 | }; 100 | 101 | #endif // FFMPEG_SUBTITLE_H 102 | -------------------------------------------------------------------------------- /src/fileio.cc: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2017-2024 Norbert Schlia (nschlia@oblivion-software.de) 3 | * 4 | * This program is free software; you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License as published by 6 | * the Free Software Foundation; either version 3 of the License, or 7 | * (at your option) any later version. 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with this program; if not, write to the Free Software 16 | * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. 17 | * 18 | * On Debian systems, the complete text of the GNU General Public License 19 | * Version 3 can be found in `/usr/share/common-licenses/GPL-3'. 20 | */ 21 | 22 | /** 23 | * @file fileio.cc 24 | * @brief FileIO class implementation 25 | * 26 | * @ingroup ffmpegfs 27 | * 28 | * @author Norbert Schlia (nschlia@oblivion-software.de) 29 | * @copyright Copyright (C) 2017-2024 Norbert Schlia (nschlia@oblivion-software.de) 30 | */ 31 | 32 | #include "fileio.h" 33 | #include "ffmpegfs.h" 34 | #include "diskio.h" 35 | #ifdef USE_LIBVCD 36 | #include "vcdio.h" 37 | #endif // USE_LIBVCD 38 | #ifdef USE_LIBDVD 39 | #include "dvdio.h" 40 | #endif // USE_LIBDVD 41 | #ifdef USE_LIBBLURAY 42 | #include "blurayio.h" 43 | #endif // USE_LIBBLURAY 44 | 45 | uint32_t VIRTUALFILE::get_segment_count() const 46 | { 47 | if (m_duration && params.m_segment_duration) 48 | { 49 | return static_cast((m_duration - 200000) / params.m_segment_duration) + 1; 50 | } 51 | else 52 | { 53 | return 0; 54 | } 55 | } 56 | 57 | FileIO::FileIO() 58 | : m_virtualfile(nullptr) 59 | { 60 | 61 | } 62 | 63 | std::shared_ptr FileIO::alloc(VIRTUALTYPE type) 64 | { 65 | switch (type) 66 | { 67 | case VIRTUALTYPE::DISK: 68 | { 69 | return std::make_shared(); 70 | } 71 | #ifdef USE_LIBVCD 72 | case VIRTUALTYPE::VCD: 73 | { 74 | return std::make_shared(); 75 | } 76 | #endif // USE_LIBVCD 77 | #ifdef USE_LIBDVD 78 | case VIRTUALTYPE::DVD: 79 | { 80 | return std::make_shared(); 81 | } 82 | #endif // USE_LIBDVD 83 | #ifdef USE_LIBBLURAY 84 | case VIRTUALTYPE::BLURAY: 85 | { 86 | return std::make_shared(); 87 | } 88 | #endif // USE_LIBBLURAY 89 | default: 90 | { 91 | return std::make_shared(); 92 | } 93 | } 94 | } 95 | 96 | void FileIO::set_virtualfile(LPVIRTUALFILE virtualfile) 97 | { 98 | m_virtualfile = virtualfile; 99 | 100 | if (virtualfile != nullptr) 101 | { 102 | // Store path to original file without file name for fast access 103 | m_path = m_virtualfile->m_origfile; 104 | 105 | remove_filename(&m_path); 106 | } 107 | else 108 | { 109 | m_path.clear(); 110 | } 111 | } 112 | 113 | LPVIRTUALFILE FileIO::virtualfile() 114 | { 115 | return m_virtualfile; 116 | } 117 | 118 | const std::string & FileIO::path() const 119 | { 120 | return m_path; 121 | } 122 | 123 | const std::string & FileIO::filename() const 124 | { 125 | if (m_virtualfile == nullptr) 126 | { 127 | static const std::string empty; 128 | return empty; 129 | } 130 | 131 | return m_virtualfile->m_destfile; 132 | } 133 | 134 | -------------------------------------------------------------------------------- /src/id3v1tag.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2017-2024 by Norbert Schlia (nschlia@oblivion-software.de) 3 | * 4 | * This program is free software; you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License as published by 6 | * the Free Software Foundation; either version 3 of the License, or 7 | * (at your option) any later version. 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with this program; if not, write to the Free Software 16 | * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. 17 | * 18 | * On Debian systems, the complete text of the GNU General Public License 19 | * Version 3 can be found in `/usr/share/common-licenses/GPL-3'. 20 | */ 21 | 22 | /** 23 | * @file id3v1tag.h 24 | * @brief %ID3v1 tag structure 25 | * 26 | * @ingroup ffmpegfs 27 | * 28 | * @author Norbert Schlia (nschlia@oblivion-software.de) 29 | * @copyright Copyright (C) 2017-2024 Norbert Schlia (nschlia@oblivion-software.de) 30 | */ 31 | 32 | #ifndef ID3V1TAG_H 33 | #define ID3V1TAG_H 34 | 35 | #pragma once 36 | 37 | #include 38 | 39 | /** @brief %ID3 version 1 tag 40 | */ 41 | struct ID3v1 42 | { 43 | std::array m_tag; /**< @brief Contains "TAG" */ 44 | std::array m_title; /**< @brief Title of sound track */ 45 | std::array m_artist; /**< @brief Artist name */ 46 | std::array m_album; /**< @brief Album name */ 47 | std::array m_year; /**< @brief Year of publishing */ 48 | std::array m_comment; /**< @brief Any user comments */ 49 | char m_padding; /**< @brief Padding byte, must be '\0' */ 50 | char m_title_no; /**< @brief Title number */ 51 | char m_genre; /**< @brief Type of music */ 52 | }; 53 | 54 | static_assert(sizeof(ID3v1) == 128); 55 | 56 | extern void init_id3v1(ID3v1 *id3v1); /**< @brief Initialise ID3v1 tag */ 57 | 58 | #define ID3V1_TAG_LENGTH sizeof(ID3v1) /**< @brief Fixed 128 bytes */ 59 | 60 | #endif // ID3V1TAG_H 61 | -------------------------------------------------------------------------------- /src/makehelp.sh: -------------------------------------------------------------------------------- 1 | # Copyright (C) 2019-2024 Norbert Schlia (nschlia@oblivion-software.de) 2 | # 3 | # This program is free software; you can redistribute it and/or modify 4 | # it under the terms of the GNU General Public License as published by 5 | # the Free Software Foundation; either version 3 of the License, or 6 | # (at your option) any later version. 7 | # 8 | # This program is distributed in the hope that it will be useful, 9 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 10 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 11 | # GNU General Public License for more details. 12 | # 13 | # You should have received a copy of the GNU General Public License 14 | # along with this program; if not, write to the Free Software 15 | # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. 16 | # 17 | # On Debian systems, the complete text of the GNU General Public License 18 | # Version 3 can be found in `/usr/share/common-licenses/GPL-3'. 19 | 20 | set -e 21 | 22 | sed '1,/OPTIONS/d;/General\/FUSE options/,$d' ../ffmpegfs.1.text > ffmpegfshelp 23 | xxd -i ffmpegfshelp > $1 24 | rm ffmpegfshelp 25 | 26 | 27 | -------------------------------------------------------------------------------- /src/scripts/hls.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | HLS Demo 5 | 6 | 7 | 8 | 9 | 10 |
11 |

Hls.js demo - basic usage

12 | 13 |
14 | 34 | 35 | 36 | 37 | -------------------------------------------------------------------------------- /src/scripts/videotag.php: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Transcoder Test 5 | 6 | 7 | 20 | 72 | 73 | 74 | 75 | 76 | 84 | 159 | 160 |
77 | 80 | 83 | 85 | 86 | \n\n"; 123 | 124 | echo "\n\n"; 127 | } 128 | 129 | foreach ($dirs as &$value) { 130 | echo "\n\n"; 134 | } 135 | 136 | echo ""; 139 | 140 | foreach ($files as &$value) { 141 | echo "\n\n"; 146 | } 147 | ?> 148 | 149 | 156 | 157 |
"; 120 | echo "Go back"; 121 | echo ""; 122 | echo "
"; 125 | echo ""; 126 | echo "
"; 131 | echo "" . utf8_encode($value) . " "; 132 | echo "\n"; 133 | echo "
"; 137 | echo ""; 138 | echo "
"; 142 | echo "" . utf8_encode($value) . " "; 143 | echo ""; 144 | echo "Preload"; 145 | echo "
150 |
151 | Supported file types 152 |
153 | 155 |
158 |
161 | 162 | 163 | 164 | -------------------------------------------------------------------------------- /src/scripts/videotag.txt: -------------------------------------------------------------------------------- 1 | videotag.php is a small script that allows testing the video tag easily. Just put it into the base path directory, mount it to a folder that is accessible to your (PHP enabled) web server. 2 | 3 | When the page is opened, all transcoded files are listed on the right and playback can be started by clicking on the link. 4 | 5 | Very handy to test browser capabilities... -------------------------------------------------------------------------------- /src/thread_pool.cc: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2019-2024 Norbert Schlia (nschlia@oblivion-software.de) 3 | * 4 | * This program is free software; you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License as published by 6 | * the Free Software Foundation; either version 3 of the License, or 7 | * (at your option) any later version. 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with this program; if not, write to the Free Software 16 | * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. 17 | * 18 | * On Debian systems, the complete text of the GNU General Public License 19 | * Version 3 can be found in `/usr/share/common-licenses/GPL-3'. 20 | */ 21 | 22 | /** 23 | * @file thread_pool.cc 24 | * @brief Thread pool class implementation 25 | * 26 | * @ingroup ffmpegfs 27 | * 28 | * @author Norbert Schlia (nschlia@oblivion-software.de) 29 | * @copyright Copyright (C) 2019-2024 Norbert Schlia (nschlia@oblivion-software.de) 30 | */ 31 | 32 | #include "thread_pool.h" 33 | #include "logging.h" 34 | #include "config.h" 35 | 36 | thread_pool::thread_pool(unsigned int num_threads) 37 | : m_queue_shutdown(false) 38 | , m_num_threads(num_threads) 39 | , m_cur_threads(0) 40 | , m_threads_running(0) 41 | { 42 | } 43 | 44 | thread_pool::~thread_pool() 45 | { 46 | tear_down(true); 47 | } 48 | 49 | void thread_pool::loop_function_starter(thread_pool & tp) 50 | { 51 | tp.loop_function(); 52 | } 53 | 54 | void thread_pool::loop_function() 55 | { 56 | unsigned int thread_no = ++m_cur_threads; 57 | 58 | while (true) 59 | { 60 | FunctionPointer info; 61 | { 62 | std::unique_lock lock_queue_mutex(m_queue_mutex); 63 | m_queue_cond.wait(lock_queue_mutex, [this]{ return (!m_thread_queue.empty() || m_queue_shutdown); }); 64 | 65 | if (m_queue_shutdown) 66 | { 67 | lock_queue_mutex.unlock(); 68 | break; 69 | } 70 | 71 | Logging::trace(nullptr, "Starting job taking pool thread no. %1 with id 0x%<" FFMPEGFS_FORMAT_PTHREAD_T ">2.", thread_no, pthread_self()); 72 | info = m_thread_queue.front(); 73 | m_thread_queue.pop(); 74 | } 75 | 76 | int ret = info(); 77 | 78 | Logging::trace(nullptr, "The job using pool thread no. %1 with id 0x%<" FFMPEGFS_FORMAT_PTHREAD_T ">2 has exited with return code %3.", thread_no, pthread_self(), ret); 79 | } 80 | } 81 | 82 | bool thread_pool::schedule_thread(FunctionPointer &&func) 83 | { 84 | if (!m_queue_shutdown) 85 | { 86 | Logging::trace(nullptr, "Queuing up a new thread. There are %1 threads in the pool.", m_thread_pool.size()); 87 | 88 | { 89 | std::lock_guard lock_queue_mutex(m_queue_mutex); 90 | 91 | m_thread_queue.push(func); 92 | } 93 | 94 | m_queue_cond.notify_one(); 95 | 96 | return true; 97 | } 98 | else 99 | { 100 | return false; 101 | } 102 | } 103 | 104 | unsigned int thread_pool::current_running() const 105 | { 106 | return m_threads_running; 107 | } 108 | 109 | unsigned int thread_pool::current_queued() 110 | { 111 | std::lock_guard lock_queue_mutex(m_queue_mutex); 112 | 113 | return static_cast(m_thread_queue.size()); 114 | } 115 | 116 | unsigned int thread_pool::pool_size() const 117 | { 118 | return static_cast(m_thread_pool.size()); 119 | } 120 | 121 | int thread_pool::init(unsigned int num_threads /*= 0*/) 122 | { 123 | if (!m_thread_pool.empty()) 124 | { 125 | Logging::warning(nullptr, "The thread pool already initialised"); 126 | return 0; 127 | } 128 | 129 | if (num_threads) 130 | { 131 | m_num_threads = num_threads; 132 | } 133 | 134 | Logging::info(nullptr, "The thread pool is being initialised with a maximum of %1 threads.", m_num_threads); 135 | 136 | for(unsigned int i = 0; i < m_num_threads; i++) 137 | { 138 | m_thread_pool.emplace_back(std::thread(&thread_pool::loop_function_starter, std::ref(*this))); 139 | } 140 | 141 | return static_cast(m_thread_pool.size()); 142 | } 143 | 144 | void thread_pool::tear_down(bool silent) 145 | { 146 | if (!silent) 147 | { 148 | Logging::debug(nullptr, "Tearing down the thread pool. There are %1 threads still in the pool.", m_thread_queue.size()); 149 | } 150 | 151 | m_queue_mutex.lock(); 152 | m_queue_shutdown = true; 153 | m_queue_mutex.unlock(); 154 | m_queue_cond.notify_all(); 155 | 156 | while (!m_thread_pool.empty()) 157 | { 158 | m_thread_pool.back().join(); 159 | m_thread_pool.pop_back(); 160 | } 161 | } 162 | 163 | -------------------------------------------------------------------------------- /src/thread_pool.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2019-2024 Norbert Schlia (nschlia@oblivion-software.de) 3 | * 4 | * This program is free software; you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License as published by 6 | * the Free Software Foundation; either version 3 of the License, or 7 | * (at your option) any later version. 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with this program; if not, write to the Free Software 16 | * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. 17 | * 18 | * On Debian systems, the complete text of the GNU General Public License 19 | * Version 3 can be found in `/usr/share/common-licenses/GPL-3'. 20 | */ 21 | 22 | /** 23 | * @file thread_pool.h 24 | * @brief Thread pool class implementation 25 | * 26 | * @ingroup ffmpegfs 27 | * 28 | * @author Norbert Schlia (nschlia@oblivion-software.de) 29 | * @copyright Copyright (C) 2019-2024 Norbert Schlia (nschlia@oblivion-software.de) 30 | */ 31 | 32 | #ifndef THREAD_POOL_H 33 | #define THREAD_POOL_H 34 | 35 | #pragma once 36 | 37 | #ifdef HAVE_CONFIG_H 38 | #include "config.h" 39 | #endif 40 | 41 | #include 42 | #include 43 | #include 44 | #include 45 | #include 46 | #include 47 | #include 48 | #include 49 | #include 50 | 51 | /** 52 | * @brief The thread_pool class. 53 | */ 54 | class thread_pool 55 | { 56 | public: 57 | typedef std::function FunctionPointer; /**< @brief Pointer to thread pool function */ 58 | 59 | public: 60 | /** 61 | * @brief Construct a thread_pool object. 62 | * @param[in] num_threads - Optional: number of threads to create in pool. Defaults to Defaults to 4 x number of CPU cores. 63 | */ 64 | explicit thread_pool(unsigned int num_threads = std::thread::hardware_concurrency() * 4); 65 | /** 66 | * @brief Object destructor. Ends all threads and cleans up resources. 67 | */ 68 | virtual ~thread_pool(); 69 | 70 | /** 71 | * @brief Initialise thread pool. 72 | * Initialise the thread pool. Does nothing if called more than once. 73 | * @param[in] num_threads - Optional: number of threads to create in pool. Defaults to Defaults to 4x number of CPU cores. 74 | * @return Number of threads created on success; on error or if called more than once, returns 0. 75 | */ 76 | int init(unsigned int num_threads = 0); 77 | /** 78 | * @brief Shut down the thread pool. 79 | * @param[in] silent - If true, no log messages will be issued. 80 | */ 81 | void tear_down(bool silent = false); 82 | /** 83 | * @brief Schedule a new thread from pool. 84 | * @param[in] func - std::function object to call 85 | * @return Returns true if thread was successfully scheduled, false if not. 86 | */ 87 | bool schedule_thread(FunctionPointer && func); 88 | /** 89 | * @brief Get number of currently running threads. 90 | * @return Returns number of currently running threads. 91 | */ 92 | unsigned int current_running() const; 93 | /** 94 | * @brief Get number of currently queued threads. 95 | * @return Returns number of currently queued threads. 96 | */ 97 | unsigned int current_queued(); 98 | /** 99 | * @brief Get current pool size. 100 | * @return Return current pool size. 101 | */ 102 | unsigned int pool_size() const; 103 | 104 | private: 105 | /** 106 | * @brief Start loop function. 107 | * @param[in] tp - Thread pool object of caller. 108 | */ 109 | static void loop_function_starter(thread_pool &tp); 110 | /** 111 | * @brief Start loop function 112 | */ 113 | void loop_function(); 114 | 115 | protected: 116 | std::vector m_thread_pool; /**< Thread pool */ 117 | std::mutex m_queue_mutex; /**< Mutex for critical section */ 118 | std::condition_variable m_queue_cond; /**< Condition for critical section */ 119 | std::queue m_thread_queue; /**< Thread queue parameters */ 120 | std::atomic_bool m_queue_shutdown; /**< If true all threads have been shut down */ 121 | unsigned int m_num_threads; /**< Max. number of threads. Defaults to 4x number of CPU cores. */ 122 | unsigned int m_cur_threads; /**< Current number of threads. */ 123 | std::atomic_uint32_t m_threads_running; /**< Currently running threads. */ 124 | }; 125 | 126 | #endif // THREAD_POOL_H 127 | -------------------------------------------------------------------------------- /src/vcd/vcdentries.h: -------------------------------------------------------------------------------- 1 | /* 2 | * This program is free software; you can redistribute it and/or modify 3 | * it under the terms of the GNU General Public License as published by 4 | * the Free Software Foundation; either version 3 of the License, or 5 | * (at your option) any later version. 6 | * 7 | * This program is distributed in the hope that it will be useful, 8 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 9 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 10 | * GNU General Public License for more details. 11 | * 12 | * You should have received a copy of the GNU General Public License 13 | * along with this program; if not, write to the Free Software 14 | * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. 15 | */ 16 | 17 | /** 18 | * @file vcdentries.h 19 | * @brief S/VCD VcdEntries class 20 | * 21 | * @ingroup ffmpegfs 22 | * 23 | * @author Norbert Schlia (nschlia@oblivion-software.de) 24 | * @copyright Copyright (C) 2013-2024 Norbert Schlia (nschlia@oblivion-software.de) @n 25 | * From BullysPLayer Copyright (C) 1984-2024 by Oblivion Software/Norbert Schlia 26 | */ 27 | 28 | #ifndef VCDENTRIES_H 29 | #define VCDENTRIES_H 30 | 31 | #pragma once 32 | 33 | #include "vcdchapter.h" 34 | 35 | #include 36 | #include 37 | 38 | /** @brief Video CD entries 39 | */ 40 | class VcdEntries 41 | { 42 | public: 43 | /** 44 | * Seek results 45 | */ 46 | enum class SEEKRES 47 | { 48 | NOTFOUND, /**< @brief Sync not found */ 49 | FOUND, /**< @brief Sync found */ 50 | ERROR /**< @brief Seek error */ 51 | }; 52 | typedef SEEKRES *LPSEEKRES; /**< @brief Pointer to SEEKRES */ 53 | typedef const SEEKRES *LPCSEEKRES; /**< @brief Const pointer to SEEKRES */ 54 | 55 | public: 56 | /** 57 | * @brief Construct #VcdEntries object 58 | */ 59 | explicit VcdEntries(); 60 | /** 61 | * @brief Destroy VcdEntries object 62 | */ 63 | virtual ~VcdEntries() = default; 64 | 65 | /** 66 | * @brief Reset this object 67 | */ 68 | void clear(); 69 | /** 70 | * @brief Load VCD from path 71 | * @param[in] path - path to locate VCD in 72 | * @return On success, returns 0; in case of error returns errno 73 | */ 74 | int load_file(const std::string & path); 75 | 76 | /** 77 | * @brief Get date of disk (taken from INFO.VCD or SVD). 78 | * @return Returns date of disk. 79 | */ 80 | time_t get_file_date() const; 81 | /** 82 | * @brief Get disk ID. 83 | * @return Returns disk ID. 84 | */ 85 | const std::string & get_id() const; 86 | /** 87 | * @brief Get disk type. 88 | * @return Returns disk type. 89 | */ 90 | VCDTYPE get_type() const; 91 | /** 92 | * @brief Get disk type as string. 93 | * @return Returns disk type as string. 94 | */ 95 | std::string get_type_str() const; 96 | /** 97 | * @brief Get disk profile tag. 98 | * @return Returns disk profile tag. 99 | */ 100 | VCDPROFILETAG get_profile_tag() const; 101 | /** 102 | * @brief Get disk profile tag as string. 103 | * @return Returns disk profile tag as string. 104 | */ 105 | std::string get_profile_tag_str() const; 106 | /** 107 | * @brief Get number of chapters on this disk. 108 | * @return Returns number of chapters on this disk. 109 | */ 110 | int get_number_of_chapters() const; 111 | /** 112 | * @brief Get chapter object. 113 | * @note If a disk is successfully read, at least one chapter is guaranteed to exist. 114 | * @param[in] chapter_idx - 0..number of chapters - 1 115 | * @return VcdChapter object with this chapter, nullptr if chapter_idx is invalid. 116 | */ 117 | const VcdChapter * get_chapter(int chapter_idx) const; 118 | /** 119 | * @brief Get the total disk duration in AV_TIME_BASE fractional seconds. 120 | * @return Returns total disk duration. 121 | */ 122 | int64_t get_duration() const; 123 | /** 124 | * @brief Get disk size (DAT/MPEG only). 125 | * @return Returns disk size. 126 | */ 127 | uint64_t get_size() const; 128 | /** @brief Get disk directory. 129 | * @return Returns disk directory. 130 | */ 131 | const std::string & get_disk_path() const; 132 | 133 | protected: 134 | /** 135 | * @brief Scan the disk for chapters. 136 | * @return On success, returns 0; on error, returns errno. 137 | */ 138 | int scan_chapters(); 139 | /** 140 | * @brief Seek for sync bytes. 141 | * @param[in] fpi - file pointer of open file 142 | * @param[in] sync - sync bytes 143 | * @return Returns SEEKRES result code. 144 | */ 145 | SEEKRES seek_sync(FILE *fpi, const std::array & sync) const; 146 | 147 | protected: 148 | // Common data 149 | time_t m_file_date; /**< @brief File date */ 150 | std::string m_id; /**< @brief ID of CD. */ 151 | VCDTYPE m_type; /**< @brief Type of CD. */ 152 | VCDPROFILETAG m_profile_tag; /**< @brief System profile tag. */ 153 | // ENTRIES.XXX data 154 | std::vector m_chapters; /**< @brief VCD chapters */ 155 | int64_t m_duration; /**< @brief Total disk duration, in AV_TIME_BASE fractional seconds. */ 156 | 157 | // misc. 158 | std::string m_disk_path; /**< @brief Path to this disk */ 159 | }; 160 | 161 | #endif // VCDENTRIES_H 162 | -------------------------------------------------------------------------------- /src/vcd/vcdinfo.h: -------------------------------------------------------------------------------- 1 | /* 2 | * This program is free software; you can redistribute it and/or modify 3 | * it under the terms of the GNU General Public License as published by 4 | * the Free Software Foundation; either version 3 of the License, or 5 | * (at your option) any later version. 6 | * 7 | * This program is distributed in the hope that it will be useful, 8 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 9 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 10 | * GNU General Public License for more details. 11 | * 12 | * You should have received a copy of the GNU General Public License 13 | * along with this program; if not, write to the Free Software 14 | * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. 15 | */ 16 | 17 | /** 18 | * @file vcdinfo.h 19 | * @brief S/VCD VcdInfo class 20 | * 21 | * @ingroup ffmpegfs 22 | * 23 | * @author Norbert Schlia (nschlia@oblivion-software.de) 24 | * @copyright Copyright (C) 2013-2024 Norbert Schlia (nschlia@oblivion-software.de) @n 25 | * From BullysPLayer Copyright (C) 1984-2024 by Oblivion Software/Norbert Schlia 26 | */ 27 | 28 | #ifndef VCDINFO_H 29 | #define VCDINFO_H 30 | 31 | #pragma once 32 | 33 | #include "vcdchapter.h" 34 | 35 | /** 36 | * @brief The #VcdInfo class 37 | */ 38 | class VcdInfo 39 | { 40 | public: 41 | /** 42 | * @brief Construct VcdInfo object 43 | */ 44 | explicit VcdInfo(); 45 | /** 46 | * @brief Destruct VcdInfo object 47 | */ 48 | virtual ~VcdInfo() = default; 49 | 50 | /** 51 | * @brief Reset this object 52 | */ 53 | void clear(); 54 | /** 55 | * @brief Load VCD from path 56 | * @param[in] path - path to locate VCD in 57 | * @return If successful, returns 0; otherwise, returns errno. 58 | */ 59 | int load_file(const std::string & path); 60 | 61 | const time_t & get_file_date() const; /**< @brief Date of disk (of INFO.VCD or SVD) */ 62 | const std::string & get_id() const; /**< @brief Get disk ID */ 63 | VCDTYPE get_type() const; /**< @brief Get disk type */ 64 | std::string get_type_str() const; /**< @brief Get disk type as string */ 65 | VCDPROFILETAG get_profile_tag() const; /**< @brief Get disk profile tag */ 66 | std::string get_profile_tag_str() const; /**< @brief Get disk profile tag as string */ 67 | const std::string & get_album_id() const; /**< @brief Get album ID */ 68 | int get_number_of_cds() const; /**< @brief Get number of CDs in set */ 69 | int get_cd_number() const; /**< @brief Get CD number in set */ 70 | 71 | protected: 72 | // Common data 73 | std::string m_disk_path; /**< @brief Path to disk */ 74 | time_t m_file_date; /**< @brief File date */ 75 | std::string m_id; /**< @brief ID of this CD. */ 76 | VCDTYPE m_type; /**< @brief Type of CD. */ 77 | VCDPROFILETAG m_profile_tag; /**< @brief System profile tag. */ 78 | // INFO.XXX data 79 | std::string m_album_id; /**< @brief Album ID */ 80 | int m_number_of_cds; /**< @brief Number of CDs in set */ 81 | int m_cd_number; /**< @brief Number of this CD in set */ 82 | }; 83 | 84 | #endif // VCDINFO_H 85 | -------------------------------------------------------------------------------- /src/vcd/vcdutils.cc: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2017-2024 Norbert Schlia (nschlia@oblivion-software.de) 3 | * 4 | * This program is free software; you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License as published by 6 | * the Free Software Foundation; either version 3 of the License, or 7 | * (at your option) any later version. 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with this program; if not, write to the Free Software 16 | * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. 17 | */ 18 | 19 | /** 20 | * @file vcdutils.cc 21 | * @brief S/VCD utility functions implementation 22 | * 23 | * @ingroup ffmpegfs 24 | * 25 | * @author Norbert Schlia (nschlia@oblivion-software.de) 26 | * @copyright Copyright (C) 2013-2024 Norbert Schlia (nschlia@oblivion-software.de) @n 27 | * From BullysPLayer Copyright (C) 1984-2024 by Oblivion Software/Norbert Schlia 28 | */ 29 | 30 | #include "ffmpegfs.h" 31 | #include "vcd/vcdchapter.h" 32 | #include "vcdutils.h" 33 | #include "ffmpeg_utils.h" 34 | 35 | #include 36 | #include 37 | #include 38 | 39 | namespace VCDUTILS 40 | { 41 | std::string convert_txt2string(const char * txt, int size, bool trimmed) 42 | { 43 | std::unique_ptr buffer = std::make_unique(static_cast(size + 1)); 44 | std::string ret_value; 45 | 46 | if (buffer != nullptr) 47 | { 48 | std::memcpy(buffer.get(), txt, static_cast(size)); 49 | *(buffer.get() + size) = '\0'; 50 | 51 | ret_value = buffer.get(); 52 | } 53 | 54 | if (trimmed) 55 | { 56 | return trim(ret_value); 57 | } 58 | else 59 | { 60 | return ret_value; 61 | } 62 | } 63 | 64 | bool locate_file(const std::string & path, const std::string & filename, std::string & fullname, bool & is_vcd) 65 | { 66 | is_vcd = false; 67 | 68 | // Try VCD 69 | fullname = path + "VCD/" + filename + ".VCD"; 70 | 71 | if (!access(fullname.c_str(), F_OK)) 72 | { 73 | return true; 74 | } 75 | 76 | // Try SVCD 77 | fullname = path + "SVCD/" + filename + ".SVD"; 78 | 79 | if (!access(fullname.c_str(), F_OK)) 80 | { 81 | is_vcd = true; 82 | return true; 83 | } 84 | 85 | return false; 86 | } 87 | 88 | int locate_video(const std::string & path, int track_no, std::string & fullname) 89 | { 90 | std::string buffer; 91 | 92 | // Try VCD 93 | strsprintf(&buffer, "MPEGAV/AVSEQ%02i.DAT", track_no - 1); 94 | fullname = path + buffer; 95 | if (!access(fullname.c_str(), F_OK)) 96 | { 97 | return 0; 98 | } 99 | 100 | // Try SVCD 101 | strsprintf(&buffer, "MPEG2/AVSEQ%02i.MPG", track_no - 1); 102 | fullname = path + buffer; 103 | if (!access(fullname.c_str(), F_OK)) 104 | { 105 | return 0; 106 | } 107 | 108 | return ENOENT; 109 | } 110 | 111 | std::string get_type_str(VCDTYPE type) 112 | { 113 | switch (type) 114 | { 115 | case VCDTYPE::VCD_10_11_SVCD_10_HQVCD: 116 | { 117 | return "VCD 1.0, VCD 1.1, SVCD 1.0, HQVCD"; 118 | } 119 | 120 | case VCDTYPE::VCD_20: 121 | { 122 | return "VCD 2.0"; 123 | } 124 | 125 | default: 126 | { 127 | return ""; 128 | } 129 | } 130 | } 131 | 132 | std::string get_profile_tag_str(VCDPROFILETAG tag) 133 | { 134 | switch (tag) 135 | { 136 | case VCDPROFILETAG::VCD_10_20_SVCD_HQVCD: 137 | { 138 | return "VCD 1.0, VCD 2.0, SVCD, HQVCD"; 139 | } 140 | case VCDPROFILETAG::VCD_11: 141 | { 142 | return "VCD 1.1"; 143 | } 144 | default: 145 | { 146 | return ""; 147 | } 148 | } 149 | } 150 | 151 | void get_directory(const std::string & fullname, std::string *directory) 152 | { 153 | struct stat stbuf; 154 | 155 | stat(fullname.c_str(), &stbuf); 156 | 157 | if (S_ISDIR(stbuf.st_mode)) 158 | { 159 | // Already a directory 160 | *directory = fullname; 161 | append_sep(directory); 162 | } 163 | 164 | else 165 | { 166 | // Make it a directory 167 | *directory = fullname; 168 | remove_filename(directory); 169 | } 170 | } 171 | } 172 | -------------------------------------------------------------------------------- /src/vcdio.cc: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2017-2024 Norbert Schlia (nschlia@oblivion-software.de) 3 | * 4 | * This program is free software; you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License as published by 6 | * the Free Software Foundation; either version 3 of the License, or 7 | * (at your option) any later version. 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with this program; if not, write to the Free Software 16 | * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. 17 | * 18 | * On Debian systems, the complete text of the GNU General Public License 19 | * Version 3 can be found in `/usr/share/common-licenses/GPL-3'. 20 | * 21 | * On Debian systems, the complete text of the GNU General Public License 22 | * Version 3 can be found in `/usr/share/common-licenses/GPL-3'. 23 | */ 24 | 25 | #ifdef USE_LIBVCD 26 | 27 | /** 28 | * @file vcdio.cc 29 | * @brief VcdIO class implementation 30 | * 31 | * @ingroup ffmpegfs 32 | * 33 | * @author Norbert Schlia (nschlia@oblivion-software.de) 34 | * @copyright Copyright (C) 2017-2024 Norbert Schlia (nschlia@oblivion-software.de) 35 | */ 36 | 37 | #include "vcdio.h" 38 | #include "vcd/vcdutils.h" 39 | #include "logging.h" 40 | 41 | VcdIO::VcdIO() 42 | : m_fpi(nullptr) 43 | , m_full_title(false) 44 | , m_track_no(0) 45 | , m_chapter_no(0) 46 | , m_start_pos(0) 47 | , m_end_pos(0) 48 | { 49 | 50 | } 51 | 52 | VcdIO::~VcdIO() 53 | { 54 | pvt_close(); 55 | } 56 | 57 | VIRTUALTYPE VcdIO::type() const 58 | { 59 | return VIRTUALTYPE::VCD; 60 | } 61 | 62 | size_t VcdIO::bufsize() const 63 | { 64 | return (32 * 1024); 65 | } 66 | 67 | int VcdIO::openio(LPVIRTUALFILE virtualfile) 68 | { 69 | std::string src_filename; 70 | 71 | set_virtualfile(virtualfile); 72 | 73 | if (virtualfile != nullptr) 74 | { 75 | m_full_title = virtualfile->m_full_title; 76 | m_track_no = virtualfile->m_vcd.m_track_no; 77 | m_chapter_no = virtualfile->m_vcd.m_chapter_no; 78 | m_start_pos = virtualfile->m_vcd.m_start_pos; 79 | m_end_pos = virtualfile->m_vcd.m_end_pos; 80 | } 81 | else 82 | { 83 | m_full_title = false; 84 | m_track_no = 1; 85 | m_chapter_no = 0; 86 | m_start_pos = 0; 87 | m_end_pos = size(); 88 | } 89 | 90 | VCDUTILS::locate_video(path(), m_track_no, src_filename); 91 | 92 | Logging::info(src_filename.c_str(), "Opening the input VCD."); 93 | 94 | m_fpi = fopen(src_filename.c_str(), "rb"); 95 | 96 | if (m_fpi == nullptr) 97 | { 98 | return errno; 99 | } 100 | 101 | return seek(0, SEEK_SET); 102 | } 103 | 104 | size_t VcdIO::readio(void * data, size_t size) 105 | { 106 | if (static_cast(ftell(m_fpi)) + size > m_end_pos) 107 | { 108 | size = static_cast(m_end_pos - static_cast(ftell(m_fpi))); 109 | } 110 | 111 | if (!size) 112 | { 113 | return 0; 114 | } 115 | 116 | return fread(data, 1, size, m_fpi); 117 | } 118 | 119 | int VcdIO::error() const 120 | { 121 | return ferror(m_fpi); 122 | } 123 | 124 | int64_t VcdIO::duration() const 125 | { 126 | return AV_NOPTS_VALUE; 127 | } 128 | 129 | size_t VcdIO::size() const 130 | { 131 | if (m_fpi == nullptr) 132 | { 133 | errno = EINVAL; 134 | return 0; 135 | } 136 | 137 | if (m_end_pos) 138 | { 139 | return static_cast(m_end_pos - m_start_pos); 140 | } 141 | 142 | struct stat stbuf; 143 | fstat(fileno(m_fpi), &stbuf); 144 | return static_cast(stbuf.st_size); 145 | } 146 | 147 | size_t VcdIO::tell() const 148 | { 149 | return static_cast(static_cast(ftell(m_fpi)) - m_start_pos); 150 | } 151 | 152 | int VcdIO::seek(int64_t offset, int whence) 153 | { 154 | off_t seek_pos; 155 | switch (whence) 156 | { 157 | case SEEK_SET: 158 | { 159 | seek_pos = static_cast(m_start_pos) + offset; 160 | break; 161 | } 162 | case SEEK_CUR: 163 | { 164 | seek_pos = static_cast(m_start_pos) + ftell(m_fpi) + offset; 165 | break; 166 | } 167 | case SEEK_END: 168 | { 169 | seek_pos = static_cast(m_end_pos) - offset; 170 | break; 171 | } 172 | default: 173 | { 174 | errno = EINVAL; 175 | return (EOF); 176 | } 177 | } 178 | 179 | if (static_cast(seek_pos) > m_end_pos) 180 | { 181 | seek_pos = static_cast(m_end_pos); // Cannot go beyond EOF. Set position to end, leave errno untouched. 182 | } 183 | 184 | if (static_cast(seek_pos) < m_start_pos) // Cannot go before head, leave position untouched, set errno. 185 | { 186 | errno = EINVAL; 187 | return (EOF); 188 | } 189 | 190 | return fseek(m_fpi, static_cast(seek_pos), SEEK_SET); 191 | } 192 | 193 | bool VcdIO::eof() const 194 | { 195 | return ((feof(m_fpi) || (static_cast(ftell(m_fpi)) >= m_end_pos)) ? true : false); 196 | } 197 | 198 | void VcdIO::closeio() 199 | { 200 | pvt_close(); 201 | } 202 | 203 | void VcdIO::pvt_close() 204 | { 205 | FILE *fpi = m_fpi; 206 | if (fpi != nullptr) 207 | { 208 | m_fpi = nullptr; 209 | fclose(fpi); 210 | } 211 | } 212 | 213 | #endif // USE_LIBVCD 214 | -------------------------------------------------------------------------------- /src/vcdio.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2018-2024 by Norbert Schlia (nschlia@oblivion-software.de) 3 | * 4 | * This program is free software; you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License as published by 6 | * the Free Software Foundation; either version 3 of the License, or 7 | * (at your option) any later version. 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with this program; if not, write to the Free Software 16 | * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. 17 | * 18 | * On Debian systems, the complete text of the GNU General Public License 19 | * Version 3 can be found in `/usr/share/common-licenses/GPL-3'. 20 | */ 21 | 22 | /** 23 | * @file vcdio.h 24 | * @brief Video CD and Super Video CD I/O 25 | * 26 | * This is only available if built with -DUSE_LIBVCD parameter. 27 | * 28 | * @ingroup ffmpegfs 29 | * 30 | * @author Norbert Schlia (nschlia@oblivion-software.de) 31 | * @copyright Copyright (C) 2018-2024 Norbert Schlia (nschlia@oblivion-software.de) 32 | */ 33 | 34 | #ifndef VCDIO_H 35 | #define VCDIO_H 36 | 37 | #pragma once 38 | 39 | #ifdef USE_LIBVCD 40 | 41 | #include "fileio.h" 42 | 43 | /** @brief Video CD and Super Video CD I/O class 44 | */ 45 | class VcdIO : public FileIO 46 | { 47 | public: 48 | /** 49 | * @brief Create #VcdIO object 50 | */ 51 | explicit VcdIO(); 52 | /** 53 | * @brief Free #VcdIO object 54 | * 55 | * Close file pointers 56 | */ 57 | virtual ~VcdIO(); 58 | 59 | /** 60 | * @brief Get type of the virtual file 61 | * @return Returns the type of the virtual file. 62 | */ 63 | virtual VIRTUALTYPE type() const override; 64 | /** 65 | * @brief Get the ideal buffer size. 66 | * @return Return the ideal buffer size. 67 | */ 68 | virtual size_t bufsize() const override; 69 | 70 | /** 71 | * @brief Open a virtual file 72 | * @param[in] virtualfile - LPCVIRTUALFILE of file to open 73 | * @return Upon successful completion, #openio() returns 0. @n 74 | * On error, an nonzero value is returned and errno is set to indicate the error. 75 | */ 76 | virtual int openio(LPVIRTUALFILE virtualfile) override; 77 | /** 78 | * @brief Read data from file 79 | * @param[out] data - buffer to store read bytes in. Must be large enough to hold up to size bytes. 80 | * @param[in] size - number of bytes to read 81 | * @return Upon successful completion, #readio() returns the number of bytes read. @n 82 | * This may be less than size. @n 83 | * On error, the value 0 is returned and errno is set to indicate the error. @n 84 | * If at end of file, 0 may be returned by errno not set. error() will return 0 if at EOF. 85 | */ 86 | virtual size_t readio(void *data, size_t size) override; 87 | /** 88 | * @brief Get last error. 89 | * @return errno value of last error. 90 | */ 91 | virtual int error() const override; 92 | /** 93 | * @brief Get the duration of the file, in AV_TIME_BASE fractional seconds. 94 | * @return Could work for VCD, but always returns AV_NOPTS_VALUE. 95 | * @todo Implement duration of video CD chapters 96 | */ 97 | virtual int64_t duration() const override; 98 | /** 99 | * @brief Get the file size. 100 | * @return Returns the file size. 101 | */ 102 | virtual size_t size() const override; 103 | /** 104 | * @brief Get current read position. 105 | * @return Gets the current read position. 106 | */ 107 | virtual size_t tell() const override; 108 | /** 109 | * @brief Seek to position in file 110 | * 111 | * Repositions the offset of the open file to the argument offset according to the directive whence. 112 | * 113 | * @param[in] offset - offset in bytes 114 | * @param[in] whence - how to seek: @n 115 | * SEEK_SET: The offset is set to offset bytes. @n 116 | * SEEK_CUR: The offset is set to its current location plus offset bytes. @n 117 | * SEEK_END: The offset is set to the size of the file plus offset bytes. 118 | * @return Upon successful completion, #seek() returns the resulting offset location as measured in bytes 119 | * from the beginning of the file. @n 120 | * On error, the value -1 is returned and errno is set to indicate the error. 121 | */ 122 | virtual int seek(int64_t offset, int whence) override; 123 | /** 124 | * @brief Check if at end of file. 125 | * @return Returns true if at end of file. 126 | */ 127 | virtual bool eof() const override; 128 | /** 129 | * @brief Close virtual file. 130 | */ 131 | virtual void closeio() override; 132 | 133 | private: 134 | /** 135 | * @brief Close virtual file. 136 | * Non-virtual version to be safely called from constructor/destructor 137 | */ 138 | void pvt_close(); 139 | 140 | protected: 141 | FILE * m_fpi; /**< @brief File pointer to source media */ 142 | 143 | bool m_full_title; /**< @brief If true, ignore m_chapter_no and provide full track */ 144 | int m_track_no; /**< @brief Track number (1..) */ 145 | int m_chapter_no; /**< @brief Chapter number (1..) */ 146 | 147 | uint64_t m_start_pos; /**< @brief Start offset in bytes */ 148 | uint64_t m_end_pos; /**< @brief End offset in bytes (not including this byte) */ 149 | }; 150 | #endif // USE_LIBVCD 151 | 152 | #endif // VCDIO_H 153 | -------------------------------------------------------------------------------- /src/vcdparser.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2018-2024 by Norbert Schlia (nschlia@oblivion-software.de) 3 | * 4 | * This program is free software; you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License as published by 6 | * the Free Software Foundation; either version 3 of the License, or 7 | * (at your option) any later version. 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with this program; if not, write to the Free Software 16 | * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. 17 | * 18 | * On Debian systems, the complete text of the GNU General Public License 19 | * Version 3 can be found in `/usr/share/common-licenses/GPL-3'. 20 | */ 21 | 22 | /** 23 | * @file vcdparser.h 24 | * @brief Video CD and Super Video CD parser 25 | * 26 | * This is only available if built with -DUSE_LIBVCD parameter. 27 | * 28 | * @ingroup ffmpegfs 29 | * 30 | * @author Norbert Schlia (nschlia@oblivion-software.de) 31 | * @copyright Copyright (C) 2018-2024 Norbert Schlia (nschlia@oblivion-software.de) 32 | */ 33 | 34 | #ifndef VCDPARSER_H 35 | #define VCDPARSER_H 36 | 37 | #pragma once 38 | 39 | #ifdef USE_LIBVCD 40 | 41 | /** 42 | * @brief Get number of chapters on S/VCD 43 | * @param[in] path - Path to check 44 | * @param[in, out] buf - The buffer passed to the readdir() operation. 45 | * @param[in, out] filler - Function to add an entry in a readdir() operation (see https://libfuse.github.io/doxygen/fuse_8h.html#a7dd132de66a5cc2add2a4eff5d435660) 46 | * @note buf and filler can be nullptr. In that case the call will run faster, so these parameters should only be passed if to be filled in. 47 | * @return -errno or number of chapters on S/VCD. 48 | */ 49 | int check_vcd(const std::string & path, void *buf = nullptr, fuse_fill_dir_t filler = nullptr); 50 | 51 | #endif // USE_LIBVCD 52 | #endif // VCDPARSER_H 53 | -------------------------------------------------------------------------------- /test/.gitignore: -------------------------------------------------------------------------------- 1 | metadata 2 | /*.tag 3 | /CMakeFiles/ 4 | /*.cmake 5 | /Testing/ 6 | -------------------------------------------------------------------------------- /test/Makefile.am: -------------------------------------------------------------------------------- 1 | TESTS=\ 2 | test_audio_aiff \ 3 | test_audio_alac \ 4 | test_audio_flac \ 5 | test_audio_mov \ 6 | test_audio_mp3 \ 7 | test_audio_mp4 \ 8 | test_audio_ogg \ 9 | test_audio_opus \ 10 | test_audio_prores \ 11 | test_audio_ts \ 12 | test_audio_wav \ 13 | test_audio_webm \ 14 | test_cuesheet_file \ 15 | test_cuesheet_embedded \ 16 | test_filecount_hls \ 17 | test_filenames_aiff \ 18 | test_filenames_alac \ 19 | test_filenames_flac \ 20 | test_filenames_hls \ 21 | test_filenames_mov \ 22 | test_filenames_mp3 \ 23 | test_filenames_mp4 \ 24 | test_filenames_ogg \ 25 | test_filenames_opus \ 26 | test_filenames_prores \ 27 | test_filenames_ts \ 28 | test_filenames_wav \ 29 | test_filenames_webm \ 30 | test_filesize_aiff \ 31 | test_filesize_alac \ 32 | test_filesize_flac \ 33 | test_filesize_hls \ 34 | test_filesize_mov \ 35 | test_filesize_mp3 \ 36 | test_filesize_mp4 \ 37 | test_filesize_ogg \ 38 | test_filesize_opus \ 39 | test_filesize_prores \ 40 | test_filesize_ts \ 41 | test_filesize_video_mov \ 42 | test_filesize_video_mp4 \ 43 | test_filesize_video_prores \ 44 | test_filesize_video_ts \ 45 | test_filesize_video_webm \ 46 | test_filesize_wav \ 47 | test_filesize_webm \ 48 | test_frameset_bmp \ 49 | test_frameset_jpg \ 50 | test_frameset_png \ 51 | test_tags_aiff \ 52 | test_tags_alac \ 53 | test_tags_flac \ 54 | test_tags_mov \ 55 | test_tags_mp3 \ 56 | test_tags_mp4 \ 57 | test_tags_ogg \ 58 | test_tags_opus \ 59 | test_tags_prores \ 60 | test_tags_ts \ 61 | test_tags_wav \ 62 | test_tags_webm \ 63 | test_video_hw_dec_mmal \ 64 | test_video_hw_dec_vaapi \ 65 | test_video_hw_enc_omx \ 66 | test_video_hw_enc_vaapi 67 | 68 | EXTRA_DIST = $(TESTS) funcs.sh srcdir test_filenames test_tags test_audio test_filesize test_frameset test_filesize_video test_video_hw test_cuesheet 69 | EXTRA_DIST += $(wildcard tags/*) 70 | # NOT IN RELEASE 1.0! Add later: test_picture 71 | 72 | CLEANFILES = $(patsubst %,%_builtin.log,$(TESTS)) 73 | 74 | AM_CPPFLAGS=-Ofast $(libswresample_CFLAGS) 75 | check_PROGRAMS = fpcompare metadata 76 | fpcompare_SOURCES = fpcompare.c 77 | fpcompare_LDADD = -lchromaprint -lavcodec -lavformat -lavutil $(libswresample_LIBS) 78 | metadata_SOURCES = metadata.c 79 | metadata_LDADD = -lavcodec -lavformat -lavutil $(libswresample_LIBS) 80 | -------------------------------------------------------------------------------- /test/funcs.sh: -------------------------------------------------------------------------------- 1 | PATH=$PWD/../src:$PATH 2 | export LC_ALL=C 3 | 4 | if [ ! -z "$2" ] 5 | then 6 | EXITCODE="$2" 7 | else 8 | EXITCODE=99 9 | fi 10 | 11 | cleanup () { 12 | EXIT=$? 13 | echo "Return code: ${EXIT}" 14 | # Errors are no longer fatal 15 | set +e 16 | # Unmount all 17 | hash fusermount 2>&- && fusermount -u "${DIRNAME}" || umount -l "${DIRNAME}" 18 | # Remove temporary directories 19 | rmdir "${DIRNAME}" 20 | rm -Rf "${CACHEPATH}" 21 | rm -Rf "${TMPPATH}" 22 | # Arrividerci 23 | exit ${EXIT} 24 | } 25 | 26 | ffmpegfserr () { 27 | echo "***TEST FAILED***" 28 | echo "Return code: ${EXITCODE}" 29 | exit ${EXITCODE} 30 | } 31 | 32 | check_filesize() { 33 | MIN="$2" 34 | MAX="$3" 35 | SHORT="$5" 36 | 37 | if [ "${FILEEXT}" != "hls" ] 38 | then 39 | FILE="$1.${FILEEXT}" 40 | else 41 | FILE="$1" 42 | fi 43 | 44 | if [ -z ${MAX} ] 45 | then 46 | MAX=${MIN} 47 | fi 48 | 49 | if [ -z "$4" ] 50 | then 51 | SIZE=$(stat -c %s "${DIRNAME}/${FILE}") 52 | else 53 | SIZE=$(stat -c %s "${4}/${FILE}") 54 | fi 55 | 56 | if [ ${SIZE} -ge ${MIN} -a ${SIZE} -le ${MAX} ] 57 | then 58 | RESULT="Pass" 59 | RETURN=0 60 | else 61 | RESULT="FAIL" 62 | RETURN=1 63 | fi 64 | 65 | if [ -z "${SHORT}" ] 66 | then 67 | if [ ${MIN} -eq ${MAX} ] 68 | then 69 | printf "> %s -> File: %-20s Size: %8i (expected %8i)\n" ${RESULT} ${FILE} ${SIZE} ${MIN} 70 | else 71 | printf "> %s -> File: %-20s Size: %8i (expected %8i...%8i)\n" ${RESULT} ${FILE} ${SIZE} ${MIN} ${MAX} 72 | fi 73 | else 74 | if [ ${MIN} -eq ${MAX} ] 75 | then 76 | printf "%s -> Size: %8i (expected %8i)\n" ${RESULT} ${SIZE} ${MIN} 77 | else 78 | printf "%s -> Size: %8i (expected %8i...%8i)\n" ${RESULT} ${SIZE} ${MIN} ${MAX} 79 | fi 80 | fi 81 | 82 | if [ ${RETURN} != 0 ]; 83 | then 84 | exit ${RETURN} 85 | fi 86 | } 87 | 88 | set -e 89 | trap cleanup EXIT 90 | trap ffmpegfserr USR1 91 | DESTTYPE=$1 92 | EXTRANAME=$3 93 | # Map filenames 94 | if [ "${DESTTYPE}" == "prores" ]; 95 | then 96 | # ProRes uses the MOV container 97 | FILEEXT="mov" 98 | elif [ "${DESTTYPE}" == "alac" ]; 99 | then 100 | # ALAC (Apple Lossless Coding) uses the mp4 container 101 | FILEEXT="m4a" 102 | else 103 | FILEEXT=${DESTTYPE} 104 | fi 105 | if [ -z "${EXTRANAME}" ]; 106 | then 107 | EXTRANAME=$DESTTYPE 108 | fi 109 | if [ "${EXTRANAME}" == "hls" ]; 110 | then 111 | EXTRANAME= 112 | fi 113 | if [ ! -z "${EXTRANAME}" ]; 114 | then 115 | EXTRANAME=_$EXTRANAME 116 | fi 117 | 118 | SRCDIR="$( cd "${BASH_SOURCE%/*}/srcdir" && pwd )" 119 | DIRNAME="$(mktemp -d)" 120 | CACHEPATH="$(mktemp -d)" 121 | TMPPATH="$(mktemp -d)" 122 | 123 | #--disable_cache 124 | ( ffmpegfs -f "${SRCDIR}" "${DIRNAME}" --logfile=${0##*/}${EXTRANAME}_builtin.log --log_maxlevel=TRACE --cachepath="${CACHEPATH}" --desttype=${DESTTYPE} ${ADDOPT} > /dev/null || kill -USR1 $$ ) & 125 | while ! mount | grep -q "${DIRNAME}" ; do 126 | sleep 0.1 127 | done 128 | -------------------------------------------------------------------------------- /test/metadata.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2020 Norbert Schlia (nschlia@oblivion-software.de) 3 | * 4 | * This program is free software; you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License as published by 6 | * the Free Software Foundation; either version 3 of the License, or 7 | * (at your option) any later version. 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with this program; if not, write to the Free Software 16 | * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. 17 | * 18 | * On Debian systems, the complete text of the GNU General Public License 19 | * Version 3 can be found in `/usr/share/common-licenses/GPL-3'. 20 | */ 21 | 22 | #include 23 | 24 | // Disable annoying warnings outside our code 25 | #pragma GCC diagnostic push 26 | #pragma GCC diagnostic ignored "-Wconversion" 27 | #pragma GCC diagnostic ignored "-Wsign-conversion" 28 | #include 29 | #include 30 | #include 31 | #pragma GCC diagnostic pop 32 | 33 | int main (int argc, char **argv) 34 | { 35 | if (argc != 2) 36 | { 37 | fprintf(stderr, "usage: %s \n" 38 | "Print all file meta data to screen.\n" 39 | "\n", argv[0]); 40 | fprintf(stderr, "ERROR: Exactly one parameter required\n\n"); 41 | return 1; 42 | } 43 | 44 | if (!strcmp(argv[1], "-v")) 45 | { 46 | printf("FFmpeg " FFMPEG_VERSION "\n"); 47 | return 0; 48 | } 49 | 50 | #if (LIBAVFORMAT_VERSION_INT < AV_VERSION_INT(58, 9, 0)) 51 | av_register_all(); 52 | #endif 53 | 54 | const char *filename = argv[1]; 55 | AVFormatContext *format_ctx = NULL; 56 | int ret = avformat_open_input(&format_ctx, filename, NULL, NULL); 57 | if (ret) 58 | { 59 | char error[AV_ERROR_MAX_STRING_SIZE]; 60 | av_strerror(ret, error, AV_ERROR_MAX_STRING_SIZE); 61 | fprintf(stderr, "avformat_open_input() returns error for file '%s'\n%s\n", filename, error); 62 | return ret; 63 | } 64 | 65 | ret = avformat_find_stream_info(format_ctx, NULL); 66 | if (ret < 0) 67 | { 68 | av_log(NULL, AV_LOG_ERROR, "Cannot find stream information\n"); 69 | return ret; 70 | } 71 | 72 | for (unsigned int streamno = 0; streamno < format_ctx->nb_streams; streamno++) 73 | { 74 | AVDictionaryEntry *tag = NULL; 75 | 76 | while ((tag = av_dict_get(format_ctx->streams[streamno]->metadata, "", tag, AV_DICT_IGNORE_SUFFIX)) != NULL) 77 | { 78 | printf("%s=%s\n", tag->key, tag->value); 79 | } 80 | } 81 | 82 | { 83 | AVDictionaryEntry *tag = NULL; 84 | 85 | while ((tag = av_dict_get(format_ctx->metadata, "", tag, AV_DICT_IGNORE_SUFFIX)) != NULL) 86 | { 87 | printf("%s=%s\n", tag->key, tag->value); 88 | } 89 | } 90 | 91 | avformat_close_input(&format_ctx); 92 | 93 | return 0; 94 | } 95 | -------------------------------------------------------------------------------- /test/mkvid: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | ffmpeg -y -f lavfi -i color=c=blue:s=1920x1280:d=10:r=30000/1001 -g 1 -c:v prores -vf \ 4 | "drawtext=fontsize=800: \ 5 | fontcolor=white:x=(w-text_w)/2:y=(h-text_h)/2: \ 6 | text='%{frame_num}': start_number=1" \ 7 | frame_test_ntsc.mov 8 | 9 | ffmpeg -y -f lavfi -i color=c=blue:s=1920x1280:d=10:r=25 -g 1 -c:v prores -vf \ 10 | "drawtext=fontsize=800: \ 11 | fontcolor=white:x=(w-text_w)/2:y=(h-text_h)/2: \ 12 | text='%{frame_num}': start_number=1" \ 13 | frame_test_pal.mov 14 | 15 | ffmpeg -y -f lavfi -i color=c=blue:s=1920x1280:d=10:r=30000/1001 -g 24 -c:v h264 -vf \ 16 | "drawtext=fontsize=800: \ 17 | fontcolor=white:x=(w-text_w)/2:y=(h-text_h)/2: \ 18 | text='%{frame_num}': start_number=1" \ 19 | frame_test_ntsc.mp4 20 | 21 | ffmpeg -y -f lavfi -i color=c=blue:s=1920x1280:d=10:r=25 -g 24 -c:v h264 -vf \ 22 | "drawtext=fontsize=800: \ 23 | fontcolor=white:x=(w-text_w)/2:y=(h-text_h)/2: \ 24 | text='%{frame_num}': start_number=1" \ 25 | frame_test_pal.mp4 26 | -------------------------------------------------------------------------------- /test/srcdir.org/copyright: -------------------------------------------------------------------------------- 1 | To the extent possible under law, the author(s) have dedicated all copyright 2 | and related and neighboring rights to this software to the public domain 3 | worldwide. This software is distributed without any warranty. 4 | 5 | You should have received a copy of the CC0 Public Domain Dedication along with 6 | this software. If not, see . 7 | 8 | On Debian systems, the full text of the CC0 Public Domain Dedication version 9 | version 1.0 can be found in the file `/usr/share/common-licenses/CC0-1.0,'. 10 | -------------------------------------------------------------------------------- /test/srcdir.org/cuesheet/raven_e.cue: -------------------------------------------------------------------------------- 1 | REM COMMENT "fre:ac - free audio converter " 2 | PERFORMER "Edgar Allan Poe" 3 | TITLE "The Raven" 4 | FILE "raven_e_cuesheet.flac" WAVE 5 | TRACK 01 AUDIO 6 | TITLE "01-raven_e" 7 | INDEX 01 00:00:00 8 | TRACK 02 AUDIO 9 | TITLE "02-raven_e" 10 | INDEX 01 00:04:57 11 | TRACK 03 AUDIO 12 | TITLE "03-raven_e" 13 | INDEX 01 00:07:74 14 | TRACK 04 AUDIO 15 | TITLE "04-raven_e" 16 | INDEX 01 00:09:36 17 | TRACK 05 AUDIO 18 | TITLE "05-raven_e" 19 | INDEX 01 00:11:44 20 | TRACK 06 AUDIO 21 | TITLE "06-raven_e" 22 | INDEX 01 00:13:67 23 | TRACK 07 AUDIO 24 | TITLE "07-raven_e" 25 | INDEX 01 00:16:01 26 | TRACK 08 AUDIO 27 | TITLE "08-raven_e" 28 | INDEX 01 00:18:37 29 | TRACK 09 AUDIO 30 | TITLE "09-raven_e" 31 | INDEX 01 00:21:03 32 | TRACK 10 AUDIO 33 | TITLE "10-raven_e" 34 | INDEX 01 00:22:43 35 | -------------------------------------------------------------------------------- /test/srcdir.org/cuesheet/raven_e.flac: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nschlia/ffmpegfs/a5645b02020eaf901a35d846ad818e48f30706ff/test/srcdir.org/cuesheet/raven_e.flac -------------------------------------------------------------------------------- /test/srcdir.org/cuesheet/raven_e_cuesheet.flac: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nschlia/ffmpegfs/a5645b02020eaf901a35d846ad818e48f30706ff/test/srcdir.org/cuesheet/raven_e_cuesheet.flac -------------------------------------------------------------------------------- /test/srcdir.org/raven_d.flac: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nschlia/ffmpegfs/a5645b02020eaf901a35d846ad818e48f30706ff/test/srcdir.org/raven_d.flac -------------------------------------------------------------------------------- /test/srcdir.org/raven_e.flac: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nschlia/ffmpegfs/a5645b02020eaf901a35d846ad818e48f30706ff/test/srcdir.org/raven_e.flac -------------------------------------------------------------------------------- /test/srcdir/copyright: -------------------------------------------------------------------------------- 1 | To the extent possible under law, the author(s) have dedicated all copyright 2 | and related and neighboring rights to this software to the public domain 3 | worldwide. This software is distributed without any warranty. 4 | 5 | You should have received a copy of the CC0 Public Domain Dedication along with 6 | this software. If not, see . 7 | 8 | On Debian systems, the full text of the CC0 Public Domain Dedication version 9 | version 1.0 can be found in the file `/usr/share/common-licenses/CC0-1.0,'. 10 | -------------------------------------------------------------------------------- /test/srcdir/cuesheet/raven_e.cue: -------------------------------------------------------------------------------- 1 | REM COMMENT "fre:ac - free audio converter " 2 | PERFORMER "Edgar Allan Poe" 3 | TITLE "The Raven" 4 | FILE "raven_e_cuesheet.flac" WAVE 5 | TRACK 01 AUDIO 6 | TITLE "01-raven_e" 7 | INDEX 01 00:00:00 8 | TRACK 02 AUDIO 9 | TITLE "02-raven_e" 10 | INDEX 01 00:04:57 11 | TRACK 03 AUDIO 12 | TITLE "03-raven_e" 13 | INDEX 01 00:07:74 14 | TRACK 04 AUDIO 15 | TITLE "04-raven_e" 16 | INDEX 01 00:09:36 17 | TRACK 05 AUDIO 18 | TITLE "05-raven_e" 19 | INDEX 01 00:11:44 20 | TRACK 06 AUDIO 21 | TITLE "06-raven_e" 22 | INDEX 01 00:13:67 23 | TRACK 07 AUDIO 24 | TITLE "07-raven_e" 25 | INDEX 01 00:16:01 26 | TRACK 08 AUDIO 27 | TITLE "08-raven_e" 28 | INDEX 01 00:18:37 29 | TRACK 09 AUDIO 30 | TITLE "09-raven_e" 31 | INDEX 01 00:21:03 32 | TRACK 10 AUDIO 33 | TITLE "10-raven_e" 34 | INDEX 01 00:22:43 35 | -------------------------------------------------------------------------------- /test/srcdir/cuesheet/raven_e.flac: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nschlia/ffmpegfs/a5645b02020eaf901a35d846ad818e48f30706ff/test/srcdir/cuesheet/raven_e.flac -------------------------------------------------------------------------------- /test/srcdir/cuesheet/raven_e_cuesheet.flac: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nschlia/ffmpegfs/a5645b02020eaf901a35d846ad818e48f30706ff/test/srcdir/cuesheet/raven_e_cuesheet.flac -------------------------------------------------------------------------------- /test/srcdir/dir.flac/.empty: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nschlia/ffmpegfs/a5645b02020eaf901a35d846ad818e48f30706ff/test/srcdir/dir.flac/.empty -------------------------------------------------------------------------------- /test/srcdir/frame_test_pal.mp4: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nschlia/ffmpegfs/a5645b02020eaf901a35d846ad818e48f30706ff/test/srcdir/frame_test_pal.mp4 -------------------------------------------------------------------------------- /test/srcdir/raven_d.ogg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nschlia/ffmpegfs/a5645b02020eaf901a35d846ad818e48f30706ff/test/srcdir/raven_d.ogg -------------------------------------------------------------------------------- /test/srcdir/raven_e.flac: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nschlia/ffmpegfs/a5645b02020eaf901a35d846ad818e48f30706ff/test/srcdir/raven_e.flac -------------------------------------------------------------------------------- /test/srcdir/snowboard.mp4: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nschlia/ffmpegfs/a5645b02020eaf901a35d846ad818e48f30706ff/test/srcdir/snowboard.mp4 -------------------------------------------------------------------------------- /test/tags/ffmpeg4.0/obama.ts.tag: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /test/tags/ffmpeg4.0/raven.ts.tag: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /test/tags/ffmpeg4.0/raven_d.aiff.tag: -------------------------------------------------------------------------------- 1 | title=The Raven 2 | -------------------------------------------------------------------------------- /test/tags/ffmpeg4.0/raven_d.alac.tag: -------------------------------------------------------------------------------- 1 | artist=Edgar Allan Poe 2 | compatible_brands=isomiso2iso6 3 | 4 | handler_name=SoundHandler 5 | language=und 6 | major_brand=M4A 7 | minor_version=512 8 | title=The Raven 9 | -------------------------------------------------------------------------------- /test/tags/ffmpeg4.0/raven_d.flac.tag: -------------------------------------------------------------------------------- 1 | ARTIST=Edgar Allan Poe 2 | DURATION=24468753 3 | TITLE=The Raven 4 | -------------------------------------------------------------------------------- /test/tags/ffmpeg4.0/raven_d.mov.tag: -------------------------------------------------------------------------------- 1 | artist=Edgar Allan Poe 2 | compatible_brands=qt iso6 3 | 4 | handler_name=SoundHandler 5 | language=eng 6 | major_brand=qt 7 | minor_version=512 8 | title=The Raven 9 | -------------------------------------------------------------------------------- /test/tags/ffmpeg4.0/raven_d.mp3.tag: -------------------------------------------------------------------------------- 1 | DURATION=24468753 2 | artist=Edgar Allan Poe 3 | 4 | 5 | title=The Raven 6 | -------------------------------------------------------------------------------- /test/tags/ffmpeg4.0/raven_d.mp4.tag: -------------------------------------------------------------------------------- 1 | artist=Edgar Allan Poe 2 | compatible_brands=isomiso2iso6mp41 3 | 4 | handler_name=SoundHandler 5 | language=und 6 | major_brand=isom 7 | minor_version=512 8 | title=The Raven 9 | -------------------------------------------------------------------------------- /test/tags/ffmpeg4.0/raven_d.ogg.tag: -------------------------------------------------------------------------------- 1 | ARTIST=Edgar Allan Poe 2 | DURATION=24468753 3 | 4 | TITLE=The Raven 5 | -------------------------------------------------------------------------------- /test/tags/ffmpeg4.0/raven_d.opus.tag: -------------------------------------------------------------------------------- 1 | ARTIST=Edgar Allan Poe 2 | DURATION=24468753 3 | 4 | TITLE=The Raven 5 | -------------------------------------------------------------------------------- /test/tags/ffmpeg4.0/raven_d.prores.tag: -------------------------------------------------------------------------------- 1 | artist=Edgar Allan Poe 2 | compatible_brands=qt iso6 3 | 4 | handler_name=SoundHandler 5 | language=eng 6 | major_brand=qt 7 | minor_version=512 8 | title=The Raven 9 | -------------------------------------------------------------------------------- /test/tags/ffmpeg4.0/raven_d.ts.tag: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /test/tags/ffmpeg4.0/raven_d.wav.tag: -------------------------------------------------------------------------------- 1 | artist=Edgar Allan Poe 2 | 3 | title=The Raven 4 | -------------------------------------------------------------------------------- /test/tags/ffmpeg4.0/raven_d.webm.tag: -------------------------------------------------------------------------------- 1 | ARTIST=Edgar Allan Poe 2 | 3 | 4 | title=The Raven 5 | -------------------------------------------------------------------------------- /test/tags/ffmpeg4.0/raven_e.aiff.tag: -------------------------------------------------------------------------------- 1 | title=The Raven 2 | -------------------------------------------------------------------------------- /test/tags/ffmpeg4.0/raven_e.alac.tag: -------------------------------------------------------------------------------- 1 | artist=Edgar Allan Poe 2 | compatible_brands=isomiso2iso6 3 | 4 | handler_name=SoundHandler 5 | language=und 6 | major_brand=M4A 7 | minor_version=512 8 | title=The Raven 9 | -------------------------------------------------------------------------------- /test/tags/ffmpeg4.0/raven_e.flac.tag: -------------------------------------------------------------------------------- 1 | ARTIST=Edgar Allan Poe 2 | DURATION=29125011 3 | TITLE=The Raven 4 | -------------------------------------------------------------------------------- /test/tags/ffmpeg4.0/raven_e.mov.tag: -------------------------------------------------------------------------------- 1 | artist=Edgar Allan Poe 2 | compatible_brands=qt iso6 3 | 4 | handler_name=SoundHandler 5 | language=eng 6 | major_brand=qt 7 | minor_version=512 8 | title=The Raven 9 | -------------------------------------------------------------------------------- /test/tags/ffmpeg4.0/raven_e.mp3.tag: -------------------------------------------------------------------------------- 1 | DURATION=29125011 2 | artist=Edgar Allan Poe 3 | 4 | 5 | title=The Raven 6 | -------------------------------------------------------------------------------- /test/tags/ffmpeg4.0/raven_e.mp4.tag: -------------------------------------------------------------------------------- 1 | artist=Edgar Allan Poe 2 | compatible_brands=isomiso2iso6mp41 3 | 4 | handler_name=SoundHandler 5 | language=und 6 | major_brand=isom 7 | minor_version=512 8 | title=The Raven 9 | -------------------------------------------------------------------------------- /test/tags/ffmpeg4.0/raven_e.ogg.tag: -------------------------------------------------------------------------------- 1 | ARTIST=Edgar Allan Poe 2 | DURATION=29125011 3 | 4 | TITLE=The Raven 5 | -------------------------------------------------------------------------------- /test/tags/ffmpeg4.0/raven_e.opus.tag: -------------------------------------------------------------------------------- 1 | ARTIST=Edgar Allan Poe 2 | DURATION=29125011 3 | 4 | TITLE=The Raven 5 | -------------------------------------------------------------------------------- /test/tags/ffmpeg4.0/raven_e.prores.tag: -------------------------------------------------------------------------------- 1 | artist=Edgar Allan Poe 2 | compatible_brands=qt iso6 3 | 4 | handler_name=SoundHandler 5 | language=eng 6 | major_brand=qt 7 | minor_version=512 8 | title=The Raven 9 | -------------------------------------------------------------------------------- /test/tags/ffmpeg4.0/raven_e.ts.tag: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /test/tags/ffmpeg4.0/raven_e.wav.tag: -------------------------------------------------------------------------------- 1 | artist=Edgar Allan Poe 2 | 3 | title=The Raven 4 | -------------------------------------------------------------------------------- /test/tags/ffmpeg4.0/raven_e.webm.tag: -------------------------------------------------------------------------------- 1 | ARTIST=Edgar Allan Poe 2 | 3 | title=The Raven 4 | -------------------------------------------------------------------------------- /test/tags/ffmpeg4.0/snowboard.mov.tag: -------------------------------------------------------------------------------- 1 | album=Snowboard 2 | artist=Norbert Schlia 3 | comment=Snowboard ride footage taken with action cam 2018-01-13 Saalbach/Austria 4 | compatible_brands=qt iso6 5 | date=2018 6 | 7 | genre=Demo 8 | handler_name=SoundHandler 9 | handler_name=VideoHandler 10 | language=eng 11 | major_brand=qt 12 | minor_version=512 13 | title=Video Transcode Demo 14 | -------------------------------------------------------------------------------- /test/tags/ffmpeg4.0/snowboard.mp4.tag: -------------------------------------------------------------------------------- 1 | album=Snowboard 2 | artist=Norbert Schlia 3 | comment=Snowboard ride footage taken with action cam 2018-01-13 Saalbach/Austria 4 | compatible_brands=isomiso2avc1iso6mp41 5 | date=2018 6 | 7 | genre=Demo 8 | handler_name=SoundHandler 9 | handler_name=VideoHandler 10 | language=eng 11 | language=und 12 | major_brand=isom 13 | minor_version=512 14 | season_number=0 15 | title=Video Transcode Demo 16 | -------------------------------------------------------------------------------- /test/tags/ffmpeg4.0/snowboard.prores.tag: -------------------------------------------------------------------------------- 1 | album=Snowboard 2 | artist=Norbert Schlia 3 | comment=Snowboard ride footage taken with action cam 2018-01-13 Saalbach/Austria 4 | compatible_brands=qt iso6 5 | date=2018 6 | 7 | genre=Demo 8 | handler_name=SoundHandler 9 | handler_name=VideoHandler 10 | language=eng 11 | major_brand=qt 12 | minor_version=512 13 | title=Video Transcode Demo 14 | -------------------------------------------------------------------------------- /test/tags/ffmpeg4.0/snowboard.ts.tag: -------------------------------------------------------------------------------- 1 | language=eng 2 | -------------------------------------------------------------------------------- /test/tags/ffmpeg4.0/snowboard.webm.tag: -------------------------------------------------------------------------------- 1 | ALBUM=Snowboard 2 | ARTIST=Norbert Schlia 3 | COMMENT=Snowboard ride footage taken with action cam 2018-01-13 Saalbach/Austria 4 | COMPATIBLE_BRANDS=isomiso2avc1mp41 5 | DATE=2018 6 | 7 | GENRE=Demo 8 | HANDLER_NAME=SoundHandler 9 | HANDLER_NAME=VideoHandler 10 | MAJOR_BRAND=isom 11 | MINOR_VERSION=512 12 | SEASON_NUMBER=0 13 | language=eng 14 | title=Video Transcode Demo 15 | -------------------------------------------------------------------------------- /test/tags/ffmpeg4.2/obama.ts.tag: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /test/tags/ffmpeg4.2/raven.ts.tag: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /test/tags/ffmpeg4.2/raven_d.aiff.tag: -------------------------------------------------------------------------------- 1 | title=The Raven 2 | -------------------------------------------------------------------------------- /test/tags/ffmpeg4.2/raven_d.alac.tag: -------------------------------------------------------------------------------- 1 | artist=Edgar Allan Poe 2 | compatible_brands=isomiso2iso6 3 | 4 | handler_name=SoundHandler 5 | language=und 6 | major_brand=M4A 7 | minor_version=512 8 | title=The Raven 9 | -------------------------------------------------------------------------------- /test/tags/ffmpeg4.2/raven_d.flac.tag: -------------------------------------------------------------------------------- 1 | ARTIST=Edgar Allan Poe 2 | DURATION=24468753 3 | TITLE=The Raven 4 | -------------------------------------------------------------------------------- /test/tags/ffmpeg4.2/raven_d.mov.tag: -------------------------------------------------------------------------------- 1 | artist=Edgar Allan Poe 2 | compatible_brands=qt iso6 3 | 4 | handler_name=SoundHandler 5 | major_brand=qt 6 | minor_version=512 7 | title=The Raven 8 | -------------------------------------------------------------------------------- /test/tags/ffmpeg4.2/raven_d.mp3.tag: -------------------------------------------------------------------------------- 1 | DURATION=24468753 2 | artist=Edgar Allan Poe 3 | 4 | 5 | title=The Raven 6 | -------------------------------------------------------------------------------- /test/tags/ffmpeg4.2/raven_d.mp4.tag: -------------------------------------------------------------------------------- 1 | artist=Edgar Allan Poe 2 | compatible_brands=isomiso2iso6mp41 3 | 4 | handler_name=SoundHandler 5 | language=und 6 | major_brand=isom 7 | minor_version=512 8 | title=The Raven 9 | -------------------------------------------------------------------------------- /test/tags/ffmpeg4.2/raven_d.ogg.tag: -------------------------------------------------------------------------------- 1 | ARTIST=Edgar Allan Poe 2 | DURATION=24468753 3 | TITLE=The Raven 4 | -------------------------------------------------------------------------------- /test/tags/ffmpeg4.2/raven_d.opus.tag: -------------------------------------------------------------------------------- 1 | ARTIST=Edgar Allan Poe 2 | DURATION=24468753 3 | TITLE=The Raven 4 | -------------------------------------------------------------------------------- /test/tags/ffmpeg4.2/raven_d.prores.tag: -------------------------------------------------------------------------------- 1 | artist=Edgar Allan Poe 2 | compatible_brands=qt iso6 3 | 4 | handler_name=SoundHandler 5 | major_brand=qt 6 | minor_version=512 7 | title=The Raven 8 | -------------------------------------------------------------------------------- /test/tags/ffmpeg4.2/raven_d.ts.tag: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /test/tags/ffmpeg4.2/raven_d.wav.tag: -------------------------------------------------------------------------------- 1 | artist=Edgar Allan Poe 2 | 3 | title=The Raven 4 | -------------------------------------------------------------------------------- /test/tags/ffmpeg4.2/raven_d.webm.tag: -------------------------------------------------------------------------------- 1 | ARTIST=Edgar Allan Poe 2 | 3 | 4 | title=The Raven 5 | -------------------------------------------------------------------------------- /test/tags/ffmpeg4.2/raven_e.aiff.tag: -------------------------------------------------------------------------------- 1 | title=The Raven 2 | -------------------------------------------------------------------------------- /test/tags/ffmpeg4.2/raven_e.alac.tag: -------------------------------------------------------------------------------- 1 | artist=Edgar Allan Poe 2 | compatible_brands=isomiso2iso6 3 | 4 | handler_name=SoundHandler 5 | language=und 6 | major_brand=M4A 7 | minor_version=512 8 | title=The Raven 9 | -------------------------------------------------------------------------------- /test/tags/ffmpeg4.2/raven_e.flac.tag: -------------------------------------------------------------------------------- 1 | ARTIST=Edgar Allan Poe 2 | DURATION=29125011 3 | TITLE=The Raven 4 | -------------------------------------------------------------------------------- /test/tags/ffmpeg4.2/raven_e.mov.tag: -------------------------------------------------------------------------------- 1 | artist=Edgar Allan Poe 2 | compatible_brands=qt iso6 3 | 4 | handler_name=SoundHandler 5 | major_brand=qt 6 | minor_version=512 7 | title=The Raven 8 | -------------------------------------------------------------------------------- /test/tags/ffmpeg4.2/raven_e.mp3.tag: -------------------------------------------------------------------------------- 1 | DURATION=29125011 2 | artist=Edgar Allan Poe 3 | 4 | 5 | title=The Raven 6 | -------------------------------------------------------------------------------- /test/tags/ffmpeg4.2/raven_e.mp4.tag: -------------------------------------------------------------------------------- 1 | artist=Edgar Allan Poe 2 | compatible_brands=isomiso2iso6mp41 3 | 4 | handler_name=SoundHandler 5 | language=und 6 | major_brand=isom 7 | minor_version=512 8 | title=The Raven 9 | -------------------------------------------------------------------------------- /test/tags/ffmpeg4.2/raven_e.ogg.tag: -------------------------------------------------------------------------------- 1 | ARTIST=Edgar Allan Poe 2 | DURATION=29125011 3 | TITLE=The Raven 4 | -------------------------------------------------------------------------------- /test/tags/ffmpeg4.2/raven_e.opus.tag: -------------------------------------------------------------------------------- 1 | ARTIST=Edgar Allan Poe 2 | DURATION=29125011 3 | TITLE=The Raven 4 | -------------------------------------------------------------------------------- /test/tags/ffmpeg4.2/raven_e.prores.tag: -------------------------------------------------------------------------------- 1 | artist=Edgar Allan Poe 2 | compatible_brands=qt iso6 3 | 4 | handler_name=SoundHandler 5 | major_brand=qt 6 | minor_version=512 7 | title=The Raven 8 | -------------------------------------------------------------------------------- /test/tags/ffmpeg4.2/raven_e.ts.tag: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /test/tags/ffmpeg4.2/raven_e.wav.tag: -------------------------------------------------------------------------------- 1 | artist=Edgar Allan Poe 2 | 3 | title=The Raven 4 | -------------------------------------------------------------------------------- /test/tags/ffmpeg4.2/raven_e.webm.tag: -------------------------------------------------------------------------------- 1 | ARTIST=Edgar Allan Poe 2 | 3 | title=The Raven 4 | -------------------------------------------------------------------------------- /test/tags/ffmpeg4.2/snowboard.mov.tag: -------------------------------------------------------------------------------- 1 | album=Snowboard 2 | artist=Norbert Schlia 3 | comment=Snowboard ride footage taken with action cam 2018-01-13 Saalbach/Austria 4 | compatible_brands=qt iso6 5 | date=2018 6 | 7 | genre=Demo 8 | handler_name=SoundHandler 9 | handler_name=VideoHandler 10 | language=eng 11 | major_brand=qt 12 | minor_version=512 13 | title=Video Transcode Demo 14 | -------------------------------------------------------------------------------- /test/tags/ffmpeg4.2/snowboard.mp4.tag: -------------------------------------------------------------------------------- 1 | album=Snowboard 2 | artist=Norbert Schlia 3 | comment=Snowboard ride footage taken with action cam 2018-01-13 Saalbach/Austria 4 | compatible_brands=isomiso2avc1iso6mp41 5 | date=2018 6 | 7 | genre=Demo 8 | handler_name=SoundHandler 9 | handler_name=VideoHandler 10 | language=eng 11 | language=und 12 | major_brand=isom 13 | minor_version=512 14 | season_number=0 15 | title=Video Transcode Demo 16 | -------------------------------------------------------------------------------- /test/tags/ffmpeg4.2/snowboard.prores.tag: -------------------------------------------------------------------------------- 1 | album=Snowboard 2 | artist=Norbert Schlia 3 | comment=Snowboard ride footage taken with action cam 2018-01-13 Saalbach/Austria 4 | compatible_brands=qt iso6 5 | date=2018 6 | 7 | genre=Demo 8 | handler_name=SoundHandler 9 | handler_name=VideoHandler 10 | language=eng 11 | major_brand=qt 12 | minor_version=512 13 | title=Video Transcode Demo 14 | -------------------------------------------------------------------------------- /test/tags/ffmpeg4.2/snowboard.ts.tag: -------------------------------------------------------------------------------- 1 | language=eng 2 | -------------------------------------------------------------------------------- /test/tags/ffmpeg4.2/snowboard.webm.tag: -------------------------------------------------------------------------------- 1 | ALBUM=Snowboard 2 | ARTIST=Norbert Schlia 3 | COMMENT=Snowboard ride footage taken with action cam 2018-01-13 Saalbach/Austria 4 | COMPATIBLE_BRANDS=isomiso2avc1mp41 5 | DATE=2018 6 | 7 | GENRE=Demo 8 | HANDLER_NAME=SoundHandler 9 | HANDLER_NAME=VideoHandler 10 | MAJOR_BRAND=isom 11 | MINOR_VERSION=512 12 | SEASON_NUMBER=0 13 | language=eng 14 | title=Video Transcode Demo 15 | -------------------------------------------------------------------------------- /test/tags/ffmpeg4.3/obama.ts.tag: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /test/tags/ffmpeg4.3/raven.ts.tag: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /test/tags/ffmpeg4.3/raven_d.aiff.tag: -------------------------------------------------------------------------------- 1 | title=The Raven 2 | -------------------------------------------------------------------------------- /test/tags/ffmpeg4.3/raven_d.alac.tag: -------------------------------------------------------------------------------- 1 | artist=Edgar Allan Poe 2 | compatible_brands=M4A iso6isomiso2 3 | 4 | handler_name=SoundHandler 5 | language=und 6 | major_brand=M4A 7 | minor_version=512 8 | title=The Raven 9 | -------------------------------------------------------------------------------- /test/tags/ffmpeg4.3/raven_d.flac.tag: -------------------------------------------------------------------------------- 1 | ARTIST=Edgar Allan Poe 2 | DURATION=24468753 3 | TITLE=The Raven 4 | -------------------------------------------------------------------------------- /test/tags/ffmpeg4.3/raven_d.mov.tag: -------------------------------------------------------------------------------- 1 | artist=Edgar Allan Poe 2 | compatible_brands=qt 3 | 4 | handler_name=SoundHandler 5 | major_brand=qt 6 | minor_version=512 7 | title=The Raven 8 | -------------------------------------------------------------------------------- /test/tags/ffmpeg4.3/raven_d.mp3.tag: -------------------------------------------------------------------------------- 1 | DURATION=24468753 2 | artist=Edgar Allan Poe 3 | 4 | 5 | title=The Raven 6 | -------------------------------------------------------------------------------- /test/tags/ffmpeg4.3/raven_d.mp4.tag: -------------------------------------------------------------------------------- 1 | artist=Edgar Allan Poe 2 | compatible_brands=isomiso6iso2mp41 3 | 4 | handler_name=SoundHandler 5 | language=und 6 | major_brand=isom 7 | minor_version=512 8 | title=The Raven 9 | -------------------------------------------------------------------------------- /test/tags/ffmpeg4.3/raven_d.ogg.tag: -------------------------------------------------------------------------------- 1 | ARTIST=Edgar Allan Poe 2 | DURATION=24468753 3 | TITLE=The Raven 4 | -------------------------------------------------------------------------------- /test/tags/ffmpeg4.3/raven_d.opus.tag: -------------------------------------------------------------------------------- 1 | ARTIST=Edgar Allan Poe 2 | DURATION=24468753 3 | TITLE=The Raven 4 | -------------------------------------------------------------------------------- /test/tags/ffmpeg4.3/raven_d.prores.tag: -------------------------------------------------------------------------------- 1 | artist=Edgar Allan Poe 2 | compatible_brands=qt 3 | 4 | handler_name=SoundHandler 5 | major_brand=qt 6 | minor_version=512 7 | title=The Raven 8 | -------------------------------------------------------------------------------- /test/tags/ffmpeg4.3/raven_d.ts.tag: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /test/tags/ffmpeg4.3/raven_d.wav.tag: -------------------------------------------------------------------------------- 1 | artist=Edgar Allan Poe 2 | 3 | title=The Raven 4 | -------------------------------------------------------------------------------- /test/tags/ffmpeg4.3/raven_d.webm.tag: -------------------------------------------------------------------------------- 1 | ARTIST=Edgar Allan Poe 2 | 3 | 4 | title=The Raven 5 | -------------------------------------------------------------------------------- /test/tags/ffmpeg4.3/raven_e.aiff.tag: -------------------------------------------------------------------------------- 1 | title=The Raven 2 | -------------------------------------------------------------------------------- /test/tags/ffmpeg4.3/raven_e.alac.tag: -------------------------------------------------------------------------------- 1 | artist=Edgar Allan Poe 2 | compatible_brands=M4A iso6isomiso2 3 | 4 | handler_name=SoundHandler 5 | language=und 6 | major_brand=M4A 7 | minor_version=512 8 | title=The Raven 9 | -------------------------------------------------------------------------------- /test/tags/ffmpeg4.3/raven_e.flac.tag: -------------------------------------------------------------------------------- 1 | ARTIST=Edgar Allan Poe 2 | DURATION=29125011 3 | TITLE=The Raven 4 | -------------------------------------------------------------------------------- /test/tags/ffmpeg4.3/raven_e.mov.tag: -------------------------------------------------------------------------------- 1 | artist=Edgar Allan Poe 2 | compatible_brands=qt 3 | 4 | handler_name=SoundHandler 5 | major_brand=qt 6 | minor_version=512 7 | title=The Raven 8 | -------------------------------------------------------------------------------- /test/tags/ffmpeg4.3/raven_e.mp3.tag: -------------------------------------------------------------------------------- 1 | DURATION=29125011 2 | artist=Edgar Allan Poe 3 | 4 | 5 | title=The Raven 6 | -------------------------------------------------------------------------------- /test/tags/ffmpeg4.3/raven_e.mp4.tag: -------------------------------------------------------------------------------- 1 | artist=Edgar Allan Poe 2 | compatible_brands=isomiso6iso2mp41 3 | 4 | handler_name=SoundHandler 5 | language=und 6 | major_brand=isom 7 | minor_version=512 8 | title=The Raven 9 | -------------------------------------------------------------------------------- /test/tags/ffmpeg4.3/raven_e.ogg.tag: -------------------------------------------------------------------------------- 1 | ARTIST=Edgar Allan Poe 2 | DURATION=29125011 3 | TITLE=The Raven 4 | -------------------------------------------------------------------------------- /test/tags/ffmpeg4.3/raven_e.opus.tag: -------------------------------------------------------------------------------- 1 | ARTIST=Edgar Allan Poe 2 | DURATION=29125011 3 | TITLE=The Raven 4 | -------------------------------------------------------------------------------- /test/tags/ffmpeg4.3/raven_e.prores.tag: -------------------------------------------------------------------------------- 1 | artist=Edgar Allan Poe 2 | compatible_brands=qt 3 | 4 | handler_name=SoundHandler 5 | major_brand=qt 6 | minor_version=512 7 | title=The Raven 8 | -------------------------------------------------------------------------------- /test/tags/ffmpeg4.3/raven_e.ts.tag: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /test/tags/ffmpeg4.3/raven_e.wav.tag: -------------------------------------------------------------------------------- 1 | artist=Edgar Allan Poe 2 | 3 | title=The Raven 4 | -------------------------------------------------------------------------------- /test/tags/ffmpeg4.3/raven_e.webm.tag: -------------------------------------------------------------------------------- 1 | ARTIST=Edgar Allan Poe 2 | 3 | title=The Raven 4 | -------------------------------------------------------------------------------- /test/tags/ffmpeg4.3/snowboard.mov.tag: -------------------------------------------------------------------------------- 1 | album=Snowboard 2 | artist=Norbert Schlia 3 | comment=Snowboard ride footage taken with action cam 2018-01-13 Saalbach/Austria 4 | compatible_brands=qt 5 | date=2018 6 | 7 | genre=Demo 8 | handler_name=SoundHandler 9 | handler_name=VideoHandler 10 | language=eng 11 | major_brand=qt 12 | minor_version=512 13 | title=Video Transcode Demo 14 | -------------------------------------------------------------------------------- /test/tags/ffmpeg4.3/snowboard.mp4.tag: -------------------------------------------------------------------------------- 1 | album=Snowboard 2 | artist=Norbert Schlia 3 | comment=Snowboard ride footage taken with action cam 2018-01-13 Saalbach/Austria 4 | compatible_brands=isomiso6iso2avc1mp41 5 | date=2018 6 | 7 | genre=Demo 8 | handler_name=SoundHandler 9 | handler_name=VideoHandler 10 | language=eng 11 | language=und 12 | major_brand=isom 13 | minor_version=512 14 | season_number=0 15 | title=Video Transcode Demo 16 | -------------------------------------------------------------------------------- /test/tags/ffmpeg4.3/snowboard.prores.tag: -------------------------------------------------------------------------------- 1 | album=Snowboard 2 | artist=Norbert Schlia 3 | comment=Snowboard ride footage taken with action cam 2018-01-13 Saalbach/Austria 4 | compatible_brands=qt 5 | date=2018 6 | 7 | genre=Demo 8 | handler_name=SoundHandler 9 | handler_name=VideoHandler 10 | language=eng 11 | major_brand=qt 12 | minor_version=512 13 | title=Video Transcode Demo 14 | -------------------------------------------------------------------------------- /test/tags/ffmpeg4.3/snowboard.ts.tag: -------------------------------------------------------------------------------- 1 | language=eng 2 | -------------------------------------------------------------------------------- /test/tags/ffmpeg4.3/snowboard.webm.tag: -------------------------------------------------------------------------------- 1 | ALBUM=Snowboard 2 | ARTIST=Norbert Schlia 3 | COMMENT=Snowboard ride footage taken with action cam 2018-01-13 Saalbach/Austria 4 | COMPATIBLE_BRANDS=isomiso2avc1mp41 5 | DATE=2018 6 | 7 | GENRE=Demo 8 | HANDLER_NAME=SoundHandler 9 | HANDLER_NAME=VideoHandler 10 | MAJOR_BRAND=isom 11 | MINOR_VERSION=512 12 | SEASON_NUMBER=0 13 | language=eng 14 | title=Video Transcode Demo 15 | -------------------------------------------------------------------------------- /test/tags/ffmpegN/obama.ts.tag: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /test/tags/ffmpegN/raven.ts.tag: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /test/tags/ffmpegN/raven_d.aiff.tag: -------------------------------------------------------------------------------- 1 | title=The Raven 2 | -------------------------------------------------------------------------------- /test/tags/ffmpegN/raven_d.alac.tag: -------------------------------------------------------------------------------- 1 | artist=Edgar Allan Poe 2 | compatible_brands=M4A iso6isomiso2 3 | 4 | handler_name=SoundHandler 5 | language=und 6 | major_brand=M4A 7 | minor_version=512 8 | title=The Raven 9 | -------------------------------------------------------------------------------- /test/tags/ffmpegN/raven_d.flac.tag: -------------------------------------------------------------------------------- 1 | ARTIST=Edgar Allan Poe 2 | DURATION=24468753 3 | TITLE=The Raven 4 | -------------------------------------------------------------------------------- /test/tags/ffmpegN/raven_d.mov.tag: -------------------------------------------------------------------------------- 1 | artist=Edgar Allan Poe 2 | compatible_brands=qt 3 | 4 | handler_name=SoundHandler 5 | major_brand=qt 6 | minor_version=512 7 | title=The Raven 8 | -------------------------------------------------------------------------------- /test/tags/ffmpegN/raven_d.mp3.tag: -------------------------------------------------------------------------------- 1 | DURATION=24468753 2 | artist=Edgar Allan Poe 3 | 4 | 5 | title=The Raven 6 | -------------------------------------------------------------------------------- /test/tags/ffmpegN/raven_d.mp4.tag: -------------------------------------------------------------------------------- 1 | artist=Edgar Allan Poe 2 | compatible_brands=isomiso6iso2mp41 3 | 4 | handler_name=SoundHandler 5 | language=und 6 | major_brand=isom 7 | minor_version=512 8 | title=The Raven 9 | -------------------------------------------------------------------------------- /test/tags/ffmpegN/raven_d.ogg.tag: -------------------------------------------------------------------------------- 1 | ARTIST=Edgar Allan Poe 2 | DURATION=24468753 3 | TITLE=The Raven 4 | -------------------------------------------------------------------------------- /test/tags/ffmpegN/raven_d.opus.tag: -------------------------------------------------------------------------------- 1 | ARTIST=Edgar Allan Poe 2 | DURATION=24468753 3 | TITLE=The Raven 4 | -------------------------------------------------------------------------------- /test/tags/ffmpegN/raven_d.prores.tag: -------------------------------------------------------------------------------- 1 | artist=Edgar Allan Poe 2 | compatible_brands=qt 3 | 4 | handler_name=SoundHandler 5 | major_brand=qt 6 | minor_version=512 7 | title=The Raven 8 | -------------------------------------------------------------------------------- /test/tags/ffmpegN/raven_d.ts.tag: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /test/tags/ffmpegN/raven_d.wav.tag: -------------------------------------------------------------------------------- 1 | artist=Edgar Allan Poe 2 | 3 | title=The Raven 4 | -------------------------------------------------------------------------------- /test/tags/ffmpegN/raven_d.webm.tag: -------------------------------------------------------------------------------- 1 | ARTIST=Edgar Allan Poe 2 | 3 | 4 | title=The Raven 5 | -------------------------------------------------------------------------------- /test/tags/ffmpegN/raven_e.aiff.tag: -------------------------------------------------------------------------------- 1 | title=The Raven 2 | -------------------------------------------------------------------------------- /test/tags/ffmpegN/raven_e.alac.tag: -------------------------------------------------------------------------------- 1 | artist=Edgar Allan Poe 2 | compatible_brands=M4A iso6isomiso2 3 | 4 | handler_name=SoundHandler 5 | language=und 6 | major_brand=M4A 7 | minor_version=512 8 | title=The Raven 9 | -------------------------------------------------------------------------------- /test/tags/ffmpegN/raven_e.flac.tag: -------------------------------------------------------------------------------- 1 | ARTIST=Edgar Allan Poe 2 | DURATION=29125011 3 | TITLE=The Raven 4 | -------------------------------------------------------------------------------- /test/tags/ffmpegN/raven_e.mov.tag: -------------------------------------------------------------------------------- 1 | artist=Edgar Allan Poe 2 | compatible_brands=qt 3 | 4 | handler_name=SoundHandler 5 | major_brand=qt 6 | minor_version=512 7 | title=The Raven 8 | -------------------------------------------------------------------------------- /test/tags/ffmpegN/raven_e.mp3.tag: -------------------------------------------------------------------------------- 1 | DURATION=29125011 2 | artist=Edgar Allan Poe 3 | 4 | 5 | title=The Raven 6 | -------------------------------------------------------------------------------- /test/tags/ffmpegN/raven_e.mp4.tag: -------------------------------------------------------------------------------- 1 | artist=Edgar Allan Poe 2 | compatible_brands=isomiso6iso2mp41 3 | 4 | handler_name=SoundHandler 5 | language=und 6 | major_brand=isom 7 | minor_version=512 8 | title=The Raven 9 | -------------------------------------------------------------------------------- /test/tags/ffmpegN/raven_e.ogg.tag: -------------------------------------------------------------------------------- 1 | ARTIST=Edgar Allan Poe 2 | DURATION=29125011 3 | TITLE=The Raven 4 | -------------------------------------------------------------------------------- /test/tags/ffmpegN/raven_e.opus.tag: -------------------------------------------------------------------------------- 1 | ARTIST=Edgar Allan Poe 2 | DURATION=29125011 3 | TITLE=The Raven 4 | -------------------------------------------------------------------------------- /test/tags/ffmpegN/raven_e.prores.tag: -------------------------------------------------------------------------------- 1 | artist=Edgar Allan Poe 2 | compatible_brands=qt 3 | 4 | handler_name=SoundHandler 5 | major_brand=qt 6 | minor_version=512 7 | title=The Raven 8 | -------------------------------------------------------------------------------- /test/tags/ffmpegN/raven_e.ts.tag: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /test/tags/ffmpegN/raven_e.wav.tag: -------------------------------------------------------------------------------- 1 | artist=Edgar Allan Poe 2 | 3 | title=The Raven 4 | -------------------------------------------------------------------------------- /test/tags/ffmpegN/raven_e.webm.tag: -------------------------------------------------------------------------------- 1 | ARTIST=Edgar Allan Poe 2 | 3 | title=The Raven 4 | -------------------------------------------------------------------------------- /test/tags/ffmpegN/snowboard.mov.tag: -------------------------------------------------------------------------------- 1 | album=Snowboard 2 | artist=Norbert Schlia 3 | comment=Snowboard ride footage taken with action cam 2018-01-13 Saalbach/Austria 4 | compatible_brands=qt 5 | date=2018 6 | 7 | genre=Demo 8 | handler_name=SoundHandler 9 | handler_name=VideoHandler 10 | language=eng 11 | major_brand=qt 12 | minor_version=512 13 | title=Video Transcode Demo 14 | -------------------------------------------------------------------------------- /test/tags/ffmpegN/snowboard.mp4.tag: -------------------------------------------------------------------------------- 1 | album=Snowboard 2 | artist=Norbert Schlia 3 | comment=Snowboard ride footage taken with action cam 2018-01-13 Saalbach/Austria 4 | compatible_brands=isomiso6iso2avc1mp41 5 | date=2018 6 | 7 | genre=Demo 8 | handler_name=SoundHandler 9 | handler_name=VideoHandler 10 | language=eng 11 | language=und 12 | major_brand=isom 13 | minor_version=512 14 | season_number=0 15 | title=Video Transcode Demo 16 | -------------------------------------------------------------------------------- /test/tags/ffmpegN/snowboard.prores.tag: -------------------------------------------------------------------------------- 1 | album=Snowboard 2 | artist=Norbert Schlia 3 | comment=Snowboard ride footage taken with action cam 2018-01-13 Saalbach/Austria 4 | compatible_brands=qt 5 | date=2018 6 | 7 | genre=Demo 8 | handler_name=SoundHandler 9 | handler_name=VideoHandler 10 | language=eng 11 | major_brand=qt 12 | minor_version=512 13 | title=Video Transcode Demo 14 | -------------------------------------------------------------------------------- /test/tags/ffmpegN/snowboard.ts.tag: -------------------------------------------------------------------------------- 1 | language=eng 2 | -------------------------------------------------------------------------------- /test/tags/ffmpegN/snowboard.webm.tag: -------------------------------------------------------------------------------- 1 | ALBUM=Snowboard 2 | ARTIST=Norbert Schlia 3 | COMMENT=Snowboard ride footage taken with action cam 2018-01-13 Saalbach/Austria 4 | COMPATIBLE_BRANDS=isomiso2avc1mp41 5 | DATE=2018 6 | 7 | GENRE=Demo 8 | HANDLER_NAME=SoundHandler 9 | HANDLER_NAME=VideoHandler 10 | MAJOR_BRAND=isom 11 | MINOR_VERSION=512 12 | SEASON_NUMBER=0 13 | language=eng 14 | title=Video Transcode Demo 15 | -------------------------------------------------------------------------------- /test/test_audio: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | ADDOPT="" 4 | 5 | . "${BASH_SOURCE%/*}/funcs.sh" "$1" 6 | 7 | check_audio() { 8 | if [ "$2" != "${FILEEXT}" ] 9 | then 10 | TGTFILE="$1.$2.${FILEEXT}" 11 | else 12 | TGTFILE="$1.${FILEEXT}" 13 | fi 14 | SRCFILE="$1.$2" 15 | EXPECTED="$3" 16 | 17 | printf "> TRANSCODING %s\n" ${DIRNAME}/${TGTFILE##*/} 18 | cp -vpf "${DIRNAME}/${TGTFILE}" "${TMPPATH}" > /dev/null 19 | #cp -vpf "${DIRNAME}/${TGTFILE}" "${TMPPATH}" > /dev/null 20 | 21 | CMPRESULT="$(./fpcompare "${SRCDIR}/${SRCFILE}" "${DIRNAME}/${TGTFILE}")" 22 | 23 | if [ $(echo "${CMPRESULT} <= ${EXPECTED}" | bc) -eq 1 ] 24 | then 25 | RESULT="Pass" 26 | RETURN=0 27 | else 28 | RESULT="FAIL" 29 | RETURN=1 30 | fi 31 | 32 | printf "> %s -> File: %-20s %f (expected %f)\n" ${RESULT} ${TGTFILE} ${CMPRESULT} ${EXPECTED} 33 | 34 | if [ ${RETURN} != 0 ]; 35 | then 36 | exit ${RETURN} 37 | fi 38 | } 39 | 40 | if [ "${DESTTYPE}" == "mp4" ]; 41 | then 42 | # mp4 43 | check_audio "raven_e" "flac" 0.04 44 | check_audio "raven_d" "ogg" 0.05 45 | elif [ "${DESTTYPE}" == "mp3" ]; 46 | then 47 | # mp3 48 | check_audio "raven_e" "flac" 0.04 49 | check_audio "raven_d" "ogg" 0.08 50 | elif [ "${DESTTYPE}" == "wav" ]; 51 | then 52 | # wav 53 | check_audio "raven_e" "flac" 0.0 54 | check_audio "raven_d" "ogg" 0.0 55 | elif [ "${DESTTYPE}" == "ogg" ]; 56 | then 57 | # ogg 58 | check_audio "raven_e" "flac" 0.2 59 | check_audio "raven_d" "ogg" 0.0 60 | elif [ "${DESTTYPE}" == "webm" ]; 61 | then 62 | # webm 63 | check_audio "raven_e" "flac" 0.03 64 | check_audio "raven_d" "ogg" 0.03 65 | elif [ "${DESTTYPE}" == "opus" ]; 66 | then 67 | # opus 68 | check_audio "raven_e" "flac" 0.4 69 | check_audio "raven_d" "ogg" 0.03 70 | elif [ "${DESTTYPE}" == "mov" ]; 71 | then 72 | # mov 73 | check_audio "raven_e" "flac" 0.04 74 | check_audio "raven_d" "ogg" 0.05 75 | elif [ "${DESTTYPE}" == "aiff" ]; 76 | then 77 | # aiff 78 | check_audio "raven_e" "flac" 0.0 79 | check_audio "raven_d" "ogg" 0.0 80 | elif [ "${DESTTYPE}" == "prores" ]; 81 | then 82 | # prores 83 | check_audio "raven_e" "flac" 0.0 84 | check_audio "raven_d" "ogg" 0.0 85 | elif [ "${DESTTYPE}" == "alac" ]; 86 | then 87 | # alac 88 | check_audio "raven_e" "flac" 0.0 89 | check_audio "raven_d" "ogg" 0.0 90 | elif [ "${DESTTYPE}" == "ts" ]; 91 | then 92 | # ts 93 | check_audio "raven_e" "flac" 0.039136 94 | check_audio "raven_d" "ogg" 0.050 95 | elif [ "${DESTTYPE}" == "flac" ]; 96 | then 97 | # flac 98 | check_audio "raven_e" "flac" 0.0 99 | check_audio "raven_d" "ogg" 0.0 100 | else 101 | echo "Internal error, unknown type ${DESTTYPE}. Fix script!" 102 | exit 99 103 | fi 104 | 105 | echo "OK" 106 | -------------------------------------------------------------------------------- /test/test_audio_aiff: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | __dir="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" 4 | "${__dir}/test_audio" aiff 5 | -------------------------------------------------------------------------------- /test/test_audio_alac: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | __dir="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" 4 | "${__dir}/test_audio" alac 5 | -------------------------------------------------------------------------------- /test/test_audio_flac: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | __dir="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" 4 | "${__dir}/test_audio" flac 5 | 6 | -------------------------------------------------------------------------------- /test/test_audio_mov: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | __dir="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" 4 | "${__dir}/test_audio" mov 5 | -------------------------------------------------------------------------------- /test/test_audio_mp3: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | __dir="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" 4 | "${__dir}/test_audio" mp3 5 | 6 | -------------------------------------------------------------------------------- /test/test_audio_mp4: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | __dir="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" 4 | "${__dir}/test_audio" mp4 5 | 6 | -------------------------------------------------------------------------------- /test/test_audio_ogg: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | __dir="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" 4 | "${__dir}/test_audio" ogg 5 | 6 | -------------------------------------------------------------------------------- /test/test_audio_opus: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | __dir="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" 4 | "${__dir}/test_audio" opus 5 | -------------------------------------------------------------------------------- /test/test_audio_prores: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | __dir="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" 4 | "${__dir}/test_audio" prores 5 | -------------------------------------------------------------------------------- /test/test_audio_ts: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | __dir="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" 4 | "${__dir}/test_audio" ts 5 | 6 | -------------------------------------------------------------------------------- /test/test_audio_wav: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | __dir="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" 4 | "${__dir}/test_audio" wav 5 | 6 | -------------------------------------------------------------------------------- /test/test_audio_webm: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | __dir="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" 4 | "${__dir}/test_audio" webm 5 | 6 | -------------------------------------------------------------------------------- /test/test_cuesheet: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | ADDOPT="" 4 | 5 | if [ "$2" == "file" ]; 6 | then 7 | echo "Checking external cuesheet file" 8 | TESTDIR=raven_e_cuesheet.flac.tracks 9 | elif [ "$2" == "embedded" ]; 10 | then 11 | echo "Checking embedded cuesheet" 12 | TESTDIR=raven_e.flac.tracks 13 | else 14 | echo "ERROR! Missing parameter" 15 | echo 16 | echo "Usage:" 17 | echo 18 | echo "$(basename -- "$0") DESTTYPE file Check external cue sheet file" 19 | echo "$(basename -- "$0") DESTTYPE embedded Check embedded cue sheet file" 20 | exit 1 21 | fi 22 | 23 | . "${BASH_SOURCE%/*}/funcs.sh" "$1" 99 "$2" 24 | 25 | XDIRNAME="${DIRNAME}/cuesheet/${TESTDIR}" 26 | 27 | TRACKS=10 28 | 29 | ls -1 "${XDIRNAME}" 30 | 31 | echo "Checking number of tracks is ${TRACKS}" 32 | [ $(ls "${XDIRNAME}"/*.${FILEEXT} -1 | wc -l) = ${TRACKS} ] 33 | 34 | echo "Pass" 35 | 36 | echo "OK" 37 | -------------------------------------------------------------------------------- /test/test_cuesheet_embedded: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | __dir="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" 4 | "${__dir}/test_cuesheet" flac embedded 5 | -------------------------------------------------------------------------------- /test/test_cuesheet_file: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | __dir="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" 4 | "${__dir}/test_cuesheet" flac file 5 | -------------------------------------------------------------------------------- /test/test_filecount_hls: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | ADDOPT="" 4 | 5 | . "${BASH_SOURCE%/*}/funcs.sh" "hls" 6 | 7 | XDIRNAME="${DIRNAME}"/snowboard.mp4 8 | 9 | SEGMENTS=3 10 | 11 | echo "Checking number of HLS segments is ${SEGMENTS}" 12 | [ $(ls "${XDIRNAME}"/*.ts -1 | wc -l) = ${SEGMENTS} ] 13 | 14 | echo "OK" 15 | -------------------------------------------------------------------------------- /test/test_filenames: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | ADDOPT="" 4 | 5 | . "${BASH_SOURCE%/*}/funcs.sh" "$1" 6 | 7 | # Use -w 1000 to ensure all in one line 8 | if [ "${FILEEXT}" == "mp4" ] 9 | then 10 | [ "$(ls -w 1000 -m "${DIRNAME}")" = "copyright, cuesheet, dir.flac, frame_test_pal.${FILEEXT}, raven_d.ogg.${FILEEXT}, raven_e.flac.${FILEEXT}, snowboard.${FILEEXT}" ] 11 | elif [ "${FILEEXT}" == "ogg" ] 12 | then 13 | [ "$(ls -w 1000 -m "${DIRNAME}")" = "copyright, cuesheet, dir.flac, frame_test_pal.mp4.${FILEEXT}, raven_d.${FILEEXT}, raven_e.flac.${FILEEXT}, snowboard.mp4.${FILEEXT}" ] 14 | elif [ "${FILEEXT}" == "flac" ] 15 | then 16 | [ "$(ls -w 1000 -m "${DIRNAME}")" = "copyright, cuesheet, dir.flac, frame_test_pal.mp4.${FILEEXT}, raven_d.ogg.${FILEEXT}, raven_e.${FILEEXT}, snowboard.mp4.${FILEEXT}" ] 17 | else 18 | [ "$(ls -w 1000 -m "${DIRNAME}")" = "copyright, cuesheet, dir.flac, frame_test_pal.mp4.${FILEEXT}, raven_d.ogg.${FILEEXT}, raven_e.flac.${FILEEXT}, snowboard.mp4.${FILEEXT}" ] 19 | fi 20 | 21 | echo "Pass" 22 | 23 | echo "OK" 24 | -------------------------------------------------------------------------------- /test/test_filenames_aiff: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | __dir="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" 4 | "${__dir}/test_filenames" aiff 5 | -------------------------------------------------------------------------------- /test/test_filenames_alac: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | __dir="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" 4 | "${__dir}/test_filenames" alac m4a 5 | -------------------------------------------------------------------------------- /test/test_filenames_flac: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | __dir="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" 4 | "${__dir}/test_filenames" flac 5 | 6 | -------------------------------------------------------------------------------- /test/test_filenames_hls: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | ADDOPT="" 4 | 5 | . "${BASH_SOURCE%/*}/funcs.sh" "hls" 6 | 7 | XDIRNAME="${DIRNAME}"/snowboard.mp4 8 | 9 | echo "Checking file names" 10 | [ "$(ls --ignore='*.ts' -w 1000 -m "${XDIRNAME}")" = "hls.html, index_0_av.m3u8, master.m3u8" ] 11 | 12 | echo "OK" 13 | -------------------------------------------------------------------------------- /test/test_filenames_mov: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | __dir="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" 4 | "${__dir}/test_filenames" mov 5 | -------------------------------------------------------------------------------- /test/test_filenames_mp3: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | __dir="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" 4 | "${__dir}/test_filenames" mp3 5 | 6 | -------------------------------------------------------------------------------- /test/test_filenames_mp4: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | __dir="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" 4 | "${__dir}/test_filenames" mp4 5 | 6 | -------------------------------------------------------------------------------- /test/test_filenames_ogg: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | __dir="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" 4 | "${__dir}/test_filenames" ogg 5 | 6 | -------------------------------------------------------------------------------- /test/test_filenames_opus: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | __dir="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" 4 | "${__dir}/test_filenames" opus 5 | -------------------------------------------------------------------------------- /test/test_filenames_prores: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | __dir="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" 4 | "${__dir}/test_filenames" prores mov 5 | -------------------------------------------------------------------------------- /test/test_filenames_ts: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | __dir="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" 4 | "${__dir}/test_filenames" ts 5 | 6 | -------------------------------------------------------------------------------- /test/test_filenames_wav: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | __dir="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" 4 | "${__dir}/test_filenames" wav 5 | 6 | -------------------------------------------------------------------------------- /test/test_filenames_webm: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | __dir="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" 4 | "${__dir}/test_filenames" webm 5 | 6 | -------------------------------------------------------------------------------- /test/test_filesize: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | ADDOPT="" 4 | 5 | . "${BASH_SOURCE%/*}/funcs.sh" "$1" 6 | 7 | # Ensure log contains file sizes, predicted and actual 8 | echo "TRANSCODING ${DIRNAME}/raven_e.flac.${FILEEXT}" 9 | cp -vpf "${DIRNAME}/raven_e.flac.${FILEEXT}" "${TMPPATH}" > /dev/null 10 | cp -vpf "${DIRNAME}/raven_e.flac.${FILEEXT}" "${TMPPATH}" > /dev/null 11 | 12 | echo "TRANSCODING ${DIRNAME}/raven_d.ogg.${FILEEXT}" 13 | cp -vpf "${DIRNAME}/raven_d.ogg.${FILEEXT}" "${TMPPATH}" > /dev/null 14 | cp -vpf "${DIRNAME}/raven_d.ogg.${FILEEXT}" "${TMPPATH}" > /dev/null 15 | 16 | if [ "${DESTTYPE}" == "mp4" ]; 17 | then 18 | # mp4 19 | check_filesize "raven_e.flac" 485372 494238 20 | check_filesize "raven_d.ogg" 349440 355298 21 | elif [ "${DESTTYPE}" == "mp3" ]; 22 | then 23 | # mp3 24 | check_filesize "raven_e.flac" 466980 490440 25 | check_filesize "raven_d.ogg" 342690 343527 26 | elif [ "${DESTTYPE}" == "wav" ]; 27 | then 28 | # wav 29 | check_filesize "raven_e.flac" 5137707 5137772 30 | check_filesize "raven_d.ogg" 4316344 4316536 31 | elif [ "${DESTTYPE}" == "ogg" ]; 32 | then 33 | # ogg 34 | check_filesize "raven_e.flac" 356662 489113 35 | check_filesize "raven_d" 264179 36 | elif [ "${DESTTYPE}" == "webm" ]; 37 | then 38 | # webm 39 | check_filesize "raven_e.flac" 429341 548761 40 | check_filesize "raven_d.ogg" 262842 393946 41 | elif [ "${DESTTYPE}" == "opus" ]; 42 | then 43 | # opus 44 | check_filesize "raven_e.flac" 421673 548761 45 | check_filesize "raven_d.ogg" 255740 393946 46 | elif [ "${DESTTYPE}" == "mov" ]; 47 | then 48 | # mov 49 | check_filesize "raven_e.flac" 486559 495447 50 | check_filesize "raven_d.ogg" 342690 356142 51 | elif [ "${DESTTYPE}" == "aiff" ]; 52 | then 53 | # aiff 54 | check_filesize "raven_e.flac" 5137707 5140125 55 | check_filesize "raven_d.ogg" 4316344 4316488 56 | elif [ "${DESTTYPE}" == "prores" ]; 57 | then 58 | # prores 59 | check_filesize "raven_e.flac" 5137707 5140129 60 | check_filesize "raven_d.ogg" 4316344 4318666 61 | elif [ "${DESTTYPE}" == "alac" ]; 62 | then 63 | # alac 64 | check_filesize "raven_e.flac" 3952038 3986427 65 | check_filesize "raven_d.ogg" 3276205 3320221 66 | elif [ "${DESTTYPE}" == "ts" ]; 67 | then 68 | # ts 69 | check_filesize "raven_e.flac" 489113 811408 70 | check_filesize "raven_d.ogg" 351126 545388 71 | elif [ "${DESTTYPE}" == "flac" ]; 72 | then 73 | # flac 74 | check_filesize "raven_e.flac" 3037626 3596355 75 | check_filesize "raven_d.ogg" 1132018 1132062 76 | else 77 | echo "Internal error, unknown type ${DESTTYPE}. Fix script!" 78 | exit 99 79 | fi 80 | 81 | -------------------------------------------------------------------------------- /test/test_filesize_aiff: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | __dir="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" 4 | "${__dir}/test_filesize" aiff 5 | -------------------------------------------------------------------------------- /test/test_filesize_alac: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | __dir="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" 4 | "${__dir}/test_filesize" alac 5 | -------------------------------------------------------------------------------- /test/test_filesize_flac: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | __dir="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" 4 | "${__dir}/test_filesize" flac 5 | 6 | -------------------------------------------------------------------------------- /test/test_filesize_hls: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | ADDOPT="" 4 | 5 | . "${BASH_SOURCE%/*}/funcs.sh" "hls" 6 | 7 | XDIRNAME="${DIRNAME}"/snowboard.mp4 8 | 9 | #cp -vpf "${XDIRNAME}"/*.ts "${TMPPATH}" 10 | 11 | for FILE in "${XDIRNAME}"/*.ts 12 | do 13 | printf "> TRANSCODING %s\n" ${FILE##*/} 14 | cp -vpf ${FILE} "${TMPPATH}" > /dev/null 15 | cp -vpf ${FILE} "${TMPPATH}" > /dev/null 16 | done 2>/dev/null 17 | 18 | echo "File sizes" 19 | check_filesize "000001.ts" 1478620 1566416 "${XDIRNAME}" 20 | check_filesize "000002.ts" 1513964 1570552 "${XDIRNAME}" 21 | check_filesize "000003.ts" 1193612 1278024 "${XDIRNAME}" 22 | echo "File sizes OK" 23 | 24 | echo "OK" 25 | -------------------------------------------------------------------------------- /test/test_filesize_mov: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | __dir="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" 4 | "${__dir}/test_filesize" mov 5 | -------------------------------------------------------------------------------- /test/test_filesize_mp3: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | __dir="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" 4 | "${__dir}/test_filesize" mp3 5 | 6 | -------------------------------------------------------------------------------- /test/test_filesize_mp4: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | __dir="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" 4 | "${__dir}/test_filesize" mp4 5 | 6 | -------------------------------------------------------------------------------- /test/test_filesize_ogg: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | __dir="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" 4 | "${__dir}/test_filesize" ogg 5 | 6 | -------------------------------------------------------------------------------- /test/test_filesize_opus: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | __dir="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" 4 | "${__dir}/test_filesize" opus 5 | -------------------------------------------------------------------------------- /test/test_filesize_prores: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | __dir="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" 4 | "${__dir}/test_filesize" prores 5 | -------------------------------------------------------------------------------- /test/test_filesize_ts: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | __dir="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" 4 | "${__dir}/test_filesize" ts 5 | 6 | -------------------------------------------------------------------------------- /test/test_filesize_video: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | ADDOPT="" 4 | 5 | . "${BASH_SOURCE%/*}/funcs.sh" "$1" 6 | 7 | # Ensure log contains file sizes, predicted and actual 8 | printf "> TRANSCODING %s\n" snowboard.mp4.${FILEEXT} 9 | cp -vpf "${DIRNAME}/snowboard.mp4.${FILEEXT}" "${TMPPATH}" > /dev/null 10 | #cp -vpf "${DIRNAME}/snowboard.mp4.${FILEEXT}" "${TMPPATH}" > /dev/null 11 | 12 | if [ "${DESTTYPE}" == "mp4" ]; 13 | then 14 | # mp4 15 | check_filesize "snowboard" 3827395 16 | elif [ "${DESTTYPE}" == "webm" ]; 17 | then 18 | # webm 19 | check_filesize "snowboard.mp4" 4376074 48843897 20 | elif [ "${DESTTYPE}" == "mov" ]; 21 | then 22 | # mov 23 | check_filesize "snowboard.mp4" 3843098 3912285 24 | elif [ "${DESTTYPE}" == "prores" ]; 25 | then 26 | # prores 27 | check_filesize "snowboard.mp4" 158322250 160676826 28 | elif [ "${DESTTYPE}" == "ts" ]; 29 | then 30 | # ts 31 | check_filesize "snowboard.mp4" 4192212 4324940 32 | else 33 | echo "Internal error, unknown type ${DESTTYPE}. Fix script!" 34 | exit 99 35 | fi 36 | 37 | -------------------------------------------------------------------------------- /test/test_filesize_video_mov: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | __dir="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" 4 | "${__dir}/test_filesize"_video mov 5 | -------------------------------------------------------------------------------- /test/test_filesize_video_mp4: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | __dir="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" 4 | "${__dir}/test_filesize"_video mp4 5 | -------------------------------------------------------------------------------- /test/test_filesize_video_prores: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | __dir="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" 4 | "${__dir}/test_filesize"_video prores 5 | -------------------------------------------------------------------------------- /test/test_filesize_video_ts: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | __dir="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" 4 | "${__dir}/test_filesize"_video ts 5 | 6 | -------------------------------------------------------------------------------- /test/test_filesize_video_webm: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | __dir="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" 4 | "${__dir}/test_filesize"_video webm 5 | -------------------------------------------------------------------------------- /test/test_filesize_wav: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | __dir="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" 4 | "${__dir}/test_filesize" wav 5 | 6 | -------------------------------------------------------------------------------- /test/test_filesize_webm: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | __dir="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" 4 | "${__dir}/test_filesize" webm 5 | 6 | -------------------------------------------------------------------------------- /test/test_frameset: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | ADDOPT="" 4 | 5 | . "${BASH_SOURCE%/*}/funcs.sh" "$1" 6 | 7 | check_filesize_frameset() { 8 | if [ "${FILEEXT}" == "png" ]; 9 | then 10 | check_filesize "${1}" 38625 139606 "${TMPPATH}" 1 11 | elif [ "${FILEEXT}" == "jpg" ]; 12 | then 13 | check_filesize "${1}" 26286 70679 "${TMPPATH}" 1 14 | elif [ "${FILEEXT}" == "bmp" ]; 15 | then 16 | check_filesize "${1}" 7372854 7372854 "${TMPPATH}" 1 17 | fi 18 | } 19 | 20 | # Should be 250 files for 250 frames in source 21 | FILES=250 22 | 23 | echo "Checking number of files is ${FILES}" 24 | [ $(ls "${DIRNAME}"/frame_test_pal.mp4/ -1 | wc -l) = ${FILES} ] 25 | echo "Number of files OK" 26 | 27 | echo "Checking access with full name" 28 | for i in 000204 000004 000104 000207 000007 000107 29 | do 30 | FILE="${DIRNAME}"/frame_test_pal.mp4/${i}.${FILEEXT} 31 | printf "> %s -> " ${FILE##*/} 32 | cp -vpf "${FILE}" "${TMPPATH}" > /dev/null 33 | #cp -vpf "${FILE}" "${TMPPATH}" > /dev/null 34 | check_filesize_frameset "${i}" 35 | done 36 | 37 | echo "Checking access with regular expression" 38 | for i in 00024[4-79] 00008[4-79] 00018[4-79] 39 | do 40 | echo ">> Expression ${i}.*" 41 | for FILE in "${DIRNAME}"/frame_test_pal.mp4/${i}.* 42 | do 43 | FILENAME="${FILE##*/}" 44 | printf "> %s -> " ${FILE##*/} 45 | cp -vpf "${FILE}" "${TMPPATH}" > /dev/null 46 | #cp -vpf "${FILE}" "${TMPPATH}" > /dev/null 47 | check_filesize_frameset "${FILENAME%.*}" 48 | done 2>/dev/null 49 | done 50 | echo "Access OK" 51 | 52 | echo "Pass" 53 | 54 | echo "OK" 55 | -------------------------------------------------------------------------------- /test/test_frameset_bmp: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | __dir="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" 4 | "${__dir}/test_frameset" bmp 5 | -------------------------------------------------------------------------------- /test/test_frameset_jpg: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | __dir="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" 4 | "${__dir}/test_frameset" jpg 5 | -------------------------------------------------------------------------------- /test/test_frameset_png: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | __dir="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" 4 | "${__dir}/test_frameset" png 5 | -------------------------------------------------------------------------------- /test/test_picture: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | ADDOPT="" 4 | 5 | . "${BASH_SOURCE%/*}/funcs.sh" "$1" 6 | 7 | hash_image() { 8 | python < TXXX=comment 15 | # ^TDRL -> TDRC 16 | # ^desc -> ?cmt (but keep ^description=) 17 | # 18 | get_metadata() { 19 | local -n outvar=$2 # -n makes it a nameref. 20 | echo Checking $1 21 | cp -vpf "$1" "${TMPPATH}" > /dev/null 22 | #cp -vpf "$1" "${TMPPATH}" > /dev/null 23 | outvar=`./metadata "$1" | fgrep = | sort -u | sed -r 's/^encoder=.*//I' | sed -r '/^vendor_id=.*$/Id'` 24 | } 25 | 26 | # Detect FFmpeg version 27 | # FFmpeg versions prior to 3.2.x store a title in the file and the encoder version, nothing else... 28 | FFMPEGVERSION=`./metadata -v | sed -n 's/^FFmpeg[^0-9]\([0-9]*\.[0-9]*\).*$/\1/p' | head -n 1` 29 | 30 | if [ -z "${FFMPEGVERSION}" ] && [ -z "${LIBAVVERSION}" ]; 31 | then 32 | FFMPEGVERSION=`./metadata -v | sed -n 's/^FFmpeg \(.*\)$/\1/p' | head -n 1` 33 | fi 34 | 35 | if [ ! -z "${FFMPEGVERSION}" ]; 36 | then 37 | echo "FFmpeg version is ${FFMPEGVERSION}" 38 | 39 | LIBRARY=ffmpeg 40 | if [[ "${FFMPEGVERSION}" == N* ]]; 41 | then 42 | echo "FFmpeg Nightly Build" 43 | VERSION=N 44 | elif (( $(echo "${FFMPEGVERSION} >= 4.3" | bc -l) )); then 45 | echo "FFmpeg > 4.3" 46 | VERSION=4.3 47 | elif (( $(echo "${FFMPEGVERSION} >= 4.2" | bc -l) )); then 48 | echo "FFmpeg > 4.2" 49 | VERSION=4.2 50 | elif (( $(echo "${FFMPEGVERSION} >= 4.0" | bc -l) )); then 51 | echo "FFmpeg > 4.0" 52 | VERSION=4.0 53 | fi 54 | else 55 | echo "Internal error: FFmpeg/Libav version unknown." 56 | exit 99 57 | fi 58 | 59 | if [ "${VIDEO}" == "1" ]; 60 | then 61 | FILELIST="raven_e.flac raven_d.ogg snowboard.mp4" 62 | else 63 | FILELIST="raven_e.flac raven_d.ogg" 64 | fi 65 | 66 | for FILE in ${FILELIST} 67 | do 68 | TAGFILENAME=${FILE%.*}.${DESTTYPE}.tag 69 | TAGFILEPATH=${__dir}/tags/${LIBRARY}${VERSION}/${TAGFILENAME} 70 | TAGFILEPATH=${__dir}/tags/${LIBRARY}${VERSION}/${TAGFILENAME} 71 | get_metadata "${DIRNAME}/${FILE}.${FILEEXT}" TAGS 72 | echo "${TAGS}" > "${TAGFILENAME}" 73 | echo "Compare file: ${TAGFILEPATH}" 74 | echo "Tags found:" 75 | echo "${TAGS}" 76 | cmp -c "${TAGFILEPATH}" "${TAGFILENAME}" 77 | printf "*** PASS ***\n\n" 78 | rm -f "${TAGFILENAME}" 79 | done 80 | 81 | echo "OK" 82 | -------------------------------------------------------------------------------- /test/test_tags_aiff: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | __dir="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" 4 | "${__dir}/test_tags" aiff 5 | -------------------------------------------------------------------------------- /test/test_tags_alac: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | __dir="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" 4 | "${__dir}/test_tags" alac 5 | -------------------------------------------------------------------------------- /test/test_tags_flac: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | __dir="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" 4 | "${__dir}/test_tags" flac 5 | 6 | -------------------------------------------------------------------------------- /test/test_tags_mov: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | __dir="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" 4 | "${__dir}/test_tags" mov 1 5 | -------------------------------------------------------------------------------- /test/test_tags_mp3: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | __dir="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" 4 | "${__dir}/test_tags" mp3 5 | 6 | -------------------------------------------------------------------------------- /test/test_tags_mp4: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | __dir="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" 4 | "${__dir}/test_tags" mp4 1 5 | -------------------------------------------------------------------------------- /test/test_tags_ogg: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | __dir="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" 4 | "${__dir}/test_tags" ogg 5 | 6 | -------------------------------------------------------------------------------- /test/test_tags_opus: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | __dir="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" 4 | "${__dir}/test_tags" opus 5 | -------------------------------------------------------------------------------- /test/test_tags_prores: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | __dir="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" 4 | "${__dir}/test_tags" prores 1 5 | -------------------------------------------------------------------------------- /test/test_tags_ts: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | __dir="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" 4 | "${__dir}/test_tags" ts 1 5 | 6 | -------------------------------------------------------------------------------- /test/test_tags_wav: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | __dir="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" 4 | "${__dir}/test_tags" wav 5 | 6 | -------------------------------------------------------------------------------- /test/test_tags_webm: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | __dir="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" 4 | "${__dir}/test_tags" webm 1 5 | 6 | -------------------------------------------------------------------------------- /test/test_video_hw: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | if [ "$1" == "ENC" ] 4 | then 5 | ADDOPT="--hwaccel_enc=$2" 6 | elif [ "$1" == "DEC" ] 7 | then 8 | ADDOPT="--hwaccel_dec=$2" 9 | else 10 | echo "Parameter missing" 11 | echo 12 | echo "Usage: $0 ENC api" 13 | echo "Usage: $0 DEC api" 14 | echo 15 | echo "Example: $0 ENC VAAPI" 16 | exit 1 17 | fi 18 | 19 | . "${BASH_SOURCE%/*}/funcs.sh" ts 77 "${1,,}_$2" 20 | 21 | cp -vpf "${DIRNAME}/snowboard.mp4.${FILEEXT}" "${TMPPATH}" || exit 77 # Make test suite report "SKIP" 22 | -------------------------------------------------------------------------------- /test/test_video_hw_dec_cuda: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | __dir="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" 4 | "${__dir}/test_video_hw" DEC cuda 5 | -------------------------------------------------------------------------------- /test/test_video_hw_dec_mmal: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | __dir="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" 4 | "${__dir}/test_video_hw" DEC mmal 5 | -------------------------------------------------------------------------------- /test/test_video_hw_dec_v4l2m2m: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | __dir="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" 4 | "${__dir}/test_video_hw" DEC v4l2m2m 5 | -------------------------------------------------------------------------------- /test/test_video_hw_dec_vaapi: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | __dir="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" 4 | "${__dir}/test_video_hw" DEC vaapi 5 | -------------------------------------------------------------------------------- /test/test_video_hw_enc_cuda: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | __dir="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" 4 | "${__dir}/test_video_hw" ENC cuda 5 | -------------------------------------------------------------------------------- /test/test_video_hw_enc_omx: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | __dir="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" 4 | "${__dir}/test_video_hw" ENC omx 5 | -------------------------------------------------------------------------------- /test/test_video_hw_enc_v4l2m2m: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | __dir="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" 4 | "${__dir}/test_video_hw" ENC v4l2m2m 5 | -------------------------------------------------------------------------------- /test/test_video_hw_enc_vaapi: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | __dir="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" 4 | "${__dir}/test_video_hw" ENC vaapi 5 | --------------------------------------------------------------------------------