[PR #655] [MERGED] Ability to extract Chapters from MP4 files. #1499

Open
opened 2026-01-29 17:16:47 +00:00 by claunia · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/CCExtractor/ccextractor/pull/655
Author: @saurabhshri
Created: 1/20/2017
Status: Merged
Merged: 1/20/2017
Merged by: @cfsmp3

Base: masterHead: patch-1


📝 Commits (6)

  • 0e4d211 Extract chapter instead of subtitles if extract_chapters is True.
  • c9a3a0c Extract chapters from mp4 file and write it in a file.
  • db8d9c6 By default don't extract chapters.
  • d1b1271 Option for chapter extraction.
  • d941478 Function prototype for chapter extraction.
  • 77da2dc Added -chapters paramater for chapter extaraction from MP$.

📊 Changes

6 files changed (+128 additions, -13 deletions)

View changed files

📝 src/ccextractor.c (+8 -1)
📝 src/gpacmp4/mp4.c (+102 -12)
📝 src/lib_ccx/ccx_common_option.c (+1 -0)
📝 src/lib_ccx/ccx_common_option.h (+1 -0)
📝 src/lib_ccx/ccx_mp4.h (+1 -0)
📝 src/lib_ccx/params.c (+15 -0)

📄 Description

Various files such as MP4 may have chapter markers in them. They are also present in the audio books we purchase, for example, from Amazon. , CCExtractor should now be able to extract Chapter Markers too. 🙂

Usage is simple. To extract chapter markers from a MP4 video file :

 ./ccextractor -chapters file.mp4

It will create file.txt with Chapter Markers in OGG format.

Example :


Opening file: chapters.mp4
Detected MP4 box with name: ftyp
Detected MP4 box with name: moov
File seems to be a MP4
Analyzing data with GPAC (MP4 library)
opening 'chapters.mp4': ok
Writing chapters into chapters.txt
Done, processing time = 0 seconds
Issues? Open a ticket here
https://github.com/CCExtractor/ccextractor/issues
saurabhshri@gsocdev3:~/gpac/bin/gcc/ccextractor/linux$ ls
build       build_hardsubx   ccextractor  chapter.mp4.txt  chapters.mp4.txt  description-pak  mekong.srt  pre-build.sh
saurabhshri@gsocdev3:~/gpac/bin/gcc/ccextractor/linux$ cat chapters.txt
CHAPTER01=00:00:00.000
CHAPTER01NAME=test1
CHAPTER02=00:01:30.000
CHAPTER02NAME=test2
CHAPTER03=00:03:00.000
CHAPTER03NAME=test3
CHAPTER04=00:04:30.000
CHAPTER04NAME=test4

Note : If -chapters is used with any other files than MP4, CCExtractor will simply extract subtitles from them.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/CCExtractor/ccextractor/pull/655 **Author:** [@saurabhshri](https://github.com/saurabhshri) **Created:** 1/20/2017 **Status:** ✅ Merged **Merged:** 1/20/2017 **Merged by:** [@cfsmp3](https://github.com/cfsmp3) **Base:** `master` ← **Head:** `patch-1` --- ### 📝 Commits (6) - [`0e4d211`](https://github.com/CCExtractor/ccextractor/commit/0e4d211eaf9765cf37c81a7e4e87596857cd0f3b) Extract chapter instead of subtitles if extract_chapters is True. - [`c9a3a0c`](https://github.com/CCExtractor/ccextractor/commit/c9a3a0c7f21b659494048f87185d6f5cc39d4e39) Extract chapters from mp4 file and write it in a file. - [`db8d9c6`](https://github.com/CCExtractor/ccextractor/commit/db8d9c67b663a873479df501583a141cb2b15532) By default don't extract chapters. - [`d1b1271`](https://github.com/CCExtractor/ccextractor/commit/d1b127164e5ea15dd8a5df71e489858feb063ee1) Option for chapter extraction. - [`d941478`](https://github.com/CCExtractor/ccextractor/commit/d9414782b2c75c444d746241647700a050f96d0b) Function prototype for chapter extraction. - [`77da2dc`](https://github.com/CCExtractor/ccextractor/commit/77da2dc873cc25dbf606a3b04172aa9fb1370f32) Added -chapters paramater for chapter extaraction from MP$. ### 📊 Changes **6 files changed** (+128 additions, -13 deletions) <details> <summary>View changed files</summary> 📝 `src/ccextractor.c` (+8 -1) 📝 `src/gpacmp4/mp4.c` (+102 -12) 📝 `src/lib_ccx/ccx_common_option.c` (+1 -0) 📝 `src/lib_ccx/ccx_common_option.h` (+1 -0) 📝 `src/lib_ccx/ccx_mp4.h` (+1 -0) 📝 `src/lib_ccx/params.c` (+15 -0) </details> ### 📄 Description Various files such as MP4 may have *chapter markers* in them. They are also present in the audio books we purchase, for example, from Amazon. , CCExtractor should now be able to extract Chapter Markers too. 🙂 Usage is simple. To extract chapter markers from a MP4 video file : ``` ./ccextractor -chapters file.mp4 ``` It will create file.txt with Chapter Markers in OGG format. Example : ``` Opening file: chapters.mp4 Detected MP4 box with name: ftyp Detected MP4 box with name: moov File seems to be a MP4 Analyzing data with GPAC (MP4 library) opening 'chapters.mp4': ok Writing chapters into chapters.txt Done, processing time = 0 seconds Issues? Open a ticket here https://github.com/CCExtractor/ccextractor/issues saurabhshri@gsocdev3:~/gpac/bin/gcc/ccextractor/linux$ ls build build_hardsubx ccextractor chapter.mp4.txt chapters.mp4.txt description-pak mekong.srt pre-build.sh saurabhshri@gsocdev3:~/gpac/bin/gcc/ccextractor/linux$ cat chapters.txt CHAPTER01=00:00:00.000 CHAPTER01NAME=test1 CHAPTER02=00:01:30.000 CHAPTER02NAME=test2 CHAPTER03=00:03:00.000 CHAPTER03NAME=test3 CHAPTER04=00:04:30.000 CHAPTER04NAME=test4 ``` Note : If -chapters is used with any other files than MP4, CCExtractor will simply extract subtitles from them. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
claunia added the pull-request label 2026-01-29 17:16:47 +00:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/ccextractor#1499