HaveAGitGat / Tdarr

Tdarr - Distributed transcode automation using FFmpeg/HandBrake + Audio/Video library analytics + video health checking (Windows, macOS, Linux & Docker)
Other
3.02k stars 94 forks source link

Could not find tag for codec none #860

Closed adefaria closed 1 year ago

adefaria commented 1 year ago

Recently I recorded a lot of videos at a guitar camp I went to in Nashville. Upon coming home I tried running them through Tdarr and most of them failed with:

Could not find tag for codec none in stream #2, codec not currently supported in container

9XjaZfUcur-log.txt

I have a small sample file that exhibits the problem that you can get from https://defaria.com/tmp/More%20Hallway%20Jams.mp4. Note that for some reason my browser won't play the file when I click on it but you can download it and play it locally.

The ffmpeg command is:

2023-09-26T02:22:22.094Z 9XjaZfUcur:Node[Earth]:Worker[awful-ant]:[2/3] tdarr-ffmpeg -i "/Videos/Tommy Emmanuel Guitar Camp/2023 - Nashville/More Hallway Jams.mp4" -map 0:v? -map 0:a? -map 0:s? -map 0:d? -map 0:t? -c copy "/tmp/More Hallway Jams-TdarrCacheFile-QKhrNCG6i.mp4"

The error message apparently is:

2023-09-26T02:22:22.118Z [mp4 @ 0x55fd8d524f80] Could not find tag for codec none in stream #2, codec not currently supported in container
2023-09-26T02:22:22.118Z [out#0/mp4 @ 0x55fd8d519cc0] Could not write header (incorrect codec parameters ?): Invalid argument
2023-09-26T02:22:22.118Z [dost#0:3/copy @ 0x55fd8d52a140] Error initializing output stream: 
2023-09-26T02:22:22.118Z Stream mapping:
2023-09-26T02:22:22.118Z   Stream #0:2 -> #0:0 (copy)
2023-09-26T02:22:22.118Z   Stream #0:1 -> #0:1 (copy)
2023-09-26T02:22:22.118Z   Stream #0:0 -> #0:2 (copy)
2023-09-26T02:22:22.118Z   Stream #0:3 -> #0:3 (copy)

First, why is Tdarr converting an .mp4 to an .mp4? I expected it to convert it to .mkv.

Secondly, it seems that removing the second, -map 0:a? allows the transcode to succeed.

Finally, is there some sort of config that I can tweak to get this to work properly

These videos were recorded using my Pixel 7 Pro phone and I have about 104 of them which I don't relish the thought of doing all by hand. Is there a setting I should use on the Pixel to make sure I don't encounter this problem in the future?

supersnellehenk commented 1 year ago

It's the 4th stream causing issues Stream #0:3[0x4](eng): Data: none (mett / 0x7474656D) (default), add the remove datastreams plugin from vdka to your stack, at the top.

Those data streams are usually some kind of metadata a single app can read and you don't really benefit from it outside of that.

adefaria commented 1 year ago

Could you describe to me how to do that? I haven't messed with plugins except to enable hardware transcoding and that was a long time ago.

Thanks

supersnellehenk commented 1 year ago

Could you describe to me how to do that? I haven't messed with plugins except to enable hardware transcoding and that was a long time ago.

Thanks

You grab the DataStreams plugin ID and add it to the top of your stack. I'm not sure what I'd need to explain besides that.

adefaria commented 1 year ago

Well I found:

Remove Data Streams

[Contains built-in filter] This plugin removes data streams if detected. The output container is mkv. Helps with issues like bin_data making files impossible to process.

I assume you mean that. And I copied the ID - Tdarr_Plugin_vdka_Remove_DataStreams. But I'm not sure how to add it to the top of my stack. Seems the menus have changed a little bit since last time.

Hmmm... Found plugin stuff under the library. Searched and found Remove Data Streams and just had to drag and drop it onto the top of the stack and that seems to have worked! Not sure what grabbing the plugin ID was for...

Thanks man!

adefaria commented 1 year ago

Hmmm... I copied this newly transcoded file to my NextCloud server and when I attempt to play it I get a blank screen. I'm not sure if this is a NextCloud problem. Try https://cloud.defariahome.com/index.php/s/BjBqtLzssxJKep5.

supersnellehenk commented 1 year ago

It's HEVC, probably doesn't work in browsers. Browser playback of HEVC has improved but still isn't the best. Try it with something like VLC.

adefaria commented 1 year ago

Yeah it works find with vlc and even Plex. Just trying to make sure I don't have unwatchable videos after transcoding things. I want to share it with some of my friends and some are on my Plex server while others aren't so I often point them to my NextCloud which fails to play them since it's essentially a browser-based app. I'm generally on Brave but will also use Chrome and Firefox. They often just download the file which kinda defeats my purpose. Any ideas of how to get browsers to stream HEVC videos?

supersnellehenk commented 1 year ago

That's up to the browser maker, you can't influence that.

adefaria commented 1 year ago

Well, anyway, thanks for all your help.