How to edit or add video metadata of "rotation" in mp4? - multimedia

I want put rotation information into my mp4 video file but I have no idea about this.
Is there any program that I can add "rotation" metadata?
It would be OK if there's the way to edit video content with hexa editor.

+1 for FFMpeg. More specifically, I had good results correcting orientation metadata with
ffmpeg -i input.mp4 -metadata:s:v rotate=90 -vcodec copy -acodec copy output.mp4

Check out the software FFMpeg, use ffprobe to give you the rotation metadata of any video file if it has it.
Check out this answer for functions allowing your to rotate videos.

Related

Asp net, stream raw h264 to browser

I looking for read raw h264 streaming video into a web browser.
It is a live flow (so there is no way to convert file), from a raspberry's camera.
I successfully read this flow with vlc with a manipulation (forcing the codec input : https://www.unifore.net/ip-video-surveillance/how-to-play-264-video-files-from-ip-cameras-dvrs.html ).
But h264 raw without a container (like mp4) seems prohibited by browsers.
There no many ressources about this point. And some questions on Stackoverflow.com like this post are asked without answer.
Maybe I do not use the good way, so all suggestions are welcome. :)
Thanks !

Which DirectShow source filters are used by WMP?

I'm trying to split a *.mov file in to raw audio an raw video. I have a DirectShow filter which is working as decoder for the video stream and Windows Media Player can actually see and use it to play this video file but I having a hard time figuring out how does it work exactly since I need to compose a complex DirectShow graph. I assumed that WMP will use WM ASF Rreader but if I try to add this filter to the graph in GraphEdit with *.mov file as parameter it's failing with 0xc00d0026 error code which makes sense since it's suppose to work with uncompressed formats only.
Which other DirectShow source filters can be used by WMP in order to split a *.mov video file in to raw video and audio?
Windows Media Player (current versions, not ancient) does not use DirectShow for MOV files. Instead, it uses Media Foundation.
FYI: 0xC00D0026 is NS_E_UNRECOGNIZED_STREAM_TYPE "The specified protocol is not recognized. Be sure that the file name and syntax, such as slashes, are correct for the protocol."
I suppose you can find suitable DirectShow components to demultiplex MOV files: Haali Media Splitter, GDCL MPEG-4 Demultiplexer are among widely used.

How can I convert avi to mp4 using graphedit and ffdshow?

I´m working on an application based on directshow that has to convert an AVI source file to to an mp4-file that can be played back with Quicktime.
Since 3ivx, according to my web research the most popular way to fulfill this task, has become commercial (and my budget is quite limited), I decided to use a solution based on ffdshow.
I created a simple graph in graphedit, using LAME for audio encoding and GDCL MPEG 4 Multiplexor for the muxing, but everytime I try to play the movie with Quicktime, I´m getting an error indicating a wrong "sample description".
Playback with Windows Media Player is working, except that there is no sound.
My guess is that there´s a problem with the muxer, because every time I try to add audio encoding, graphedit automatically adds an decoder after the encoding unit (see picture link).
http://imageshack.us/photo/my-images/39/graphjrgr.png/
Any ideas on how to integrate ffdshow in a better way, tips for alternative mp4 muxers, or a complete different approach are appreciated!
The GDCL muxer has limited number of audio formats that it supports, probably you should check the source code for the muxer to see if the formats you are using are in fact supported. Basically, you need to choose an audio encoder that the mux recognizes as valid. It might be possible to use GraphEdit to choose different properties for the encoder filter that allow things to work better.
I have had some luck with the Monogram x264(video) and AAC(audio) encoders. See http://blog.monogram.sk/janos/directshow-filters/
Finally, try the debug version of the GDCL mp4 muxer.
Also, you must be aware of MPEG-4 LA licensing requirements for x264 http://www.mpegla.com/main/programs/AVC/Pages/FAQ.aspx

How to create a graph in order to parse an mp4 file to get the duration?

I am trying to find duration of an mp4 file using direct show component of windows using the Dotnet wrapper(directShow-lib 2005). But the method i used was GetDuration of IMediaSeeking interface. But this returns zero as duration.
After searching i found the following statement:
"It doesn't matter whether it's in a container or not, it
only matters whether you have a parser/reader for it. There
is no stock DirectShow parser to read raw H.264 files and no
third-party one I can think of. Also, whether IMediaSeeking
would work with such a raw file is implementation-dependent.
Last, most H.264-related filters use MPEG2Video or
VideoInfo2 and neither works with MediaDet, so you would
have to build the graph yourself."
Any body please help me to do this in c#.net?
You'll need to either find or make an MP4 file source filter to make this work. You can build one with mp4v2 or follow the instructions here.

Automatic YUV -> RGB in DirectShow for custom decoder

after hours of searching on the net I'm quite desperate to find solution for this. I've up & running OGG Theora decoder in DirectShow which ouputs YV12 and YUY2 color models.
Now, I want to make a RGB pixel manipulation filter for this output and to process it into video renderer.
According to this and
this, it should be really easy and transparent but it isn't.
For example, I implemented in CheckInputType() this check:
if( IsEqualGUID(*mtIn->Type(), MEDIATYPE_Video )
&& IsEqualGUID(*mtIn->Subtype(), MEDIASUBTYPE_RGB565 ) )
{
return S_OK;
}
and I would expect it inserts that MSYUV between Theora and my decoder and do the job for me (i.e. convert it into RGB). The problem is I got error everytime (in GraphEdit application). And I'm 100% sure it's YV12 as input (checked in debugger). Only explanation I could think of is that mention of AVI decompressor but there's no further info about it.
Does it mean I have to use AVI container if I want to get this automatic functionality?
Strange thing is it works for example for WMV videos (with YUV on their ouput), only this OGG decoder has a problem with it. So it's probably a question what this OGG decoder miss?
Too bad that MSYUV filter doesn't work as the Color Space Converter, i.e. visible and directly usable in GraphEdit...
I appreciate any hint on this, programming own YV12 -> RGB converter I take as the last resort.
There is no YUV to RGG colorspace converter built into Directshow. The reason that WMV files are working for you is that the WMV decoder filter will spit out RGB or YUV data depending on the type of filter you connect it too.
The best you can do here is write a colorspace converter filter yourself, or just convert the YUV data after you get it.
Fourcc.org has nice article on converting from YUV to RGB. Also the book Video Demystified by Keith Jack has all the details on colorspace conversions.

Resources