Opened 10 years ago

Closed 10 years ago

Last modified 10 years ago

#3031 closed defect (fixed)

Creating xsubtitles (xsub) results in color bit depth of 24 bits instead of the DIVX certified standard of 4 bits

Reported by: userid99 Owned by:
Priority: normal Component: avcodec
Version: git-master Keywords: xsub
Cc: Erik Olofsson Blocked By:
Blocking: Reproduced by developer: no
Analyzed by developer: no

Description

Summary of the bug:

creating xsubtitles (xsub) results in color bit depth of 24 bits instead of the DIVX certified standard of 4 bits.

Color depth 24 bits is not compatible with DIVX certified hardware players. Fonts are unreadable (blurred) on hardware player Philips DVP640.

How to reproduce:

ffmpeg -i video.divx -i subtitle.idx -vcodec copy -acodec copy -scodec xsub -r 29.97 muxxsub.avi

Report:

ffmpeg started on 2013-10-05 at 20:42:29
Report written to "ffmpeg-20131005-204229.log"
Command line:
ffmpeg -i video.divx -i subtitle.idx -vcodec copy -acodec copy -scodec xsub -r 29.97 -report muxxsub.avi
ffmpeg version N-56827-g64327aa Copyright (c) 2000-2013 the FFmpeg developers

built on Oct 2 2013 18:02:02 with gcc 4.8.1 (GCC)
configuration: --enable-gpl --enable-version3 --disable-w32threads --enable-avisynth --enable-bzlib --enable-fontconfig --enable-frei0r --enable-gnutls --enable-iconv --enable-libass --enable-libbluray --enable-libcaca --enable-libfreetype --enable-libgsm --enable-libilbc --enable-libmodplug --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-libopus --enable-librtmp --enable-libschroedinger --enable-libsoxr --enable-libspeex --enable-libtheora --enable-libtwolame --enable-libvidstab --enable-libvo-aacenc --enable-libvo-amrwbenc --enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libx264 --enable-libxavs --enable-libxvid --enable-zlib
libavutil 52. 46.100 / 52. 46.100
libavcodec 55. 33.101 / 55. 33.101
libavformat 55. 19.100 / 55. 19.100
libavdevice 55. 3.100 / 55. 3.100
libavfilter 3. 88.100 / 3. 88.100
libswscale 2. 5.100 / 2. 5.100
libswresample 0. 17.103 / 0. 17.103
libpostproc 52. 3.100 / 52. 3.100

Splitting the commandline.
Reading option '-i' ... matched as input file with argument 'video.divx'.
Reading option '-i' ... matched as input file with argument 'subtitle.idx'.
Reading option '-vcodec' ... matched as option 'vcodec' (force video codec ('copy' to copy stream)) with argument 'copy'.
Reading option '-acodec' ... matched as option 'acodec' (force audio codec ('copy' to copy stream)) with argument 'copy'.
Reading option '-scodec' ... matched as option 'scodec' (force subtitle codec ('copy' to copy stream)) with argument 'xsub'.
Reading option '-r' ... matched as option 'r' (set frame rate (Hz value, fraction or abbreviation)) with argument '29.97'.
Reading option '-report' ... matched as option 'report' (generate a report) with argument '1'.
Reading option 'muxxsub.avi' ... matched as output file.
Finished splitting the commandline.
Parsing a group of options: global .
Applying option report (generate a report) with argument 1.
Successfully parsed a group of options.
Parsing a group of options: input file video.divx.
Successfully parsed a group of options.
Opening an input file: video.divx.
[avi @ 028b8b20] Format avi probed with size=2048 and score=100
[avi @ 028b9600] use odml:1
[avi @ 028b8b20] File position before avformat_find_stream_info() is 2060
[avi @ 028b8b20] All info found
rfps: 29.666667 0.013650
rfps: 29.666667 0.013650
rfps: 29.750000 0.007180
rfps: 29.750000 0.007180
rfps: 29.833333 0.002771
rfps: 29.833333 0.002771
rfps: 29.916667 0.000422
rfps: 29.916667 0.000422
rfps: 30.000000 0.000134
rfps: 30.000000 0.000134
rfps: 30.083333 0.001906
rfps: 30.083333 0.001906
rfps: 30.166667 0.005738
rfps: 30.166667 0.005738
rfps: 30.250000 0.011631
rfps: 30.250000 0.011631
rfps: 30.333333 0.019584
rfps: 30.333333 0.019584
rfps: 59.583333 0.018872
rfps: 59.583333 0.018872
rfps: 59.666667 0.011084
rfps: 59.666667 0.011084
rfps: 59.750000 0.005356
rfps: 59.750000 0.005356
rfps: 59.833333 0.001688
rfps: 59.833333 0.001688
rfps: 59.916667 0.000081
rfps: 59.916667 0.000081
rfps: 60.000000 0.000534
rfps: 60.000000 0.000534
rfps: 29.970030 0.000000
rfps: 29.970030 0.000000
rfps: 59.940060 0.000000
rfps: 59.940060 0.000000
[avi @ 028b8b20] File position after avformat_find_stream_info() is 156913
Input #0, avi, from 'video.divx':

