I've hit a brick-wall trying to resolve this issue, so here I am.
I have a camera that outputs a HEVC video stream (See image one of what VLC tells me about the stream).
I want to write this stream directly to an mp4 file.
This seems like a pretty simple thing, use ffmpeg to copy the streams to the file, done.
This however results in a file that when played in VLC displays no video. No broken video, just... nothing. The codec info has also been changed. See the second image.Code:ffmpeg -i rtsp://someuser:1111@192.168.0.123:10554/udp/av0_0 -c:v copy -c:a aac output.mp4
Now, interestingly, if I output to an AVI file instead, that works AND the buffer dimensions show up correctly. Sadly, AVI is not an option.
So I guess I'm looking for any help as to why ffmpeg is generating an unplayable file from this stream. I am suspicious of the change in buffer dimensions especially, but not a clue how to fix that.
+ Reply to Thread
Results 1 to 14 of 14
-
Last edited by Drunlade; 21st Oct 2021 at 23:50.
-
If you don't set the directive to copy the stream, it seems that ffmpeg wants to re-encode the stream instead, as seen in the resulting stream mapping:
Code:Stream #0:0 -> #0:0 (hevc (native) -> h264 (libx264))
-
-
I appreciate the help, but that really doesn't make much sense as a solution. The video is encoded in H265 already. This just decodes the existing H265 and then encodes it into a slightly different variation of H265. This obviously loses video quality in the process, but more importantly uses a lot of processing resources, which simply aren't going to be available.
-
maybe read "How to generate an MP4 with H.265 codec using FFmpeg" - https://superuser.com/questions/785528/how-to-generate-an-mp4-with-h-265-codec-using-ffmpeg/785532
-
Did you just "Google that for me"? haha I have indeed spent quite some considerable time looking at stackoverflow, superuser, etc,
You have the wrong end of the stick though with that particular result, that is once again talking about encoding for MP4 files. I do not wish to encode it, it's already encoded, I just want to stream it to a file that works, and MP4 files support the codec in question. -
Sadly not, if you see the opening comment, I was indeed using a copy - not "simple" I guess, but only because the audio format is unsupported in MP4 files so needed encoding. FFMPEG is doing something to the stream or MP4 headers that's breaking the ability to playback the file.
-
You could first remux video/convert audio to mp4 and stream the resulting mp4 after.
-
Another idea: the tee muxer
Read https://superuser.com/questions/1297574/how-can-i-convert-video-and-stream-it-at-same-...ime-use-ffmpeg -
might also try ffmpeg.org - https://trac.ffmpeg.org/wiki/Encode/H.265
-
I vote for this approach, One could use mkv (or .ts would be another option) as an intermediate format and directly remux the stream to mp4 while recording. Also, make sure you are using the very latest version of ffmpeg, not the latest release build, see gyandev's homepage for more infos on that.
It is still possible tough that the final mp4 would still not work, in that case you'd need to check if you can live with another container.
Example:
ffmpeg -i rtsp://someuser:1111@192.168.0.123:10554/udp/av0_0 -c:v copy -c:a aac -f matroska - | ffmpeg -i - -codec copy -map 0 C:\temp\my_record.mp4
With the current information we have, i suspect you found a bug in the ffmpeg mp4 muxer, or better a non supported h265 stream, you could also report that in ffmpeg trac.
Similar Threads
-
Volume Leveling on HEVC .mp4 Files
By jmdale1984 in forum AudioReplies: 6Last Post: 27th Nov 2018, 10:37 -
converting UHD HEVC passthrough ?
By misho in forum Video ConversionReplies: 7Last Post: 14th Jun 2017, 02:18 -
How do I take out HEVC from my video Files?
By RBCC in forum Video ConversionReplies: 5Last Post: 31st Mar 2017, 21:25 -
DV avi imported files unplayable in split parts
By Batman918 in forum Camcorders (DV/HDV/AVCHD/HD)Replies: 2Last Post: 4th Nov 2016, 18:24 -
"M2U***.MPG" 219 video files Unplayable & Unknown fileformat.
By MPEGPS in forum Newbie / General discussionsReplies: 7Last Post: 3rd Nov 2016, 22:00