合并后的Mp4里解析出音頻的Duration問題
網上有很多的流視頻,可以獲取到批量的ts文件后,使用ffmpeg用concat的格式用copy編碼方式進行合并為Mp4文件。
這里有個問題就碰到我了,
將mp4文件用copy編碼的方式,分離出aac音頻文件。
問題是:mp4文件,和aac文件,用ffprobe顯示的duration咋就不一樣了呢?
MP4,時長顯示34分57秒
AAC文件,時長顯示14小時28分,不過它說了,這個是從bitrate估算的,不準確。我可以負責任的說,這個duration就是錯誤的。
bitrate也變了,我感覺這個不多。
播放這個aac文件時,從播放器里看,時長也是14個小時。
那么,我們怎么看它的正確時長呢?先看下官方文檔
From ffmpeg documention:
Get duration by decoding
You can also use?ffmpeg?to get the duration by fully decoding the file. The null muxer is used so no output file is created. Refer to?time=?in the last line of the console output. In this example the input has a duration of 00:57:28.87.
$ ffmpeg -i input.webm -f null - ... frame=206723 fps=1390 q=-0.0 Lsize=N/A time=00:57:28.87 bitrate=N/A speed=23.2x
This method will report the correct duration in case the methods using ffprobe are incorrect or missing due to corrupt, truncated, or damaged files.
The command may take some time depending on the input file duration and decoding complexity.
我們用這個命令試一下:34分52秒,比較正確了。
加上-c copy會更快得到結果,結果也很接近準確值。
AAC只是猜測,他不包含準確的duration信息。這個問題呢,可以感到疑惑,但是到此為止可以不再糾結,
轉換為m4a就好啦!duration準準的!
版權聲明:本文內容由網絡用戶投稿,版權歸原作者所有,本站不擁有其著作權,亦不承擔相應法律責任。如果您發現本站中有涉嫌抄襲或描述失實的內容,請聯系我們jiasou666@gmail.com 處理,核實后本網站將在24小時內刪除侵權內容。
版權聲明:本文內容由網絡用戶投稿,版權歸原作者所有,本站不擁有其著作權,亦不承擔相應法律責任。如果您發現本站中有涉嫌抄襲或描述失實的內容,請聯系我們jiasou666@gmail.com 處理,核實后本網站將在24小時內刪除侵權內容。