Duration: 00:00:19.99, start: 0.000000, bitrate: 1008 kb/s

Stream #0:0, 41, 100/2997: Video: mpeg4 (DX50 / 0x30355844), yuv420p, 640x480 [SAR 1:1 DAR 4:3], 29.97 fps, 29.97 tbr, 29.97 tbn, 30k tbc
Metadata:

title : Video

Stream #0:1, 78, 3/125: Audio: mp3 (U[0][0][0] / 0x0055), 48000 Hz, stereo, s16p, 128 kb/s
Metadata:

title : Audio

Successfully opened the file.
Parsing a group of options: input file subtitle.idx.
Successfully parsed a group of options.
Opening an input file: subtitle.idx.
[vobsub @ 028b7740] Format vobsub probed with size=2048 and score=100
[vobsub @ 028b7740] IDX/SUB: subtitle.idx -> subtitle.sub
[vobsub @ 028b7740] IDX stream[0] id=en
[vobsub @ 028b7740] File position before avformat_find_stream_info() is 2052
[dvdsub @ 028b9e80] palette: 0x000000 0xefefef 0xcbcbcb 0x989898 0x3135eb 0x0f10bb 0xe93831 0xba3013 0x32ed32 0x10b910 0xf7f831 0xbbba11 0xee31ef 0xb910b9 0x2dc4f4 0x13bcbb
[vobsub @ 028b7740] All info found
[vobsub @ 028b7740] File position after avformat_find_stream_info() is 2052
Input #1, vobsub, from 'subtitle.idx':

Duration: N/A, bitrate: N/A

Stream #1:0[0x0](en), 0, 1/1000: Subtitle: dvd_subtitle, 720x480 (default)

Successfully opened the file.
Parsing a group of options: output file muxxsub.avi.
Applying option vcodec (force video codec ('copy' to copy stream)) with argument copy.
Applying option acodec (force audio codec ('copy' to copy stream)) with argument copy.
Applying option scodec (force subtitle codec ('copy' to copy stream)) with argument xsub.
Applying option r (set frame rate (Hz value, fraction or abbreviation)) with argument 29.97.
Successfully parsed a group of options.
Opening an output file: muxxsub.avi.
Successfully opened the file.
[dvdsub @ 028b9e80] palette: 0x000000 0xefefef 0xcbcbcb 0x989898 0x3135eb 0x0f10bb 0xe93831 0xba3013 0x32ed32 0x10b910 0xf7f831 0xbbba11 0xee31ef 0xb910b9 0x2dc4f4 0x13bcbb
Output #0, avi, to 'muxxsub.avi':

Metadata:

