AlexPresso / VideoStation-FFMPEG-Patcher

Patcher to enable DTS, EAC3 and TrueHD transcoding support to Synology VideoStation (from DSM 6.2 to DSM 7.0 and above ; ffmpeg4, 5, 6, 7 ready)
1.04k stars 100 forks source link

[BUG] dvvideo plays sound but black video #39

Closed Subtixx closed 2 years ago

Subtixx commented 2 years ago

System details

Describe the bug A video using dvvideo codex shows a black image but plays the sound.

Resolution: 720 x 576
Container: dv
Videocodec: dvvideo
Audiocodec: pcm_s16le
Videobitrate: 28141.7 Kbps

FFMPEG logs https://gist.github.com/Subtixx/aedb7818be53f67054826f5df7018280

AlexPresso commented 2 years ago

Hm... interesting, could you provide me the following logs please:

ffmpeg-FFMxxxx.stderr (containing chunks transcoding operations)

Subtixx commented 2 years ago

It wasn't possible for me to do tail-100 nor head -300 because the file is gone in 1-2 seconds. BUT I managed to grab it one time using WinSCP by reloading really fast.

https://gist.github.com/Subtixx/2fdae61bab6c66721b34a517a80356dd

EDIT: Can confirm, files in /tmp/VideoStation/XXXX/*.ts only contain sound.

No idea if helpful (video_metadata from the tmp folder):

{"bitrate":29946453,"container_type":"avi","device":"","duration":31,"filesize":"117240364","hls_header":true,"path":"/volume1/Videos/1999/Europa Park/Europa Park'19990724 17.16.14.avi","profile_key":"mpegts_hd720_x264_vb4500_mp3_ab128","profile_value":"-threads 0 -vcodec libx264 -vsync 2 -preset superfast -vprofile baseline -level 30 -s hd720 -vb 4500k -acodec libmp3lame -ab 128k -ac 2 -f ssegment","start_time":0,"track_info":{"audio":[{"bitrate":1024000,"channel":2,"channel_layout":"2 channels","codec":"pcm_s16le","codec_raw":"pcm_s16le","frequency":32000,"id":"1","is_default":false,"language":"","profile":"","sample_rate":32000,"streamid":1,"track":"1"}],"subtitle":[],"video":[{"bitrate":28836829,"codec":"dvvideo","codec_raw":"dvvideo","codec_tag":"dvsd","display_x":768,"display_y":576,"framerate":25,"framerate_den":1,"framerate_num":25,"id":"0","language":"","level":0,"pix_fmt":"yuv420p","profile":"","resolutionx":720,"resolutiony":576,"rotate":0,"sample_aspect_ratio_den":15,"sample_aspect_ratio_num":16,"track":"0"}]},"use_pre_analysis":true}

EDIT2: Converting it manually with the community ffmpeg to mp4 / h264 gives me a picture.

AlexPresso commented 2 years ago

Really interesting, thanks for the investigations, I suppose it is related to the video codec, ffmpeg gives a warning about it: [swscaler @ 0x8fcb20] deprecated pixel format used, make sure you did set range correctly

The wrapper may handle it badly. As I'm currently re-writing the wrapper in #33, if for now, you're okay with manually converting this video codec, I'll come back to you once it is merged so we can try again and see if it's fixed or not.

Subtixx commented 2 years ago

Ok thanks, would be great. A pain to have two copies of each video but oh well.

Also I noticed VideoStation / ffmpeg cannot handle interlaced video. Is that something you could look into aswell?

AlexPresso commented 2 years ago

ffmpeg does handle interlaced video but I think VideoStation doesn't.

It's something I can probably look into if I have time, after all bugs are fixed. But if VideoStation doesn't support it natively (I mean without using the wrapper), it would be like adding a new feature to VideoStation and it's not really what the wrapper is meant to be.

I'd like to keep it simple and only have it acting like a pass-through to the SynoCommunity's ffmpeg, which is compiled with everything needed to encode/decode audio codecs that are supported, but have been explicitly denied by Synology.

Adding this kind of features to VideoStation is not an easy task, the ffmpeg args are statically generated by a function in libsynovte.so and directly passed to the wrapper. I could catch some of these args or completely re-generate args by probing the video file but it requires a lot of time to spend on testing and debugging.

AlexPresso commented 2 years ago

Hi Subtixx, does the new wrapper fixes this issue ?

Subtixx commented 2 years ago

You wont believe but actually, YES it did :). dvvideo now works! Thank you very very much