Jump to content
FunTimeBliss ::
Sign in to follow this  
Pic0o

add Audio Chapters for podcasts

Recommended Posts

Total stub thread.  Been working on adding chapter content to some files.

https://ffmpeg.org/ffmpeg-formats.html#Metadata-1
 

ffmpeg -i INPUT -i FFMETADATAFILE -map_metadata 1 -codec copy OUTPUT

https://medium.com/@dathanbennett/adding-chapters-to-an-mp4-file-using-ffmpeg-5e43df269687

Testing:  MP3 will work but VLC will not inherently show you the chapters.  If you encode to mp4, it will.
Other Audio Players do show chapters for an MP3 just fine though.


ffmpeg -i 049_Hacks4Pancakes.mp3 -i metadata -map_metadata 1 -codec copy 049_Hacks4Pancakes00.mp3



note that the metadata before -map_metadata is my filename with the [Chapters] content.



;FFMETADATA1
title=049_Hacks4Pancakes-ThugCrowd

[CHAPTER]
TIMEBASE=1/1000
START=0
#chapter ends at 00:30
# interview at 1:18:10
END=30000
title=introGreets

[CHAPTER]
TIMEBASE=1/1000
START=30000
#chapter ends at 00:69
END=360000
title=Sample_Until-6Min

[CHAPTER]
TIMEBASE=1/1000
START=4680000
#chapter ends at eof
END=7740000
title=Interview: Hacks4Pancakes

#math up hours in nanoseconds

 

[STREAM]
title=049_Hacks4Pancakes-ThugCrowd


The math is a little silly, but each minute is represented by 60000.  I used a spreadsheet in my case to come up with numbers.

Edited by Pic0o
Testarino

Share this post


Link to post
ffmpeg -fflags +genpts -i 049_Hacks4Pancakes.avi -i metadata -map_metadata 0 -codec copy 049_Hacks4Pancakes_01.mp4

 


The revised sample resolves the 'Timestamps are unset in a packet for stream 0. This is deprecated and will stop working in the future. Fix your code to set the timestamps properly' you are likely to see when adding the Subtitle files.

Let us talk about extensions.  Video is most compliant with chapters if you output to .mp4
To audio, mp3 will show chapters in some but not all players. .m4a / mp4 output is consistent with chapter recognition and playback to timings for chapter. My testing output to avi, was outright no chapter functionality in tests.

Thank this old ticket

Share this post


Link to post
Sign in to follow this  
×
×
  • Create New...