ISFT : Lavf55.19.100
Stream #0:0, 0, 100/2997: Video: mpeg4 (DX50 / 0x30355844), yuv420p, 640x480 [SAR 1:1 DAR 4:3], q=2-31, 29.97 fps, 29.97 tbn, 29.97 tbc
Metadata:

title : Video

Stream #0:1, 0, 3/125: Audio: mp3 (U[0][0][0] / 0x0055), 48000 Hz, stereo, 128 kb/s
Metadata:

title : Audio

Stream #0:2(en), 0, 1/1000: Subtitle: xsub (DXSB / 0x42535844), 720x480 (default)

Stream mapping:

Stream #0:0 -> #0:0 (copy)
Stream #0:1 -> #0:1 (copy)
Stream #1:0 -> #0:2 (dvdsub -> xsub)

Press [q] to stop, ? for help
No more output streams to write to, finishing.
frame= 599 fps=0.0 q=-1.0 Lsize= 2476kB time=00:00:19.99 bitrate=1014.5kbits/s

video:2113kB audio:312kB subtitle:2 global headers:0kB muxing overhead 1.975429%
5 frames successfully decoded, 0 decoding errors
[AVIOContext @ 029dde40] Statistics: 11 seeks, 1446 writeouts
[AVIOContext @ 028b5740] Statistics: 2695256 bytes read, 7 seeks
[AVIOContext @ 028b9a80] Statistics: 10240 bytes read, 0 seeks
[AVIOContext @ 028b7ce0] Statistics: 2052 bytes read, 0 seeks

Attachments (11)

ffmpeg-20131005-210932.log (7.1 KB ) - added by userid99 10 years ago.
Log file with -v 9 -loglevel 99
video.avi (102.0 KB ) - added by userid99 10 years ago.
Video.divx file input
subtitle.idx (2.1 KB ) - added by userid99 10 years ago.
Vobsub index
subtitle.sub (12.0 KB ) - added by userid99 10 years ago.
Input Vobsub
muxxsub.avi (107.3 KB ) - added by userid99 10 years ago.
FFmpeg Output
ffmpeg_report.log (6.8 KB ) - added by userid99 10 years ago.
log file with command: ffmpeg -v 9 -loglevel 99 -report -i "H:\Divx\test\Subtitle\aegisub\Default\video.avi" -i "H:\Divx\test\Subtitl e\aegisub\defect\subtitle.idx" -vcodec copy -acodec copy -scodec xsub "H:\Divx\ test\Subtitle\aegisub\defect\muxxsub.avi"
patched.avi (107.3 KB ) - added by Erik Olofsson 10 years ago.
muxpatch.avi (107.3 KB ) - added by userid99 10 years ago.
Both file "patched.avi and attached does not play (black screen) on Philips DVP640
ffmpeg-20131117-212305.log (7.0 KB ) - added by userid99 10 years ago.
log file for "muxpatch.avi"
ffmpeg-20131123-181713.log (4.9 KB ) - added by userid99 10 years ago.
Log file for: ffmpeg -v 9 -loglevel 99 -report -i video.avi -vc odec copy -acodec copy remuxed.avi
remuxed.avi (99.6 KB ) - added by userid99 10 years ago.
Output file for: ffmpeg -i video.avi -vc odec copy -acodec copy remuxed.avi

Download all attachments as: .zip

Change History (23)

by userid99, 10 years ago

Attachment: ffmpeg-20131005-210932.log added

Log file with -v 9 -loglevel 99

comment:1 by Carl Eugen Hoyos, 10 years ago

Component: FFmpegundetermined
Priority: criticalnormal

comment:2 by Carl Eugen Hoyos, 10 years ago

Version: unspecifiedgit-master

Please provide the input subtitle file.

by userid99, 10 years ago

Attachment: video.avi added

Video.divx file input

by userid99, 10 years ago

Attachment: subtitle.idx added

Vobsub index

