View Issue Details
|ID||Project||Category||View Status||Date Submitted||Last Update|
|0004519||The Dark Mod||Coding||public||02.05.2017 19:15||23.06.2018 10:58|
|Target Version||TDM 2.06||Fixed in Version||TDM 2.06|
|Summary||0004519: Investigate using videos of common formats (avi, mp4)|
|Description||After x64 branch was merged, currently FFmpeg decodes all the videos. Only ROQ format is really used now, but nothing stops us from supporting other codecs and containers.|
The purpose of this issue is to check how TDM plays common video formats now, and do any related improvements.
It is also a good question if it is possible to play sound directly from the video file, but it can be moved to other issue.
|Additional Information||Related discussion on forum:|
|Tags||No tags attached.|
|related to||0004518||resolved||stgatilov||Briefing video starts decoding in background|
|related to||0004534||resolved||stgatilov||Playing sound stream from video file|
|related to||0004535||resolved||stgatilov||Showing video for its full duration|
|related to||0004847||resolved||stgatilov||Support FFmpeg videos in testVideo command|
In commit 6899 fixed severe stuttering on AVI with XVID content.
Before, raw PTS value from packet was used to calculate timestamp.
Unfortunately, it is not set in some common cases, that's why everyone uses function av_frame_get_best_effort_timestamp to get effective timestamp. Now we use it too =)
I have checked following combinations on a 720 x 400 video:
AVI + XVID
MP4v2 + XVID
MP4 + x264
AVI + MPEG2
AVI + x265 - FAIL (no codec)
All of them play well, except for the last one. It is simply not supported by FFmpeg yet.
|New issues are created for playing sound stream and using natural duration of video (see related).|
I changed the ffmpeg use from static link to dll (win32 only) because it adds too much to exe size. We may want to revisit this later.
It turns out that matroska (mkv) is not a good format for current player implementation.
In a sample video I see, each sound packet contains 2048 samples, which corresponds to about 46.44 ms of time. However, all the packets in mkv has timestamps with millisecond precision - that's the limitation of format specification. That's why some sound packets have 46 ms duration, and some have 47 ms duration. Although timestamps and durations cover the whole timeline properly, they do not correctly reflect the real amount of samples encoded in them. As a result, current player has to drop or insert about 10-20 samples before each packets (jitter), which produces noticeable sound artifacts (cracks).
I think it is much easier to limit support to MP4 container than trying to support every possible issue which might happen in one format or another...
It turned out that even MP4 format sometimes starts dropping/inserting one sample regularly. This is not noticeable for voice, but test sound sample makes it clearly noticeable.
So, I have made sound decoding resistant to timestamps jitter (up to 10 ms) in svn rev 6937. This makes it possible to play MKV files normally.
However, I still think we should advise everyone using MP4.
|02.05.2017 19:15||stgatilov||New Issue|
|02.05.2017 19:18||stgatilov||Additional Information Updated||View Revisions|
|15.05.2017 11:13||stgatilov||Assigned To||=> stgatilov|
|15.05.2017 11:13||stgatilov||Status||new => assigned|
|16.05.2017 05:33||stgatilov||Relationship added||related to 0004518|
|16.05.2017 17:18||stgatilov||Note Added: 0008864|
|17.05.2017 04:14||stgatilov||Note Added: 0008866|
|17.05.2017 04:23||stgatilov||Relationship added||related to 0004534|
|17.05.2017 04:25||stgatilov||Relationship added||related to 0004535|
|17.05.2017 04:27||stgatilov||Note Added: 0008868|
|17.05.2017 04:27||stgatilov||Status||assigned => resolved|
|17.05.2017 04:27||stgatilov||Fixed in Version||=> TDM 2.06|
|17.05.2017 04:27||stgatilov||Resolution||open => fixed|
|17.05.2017 04:27||stgatilov||Target Version||=> TDM 2.06|
|02.06.2017 19:48||duzenko||Note Added: 0008881|
|02.06.2017 19:49||duzenko||Note Edited: 0008881||View Revisions|
|13.06.2017 02:25||stgatilov||Note Added: 0008904|
|14.06.2017 02:59||stgatilov||Note Added: 0008912|
|23.06.2018 10:58||stgatilov||Relationship added||related to 0004847|