is it possible to read mp3 id3 tags in php using ffmpeg? if so then how? -
hi have few mp3 files in server change , need mp3 id3 tags people know song being played @ moment preferably via php . complete noob @ helpful.
while there several possibilities, fan of using pipes. ffprobe should included in ffmpeg.
<?php $output = shell_exec("ffprobe -print_format json -show_entries stream=codec_name:format -select_streams a:0 -v quiet test.mp3"); echo "<pre>$output</pre>"; ?> output:
      {         "programs": [          ],         "streams": [             {                 "codec_name": "mp3"             }         ],         "format": {             "filename": "test.mp3",             "nb_streams": 1,             "nb_programs": 0,             "format_name": "mp3",             "format_long_name": "mp2/3 (mpeg audio layer 2/3)",             "start_time": "0.000000",             "duration": "303.755813",             "size": "9721021",             "bit_rate": "256021",             "probe_score": 51,             "tags": {                 "title": "pictures of home",                 "artist": "deep purple",                 "album": "machine head",                 "date": "1972",                 "track": "3",                 "genre": "rock"             }         }     }    use json_decode convert assoicative array.
Comments
Post a Comment