by userid99, 10 years ago

Attachment: subtitle.sub added

Input Vobsub

by userid99, 10 years ago

Attachment: muxxsub.avi added

FFmpeg Output

in reply to:  2 comment:3 by userid99, 10 years ago

Replying to cehoyos:

Please provide the input subtitle file.

These files are simplified versions of my first test.

Please notice the xsubs in the output file are not 4 bit color depth as per divx standards, and have a resolution larger than the output video (divx resolution standard is 640x480).

by userid99, 10 years ago

Attachment: ffmpeg_report.log added

log file with command: ffmpeg -v 9 -loglevel 99 -report -i "H:\Divx\test\Subtitle\aegisub\Default\video.avi" -i "H:\Divx\test\Subtitl e\aegisub\defect\subtitle.idx" -vcodec copy -acodec copy -scodec xsub "H:\Divx\ test\Subtitle\aegisub\defect\muxxsub.avi"

by Erik Olofsson, 10 years ago

Attachment: patched.avi added

comment:4 by Erik Olofsson, 10 years ago

I have a fix for this in my local tree.
The patched.avi is verified to work on two different models of Philips DVD players.

@userid99
Could you test the patched.avi in your player?

in reply to:  4 comment:5 by Carl Eugen Hoyos, 10 years ago

Analyzed by developer: unset
Cc: Erik Olofsson added
Reproduced by developer: unset

Replying to ErikAxelJoel:

I have a fix for this in my local tree.

Please either attach the patch here or - even better - send it to the ffmpeg-devel mailing list.

comment:6 by Erik Olofsson, 10 years ago

I have a fix for this in my local tree.

Please either attach the patch here or - even better - send it to the ffmpeg-deve

Patches sent to ffmpeg-devel mailing list with subject "Improved XSUB compatibility".

comment:7 by Carl Eugen Hoyos, 10 years ago

Component: undeterminedavcodec
Resolution: fixed
Status: newclosed

Fixed by Erik Olofsson in 3b1dcdec - thank you for the report!

by userid99, 10 years ago

Attachment: muxpatch.avi added

Both file "patched.avi and attached does not play (black screen) on Philips DVP640

by userid99, 10 years ago

Attachment: ffmpeg-20131117-212305.log added

log file for "muxpatch.avi"

comment:8 by userid99, 10 years ago

Resolution: fixed
Status: closedreopened

Mediainfo does now show color bit depth as 4 bit :)

Would like to reopen, to determine\fix why ffmpeg xsub's will not play on hardware player Philips DVP640.

in reply to:  8 comment:9 by Carl Eugen Hoyos, 10 years ago

Replying to userid99:

Would like to reopen, to determine\fix why ffmpeg xsub's will not play on hardware player Philips DVP640.

Does the output file of this command play on the hardware player?

$ ffmpeg -i video.avi -vcodec copy -acodec copy remuxed.avi

by userid99, 10 years ago

Attachment: ffmpeg-20131123-181713.log added

Log file for: ffmpeg -v 9 -loglevel 99 -report -i video.avi -vc odec copy -acodec copy remuxed.avi

by userid99, 10 years ago

Attachment: remuxed.avi added

Output file for: ffmpeg -i video.avi -vc odec copy -acodec copy remuxed.avi

comment:10 by userid99, 10 years ago

Good question!

Here are my test observations (files attached) with Philips DVP640:

Original file: "video.avi" (103kb) when played results in blue screen :)

Output file: "remuxed.avi" (100kb) when played results in black screen (no picture) :(

Last edited 10 years ago by userid99 (previous) (diff)

comment:11 by Carl Eugen Hoyos, 10 years ago

Resolution: fixed
Status: reopenedclosed

Please open a new ticket that does not contain the word "subtitle", neither in the title nor in the description.

comment:12 by userid99, 10 years ago

Opened new ticket #3167

Note: See TracTickets for help on using tickets.